mlsanityData to 7 Oct 2026

The Behavior of Large Language Models When Prompted to Generate Code Explanations

arXiv 2311.01490 ↗First posted 2 Nov 2023cs.SE cs.AIcited by 3

Not on the map. Why?

Abstract (arXiv)

This paper systematically investigates the generation of code explanations by Large Language Models (LLMs) for code examples commonly encountered in introductory programming courses. Our findings reveal significant variations in the nature of code explanations produced by LLMs, influenced by factors such as the wording of the prompt, the specific code examples under consideration, the programming language involved, the temperature parameter, and the version of the LLM. However, a consistent pattern emerges for Java and Python, where explanations exhibit a Flesch-Kincaid readability level of approximately 7-8 grade and a consistent lexical density, indicating the proportion of meaningful words relative to the total explanation size. Additionally, the generated explanations consistently achieve high scores for correctness, but lower scores on three other metrics: completeness, conciseness, and specificity.

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

Builds on

10 of 23 references.

References · 10

  1. 2023GPT-4 Technical Reportcited by 18,132
  2. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
  3. 2020A Primer in BERTology: What we know about how BERT workscited by 807
  4. 2023Time Travel in LLMs: Tracing Data Contamination in Large Language Modelscited by 175
  5. 2022Large Language Models Meet NL2Code: A Surveycited by 135
  6. 2022Automatic Generation of Programming Exercises and Code Explanations using Large Language Modelscited by 124
  7. 2023ChatGPT is not all you need. A State of the Art Review of large Generative AI modelscited by 85
  8. 2022Experiences from Using Code Explanations Generated by Large Language Models in a Web Software Development E-Bookcited by 84
  9. 2021What do pre-trained code models know about code?cited by 36
  10. 2023Distilled GPT for Source Code Summarizationcited by 30

Built on by

Cited by year

Citing papers per year: 2024: 2; 2025: 1.

3 papers.