paperbot · PL 论文追踪

全部论文 待读 收藏

P1 Domain Knowledge Matters: Improving Prompts with Fix Templates for Repairing Python Type Errors

领域知识至关重要:利用修复模板改进提示以修复 Python 类型错误
ICSE Proceedings of the IEEE/ACM 46th International Conference on Software Engineering2024匹配度 5/10 · 论文属于PL与AI交叉,利用修复模板增强提示来改进程序修复,与用户对LLM/Agent改进程序分析的兴趣部分相关;但聚焦Python动态类型错误修复,而非静态分析、形式化验证、浮点程序分析或贝叶斯程序分析等核心方向,且未强调工业落地或基于当前强模型。引用 46 inbox
Yun Peng, Shuzheng Gao, Cuiyun Gao, Yintong Huo, Michael Lyu
crossref: 2026-09-12

AI 速览

一句话:提出用类型错误修复模板增强提示,将领域知识注入代码预训练模型,以自动修复 Python 类型错误。

Python 的动态类型系统虽然便于开发,却使运行时类型错误普遍且难以修复。基于规则的方法依赖专家设计补丁合成模板,能对模板覆盖的错误生成准确补丁,但模板对真实世界类型错误的覆盖有限;基于学习的方法减轻了人工规则设计负担,其中基于提示(prompt)的方法在通用程序修复任务上取得先进效果,但提示由人工定义,未包含 Python 类型错误修复的特定线索,因而效果受限。本文研究如何利用领域知识自动改进提示,具体以修复模板(fix templates)将类型错误修复知识注入代码预训练模型,用于修复 Python 类型错误。摘要未给出具体数据集、基线或量化结果。

问题
Python 动态类型系统导致运行时类型错误普遍且难以修复。现有规则方法依赖专家设计模板且真实错误覆盖低,通用提示又缺少类型错误修复线索。
方法
提出利用修复模板(fix templates)编码领域知识来自动改进 prompt,并将其与代码预训练模型结合以生成修复补丁。
评估
摘要未提供具体评估设置与量化结果;工作面向真实世界 Python 类型错误修复,并旨在改进现有提示方法的效果。
原文摘要(Abstract)

As a dynamic programming language, Python has become increasingly popular in recent years. Although the dynamic type system of Python facilitates the developers in writing Python programs, it also brings type errors at run-time which are prevalent yet not easy to fix. There exist rule-based approaches for automatically repairing Python type errors. The approaches can generate accurate patches for the type errors covered by manually defined templates, but they require domain experts to design patch synthesis rules and suffer from low template coverage of real-world type errors. Learning-based approaches alleviate the manual efforts in designing patch synthesis rules and have become prevalent due to the recent advances in deep learning. Among the learning-based approaches, the prompt-based approach which leverages the knowledge base of code pre-trained models via pre-defined prompts, obtains state-of-the-art performance in general program repair tasks. However, such prompts are manually defined and do not involve any specific clues for repairing Python type errors, resulting in limited effectiveness. How to automatically improve prompts with the domain knowledge for type error repair is challenging yet under-explored.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot11461,
  title = {Domain Knowledge Matters: Improving Prompts with Fix Templates for Repairing Python Type Errors},
  author = {Yun Peng and Shuzheng Gao and Cuiyun Gao and Yintong Huo and Michael Lyu},
  booktitle = {ICSE},
  year = {2024},
  doi = {10.1145/3597503.3608132}
}