CodeExp: Explanatory Code Document Generation
Not on the map. Why?
Abstract (arXiv)
Developing models that can automatically generate detailed code explanation can greatly benefit software maintenance and programming education. However, existing code-to-text generation models often produce only high-level summaries of code that do not capture implementation-level choices essential for these scenarios. To fill in this gap, we propose the code explanation generation task. We first conducted a human study to identify the criteria for high-quality explanatory docstring for code. Based on that, we collected and refined a large-scale code docstring corpus and formulated automatic evaluation metrics that best match human assessments. Finally, we present a multi-stage fine-tuning strategy and baseline models for the task. Our experiments show that (1) our refined training dataset lets models achieve better performance in the explanation generation tasks compared to larger unrefined data (15x larger), and (2) fine-tuned models can generate well-structured long docstrings comparable to human-written ones. We envision our training dataset, human-evaluation protocol, recommended metrics, and fine-tuning strategy can boost future code explanation research. The code and annotated data are available at https://github.com/subercui/CodeExp.
Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). Builds on 12 of its 38 references that are in the map. First posted on arXiv 25 Nov 2022.
Builds on
12 of 38 references.
References · 12
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2019BERTScore: Evaluating Text Generation with BERTcited by 5,512
- 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,411
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 906
- 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 654
- 2020A Transformer-based Approach for Source Code Summarizationcited by 133
- 2020PyMT5: multi-mode translation of natural language and Python code with transformerscited by 80
- 2017A parallel corpus of Python functions and documentation strings for automated code documentation and code generationcited by 57
- 2020Code to Comment "Translation": Data, Metrics, Baselining & Evaluationcited by 29
- 2019Automatic Code Summarization: A Systematic Literature Reviewcited by 18
- 2019A Survey of Automatic Generation of Source Code Comments: Algorithms and Techniquescited by 15
Built on by
Citing papers per year: 2023: 1; 2024: 3.
4 papers.
- 2023OctoPack: Instruction Tuning Code Large Language Modelscited by 189
- 2024Data Analysis in the Era of Generative AIcited by 6
- 2024Mastering the Craft of Data Synthesis for CodeLLMscited by 3
- 2024Evaluating the Quality of Code Comments Generated by Large Language Models for Novice Programmerscited by 0
- 2024Mastering the Craft of Data Synthesis for CodeLLMs16 Oct 2024
- 2024Data Analysis in the Era of Generative AI27 Sep 2024
- 2024Evaluating the Quality of Code Comments Generated by Large Language Models for Novice Programmers22 Sep 2024
- 2023OctoPack: Instruction Tuning Code Large Language Models14 Aug 2023