mlsanityData to 7 Oct 2026

Benchmarking and Explaining Large Language Model-based Code Generation: A Causality-Centric Approach

arXiv 2310.06680 ↗First posted 10 Oct 2023cs.SE cs.AIcited by 15

Not on the map. Why?

Abstract (arXiv)

While code generation has been widely used in various software development scenarios, the quality of the generated code is not guaranteed. This has been a particular concern in the era of large language models (LLMs)- based code generation, where LLMs, deemed a complex and powerful black-box model, is instructed by a high-level natural language specification, namely a prompt, to generate code. Nevertheless, effectively evaluating and explaining the code generation capability of LLMs is inherently challenging, given the complexity of LLMs and the lack of transparency. Inspired by the recent progress in causality analysis and its application in software engineering, this paper launches a causality analysis-based approach to systematically analyze the causal relations between the LLM input prompts and the generated code. To handle various technical challenges in this study, we first propose a novel causal graph-based representation of the prompt and the generated code, which is established over the fine-grained, human-understandable concepts in the input prompts. The formed causal graph is then used to identify the causal relations between the prompt and the derived code. We illustrate the insights that our framework can provide by studying over 3 popular LLMs with over 12 prompt adjustment strategies. The results of these studies illustrate the potential of our technique to provide insights into LLM effectiveness, and aid end-users in understanding predictions. Additionally, we demonstrate that our approach provides actionable insights to improve the quality of the LLM-generated code by properly calibrating the prompt.

Key facts. Cited by 15 papers in the map (data through 7 Oct 2026). Builds on 55 of its 86 references that are in the map. First posted on arXiv 10 Oct 2023.

Builds on

55 of 86 references.

References · 55

  1. 2020Language Models are Few-Shot Learnerscited by 32,199
  2. 2023GPT-4 Technical Reportcited by 18,132
  3. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  4. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
  5. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  6. 2022Self-Consistency Improves Chain of Thought Reasoning in Language Modelscited by 5,601
  7. 2021Program Synthesis with Large Language Modelscited by 3,509
  8. 2023Tree of Thoughts: Deliberate Problem Solving with Large Language Modelscited by 3,155
  9. 2022Emergent Abilities of Large Language Modelscited by 2,483
  10. 2021Pre-train, Prompt, and Predict: A Systematic Survey of Prompting Methods in Natural Language Processingcited by 2,222
  11. 2019Fine-Tuning Language Models from Human Preferencescited by 2,124
  12. 2022Large Language Models Encode Clinical Knowledgecited by 1,807
38 more
  1. 2018A Call for Clarity in Reporting BLEU Scorescited by 1,790
  2. 2023Improving Factuality and Reasoning in Language Models through Multiagent Debatecited by 1,739
  3. 2021Multitask Prompted Training Enables Zero-Shot Task Generalizationcited by 1,462
  4. 2022Competition-Level Code Generation with AlphaCodecited by 1,427
  5. 2022Large Language Models Are Human-Level Prompt Engineerscited by 1,020
  6. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
  7. 2021Measuring Coding Challenge Competence With APPScited by 879
  8. 2023Large Language Models as Optimizerscited by 830
  9. 2023Semantic Uncertainty: Linguistic Invariances for Uncertainty Estimation in Natural Language Generationcited by 795
  10. 2018DAGs with NO TEARS: Continuous Optimization for Structure Learningcited by 745
  11. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
  12. 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 638
  13. 2023Automatic Prompt Optimization with "Gradient Descent" and Beam Searchcited by 628
  14. 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 468
  15. 2021Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributionscited by 417
  16. 2022CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learningcited by 342
  17. 2019DAG-GNN: DAG Structure Learning with Graph Neural Networkscited by 329
  18. 2013Learning Bayesian Networks: The Combination of Knowledge and Statistical Datacited by 185
  19. 2023An Empirical Study of the Non-determinism of ChatGPT in Code Generationcited by 134
  20. 2021DiBS: Differentiable Bayesian Structure Learningcited by 105
  21. 2022Uncertainty Quantification with Pre-trained Language Models: A Large-Scale Empirical Analysiscited by 104
  22. 2023Cumulative Reasoning with Large Language Modelscited by 94
  23. 2013Learning Equivalence Classes of Bayesian Networks Structurescited by 75
  24. 2022Automated Repair of Programs from Large Language Modelscited by 71
  25. 2019Code Generation as a Dual Task of Code Summarizationcited by 62
  26. 2019Text Readability Assessment for Second Language Learnerscited by 54
  27. 2022Causality-based Neural Network Repaircited by 44
  28. 2016Double/Debiased Machine Learning for Treatment and Causal Parameterscited by 41
  29. 2022No More Fine-Tuning? An Experimental Evaluation of Prompt Tuning in Code Intelligencecited by 41
  30. 2021Pushing on Text Readability Assessment: A Transformer Meets Handcrafted Linguistic Featurescited by 36
  31. 2022CCTEST: Testing and Repairing Code Completion Systemscited by 35
  32. 2018A Grammar-Based Structural CNN Decoder for Code Generationcited by 29
  33. 2018Causal Testing: Finding Defects' Root Causescited by 22
  34. 2023LFTK: Handcrafted Features in Computational Linguisticscited by 19
  35. 2023Evaluating the Robustness of Discrete Promptscited by 18
  36. 2022Adaptive Fairness Improvement Based on Causality Analysiscited by 17
  37. 2022Membership Inference Attacks and Generalization: A Causal Perspectivecited by 17
  38. 2022Causality in Configurable Software Systemscited by 13

50 most cited of 55 All 55 (JSON)

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 11; 2025: 3; 2026: 1.

15 papers.

Sort:

By area: