Out of Context: How important is Local Context in Neural Program Repair?
Not on the map. Why?
Abstract (arXiv)
Deep learning source code models have been applied very successfully to the problem of automated program repair. One of the standing issues is the small input window of current models which often cannot fully fit the context code required for a bug fix (e.g., method or class declarations of a project). Instead, input is often restricted to the local context, that is, the lines below and above the bug location. In this work we study the importance of this local context on repair success: how much local context is needed?; is context before or after the bug location more important? how is local context tied to the bug type? To answer these questions we train and evaluate Transformer models in many different local context configurations on three datasets and two programming languages. Our results indicate that overall repair success increases with the size of the local context (albeit not for all bug types) and confirm the common practice that roughly 50-60% of the input window should be used for context leading the bug. Our results are not only relevant for researchers working on Transformer-based APR tools but also for benchmark and dataset creators who must decide what and how much context to include in their datasets.
Key facts. Cited by 5 papers in the map (data through 14 Oct 2026). Builds on 17 of its 52 references that are in the map. First posted on arXiv 8 Dec 2023.
Builds on
17 of 52 references.
References · 17
- 2017Attention Is All You Needcited by 60,361
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
- 2018Self-Attention with Relative Position Representationscited by 1,120
- 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,103
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 906
- 2018SequenceR: Sequence-to-Sequence Learning for End-to-End Program Repaircited by 145
- 2021CURE: Code-Aware Neural Machine Translation for Automatic Program Repaircited by 86
- 2023Impact of Code Language Models on Automated Program Repaircited by 85
- 2023On the Robustness of Code Generation Techniques: An Empirical Study on GitHub Copilotcited by 64
- 2023RAP-Gen: Retrieval-Augmented Patch Generation with CodeT5 for Automatic Program Repaircited by 44
- 2019How Often Do Single-Statement Bugs Occur? The ManySStuBs4J Datasetcited by 36
5 more
- 2017ARJA: Automated Repair of Java Programs via Multi-Objective Genetic Programmingcited by 26
- 2021Elixir: Effective object-oriented program repaircited by 16
- 2022TSSB-3M: Mining single statement bugs at massive scalecited by 14
- 2021Megadiff: A Dataset of 600k Java Source Code Changes Categorized by Diff Sizecited by 10
- 2022JEMMA: An Extensible Java Dataset for ML4Code Applicationscited by 2
Built on by
Citing papers per year: 2024: 1; 2025: 2; 2026: 2.
5 papers.
- 2025Towards an Understanding of Context Utilization in Code Intelligencecited by 10
- 2024REDO: Execution-Free Runtime Error Detection for COding Agentscited by 2
- 2025Repairing Regex Vulnerabilities via Localization-Guided Instructionscited by 0
- 2026Human-Aligned Enhancement of Programming Answers with LLMs Guided by User Feedbackcited by 0
- 2026On the Impact of Code Comments for Automated Bug-Fixing: An Empirical Studycited by 0
- 2026On the Impact of Code Comments for Automated Bug-Fixing: An Empirical Study30 Jan 2026
- 2026Human-Aligned Enhancement of Programming Answers with LLMs Guided by User Feedback24 Jan 2026
- 2025Repairing Regex Vulnerabilities via Localization-Guided Instructions10 Oct 2025
- 2025Towards an Understanding of Context Utilization in Code Intelligence11 Apr 2025
- 2024REDO: Execution-Free Runtime Error Detection for COding Agents10 Oct 2024