Enhancing Neural Code Representation with Additional Context
Not on the map. Why?
Abstract (arXiv)
Automated program comprehension underpins many software engineering tasks, from code summarisation to clone detection. Recent deep learning models achieve strong results but typically rely on source code alone, overlooking contextual information such as version history or structural relationships. This limits their ability to capture how code evolves and operates. We conduct an empirical study on how enriching code representations with such contextual signals affects neural model performance on key comprehension tasks. Two downstream tasks, code clone detection and code summarisation, are evaluated using SeSaMe (1,679 Java methods) and CodeSearchNet (63,259 methods). Five representative models (CodeBERT, GraphCodeBERT, CodeT5, PLBART, ASTNN) are fine-tuned under code-only and context-augmented settings. Results show that context generally improves performance: version history consistently boosts clone detection (e.g., CodeT5 +15.92% F1) and summarisation (e.g., GraphCodeBERT +5.56% METEOR), while call-graph effects vary by model and task. Combining multiple contexts yields further gains (up to +21.48% macro-F1). Human evaluation on 100 Java snippets confirms that context-augmented summaries are significantly preferred for Accuracy and Content Adequacy (p <= 0.026; |delta| up to 0.55). These findings highlight the potential of contextual signals to enhance code comprehension and open new directions for optimising contextual encoding in neural SE models.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 27 of its 59 references that are in the map. First posted on arXiv 14 Oct 2025.
Builds on
27 of 59 references.
References · 27
- 2019BERTScore: Evaluating Text Generation with BERTcited by 5,462
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
- 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 638
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 600
- 2024LLM2Vec: Large Language Models Are Secretly Powerful Text Encoderscited by 396
- 2021Unified Pre-training for Program Understanding and Generationcited by 361
- 2018code2vec: Learning Distributed Representations of Codecited by 249
- 2020Improved Code Summarization via a Graph Neural Networkcited by 79
- 2018Neural Code Comprehension: A Learnable Representation of Code Semanticscited by 59
- 2020CC2Vec: Distributed Representations of Code Changescited by 38
15 more
- 2019Automatic Source Code Summarization with Extended Tree-LSTMcited by 28
- 2022Are We Building on the Rock? On the Importance of Data Preprocessing for Code Summarizationcited by 22
- 2023Evaluating Code Summarization Techniques: A New Metric and an Empirical Characterizationcited by 21
- 2024Assessing AI Detectors in Identifying AI-Generated Code: Implications for Educationcited by 18
- 2022An Extractive-and-Abstractive Framework for Source Code Summarizationcited by 15
- 2025Can LLMs Reason About Program Semantics? A Comprehensive Evaluation of LLMs on Formal Specification Inferencecited by 14
- 2025Too Noisy To Learn: Enhancing Data Quality for Code Review Comment Generationcited by 12
- 2022AutoPruner: Transformer-Based Call Graph Pruningcited by 11
- 2025Generative AI and Empirical Software Engineering: A Paradigm Shiftcited by 9
- 2022Multi-View Graph Representation for Programming Language Processing: An Investigation into Algorithm Detectioncited by 6
- 2023Multi-Granularity Detector for Vulnerability Fixescited by 4
- 2023Evaluating Transfer Learning for Simplifying GitHub READMEscited by 4
- 2022Adding Context to Source Code Representations for Deep Learningcited by 2
- 2025EnseSmells: Deep ensemble and programming language models for automated code smells detectioncited by 1
- 2025From Empirical Evaluation to Context-Aware Enhancement: Repairing Regression Errors with LLMscited by 1
Built on by
Not cited yet.