paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Out of Context: How important is Local Context in Neural Program Repair?

脱离上下文:局部上下文在神经程序修复中有多重要?
ICSE Proceedings of the IEEE/ACM 46th International Conference on Software Engineering2024匹配度 3/10 · 论文属于神经程序修复(APR),研究局部上下文配置对修复成功率的影响,虽属PL与AI交叉,但与用户的静态分析、Agentic程序分析、浮点程序分析及贝叶斯程序分析等核心方向不直接相关。它不涉及LLM/Agent改进分析、形式化验证,也未聚焦工业落地或重要缺失场景的benchmark设计。引用 18 inbox
Julian Aron Prenner, Romain Robbes
crossref: 2026-09-12

AI 速览

一句话:系统研究神经程序修复中局部上下文配置对修复成功率的影响,并给出上下文窗口分配建议。

深度学习的源代码模型已被成功用于自动程序修复,但当前模型输入窗口较小,常无法容纳修复所需的完整项目上下文,因此输入通常局限于缺陷位置上下若干行的局部上下文。本文研究局部上下文对修复成功的重要性:需要多少局部上下文?缺陷位置之前与之后的上下文哪个更重要?局部上下文与缺陷类型有何关系?作者在三个数据集、两种编程语言上,以多种局部上下文配置训练和评估 Transformer 模型。结果表明,修复成功率总体上随局部上下文规模增大而提高(但并非所有缺陷类型都如此),并验证了约 50%--60% 输入窗口应留给缺陷之前上下文的常见做法。该结论对神经程序修复研究者及基准/数据集创建者均有参考价值。

问题
该研究关注神经程序修复中模型输入窗口有限、只能使用局部上下文时,局部上下文的数量、位置及其与缺陷类型的关系对修复效果的影响。
方法
在三个数据集和两种编程语言上,以多种局部上下文配置训练并评估 Transformer 模型,比较不同上下文窗口设置下的修复表现。
评估
通过跨数据集、跨语言的修复成功率对比,分析上下文规模与前后位置的作用,并检验不同缺陷类型下的差异。
原文摘要(Abstract)

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.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot11407,
  title = {Out of Context: How important is Local Context in Neural Program Repair?},
  author = {Julian Aron Prenner and Romain Robbes},
  booktitle = {ICSE},
  year = {2024},
  doi = {10.1145/3597503.3639086}
}