paperbot · PL 论文追踪

全部论文 待读 收藏

P2 FT2Ra: A Fine-Tuning-Inspired Approach to Retrieval-Augmented Code Completion

FT2Ra:一种受微调启发的检索增强代码补全方法
ISSTA Proceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis2024匹配度 3/10 · 论文研究检索增强的代码补全,属于AI与软件工程/程序语言的交叉,但未涉及用户核心关注的静态分析、形式化验证、Agentic程序或浮点/贝叶斯程序分析。其理论分析与工程实现结合的特点有一定参考价值,但方向匹配度较低。引用 15 inbox
Qi Guo, Xiaohong Li, Xiaofei Xie, Shangqing Liu, Ze Tang, Ruitao Feng, Junjie Wang, Jidong Ge, Lei Bu
crossref: 2026-09-12

AI 速览

一句话:提出 FT2Ra,通过模拟微调中的 delta logits、学习率与多轮检索,实现无需微调的检索增强代码补全。

代码预训练模型虽提升了代码补全等任务,但其规模使下游微调成本高昂;检索增强方法无需微调即可增强预测,但现有设计多依赖启发式,缺乏对存储/检索内容及插值方式的指导。本文先对微调过程进行理论分析,指出 delta logits 是提升模型预测的关键因素。基于此提出 FT2Ra:一种检索式方法,通过引入类似微调的学习率与多轮检索范式来模仿真实微调。作者在 token 级与行级代码补全上进行了全面评估。结果表明,FT2Ra 显著优于现有最佳方法:在较容易的 token 级补全中,于 UniXcoder 上准确率较最佳基线提升 4.29%;在更具挑战的行级补全中,Exact Match 提升超过两倍。值得注意的是,即使不进行真实微调,FT2Ra 也能与经过微调的模型竞争。

问题
代码预训练模型规模庞大,针对特定下游任务微调代价高;现有检索增强方法依赖启发式设计,难以确定应存储/检索何种信息以及如何插值以增强预测。
方法
通过理论分析微调过程,识别 delta logits 对预测改进的关键作用,并据此设计 FT2Ra:一种模拟真实微调的检索增强方法,采用带学习率与多轮检索的范式。
评估
在 token 级与行级代码补全任务上与最先进方法对比;token 级在 UniXcoder 上准确率提升 4.29%,行级 Exact Match 提升超过两倍,且无需真实微调即可与微调模型竞争。
原文摘要(Abstract)

The rise of code pre-trained models has significantly enhanced various coding tasks, such as code completion, and tools like GitHub Copilot. However, the substantial size of these models, especially large models, poses a significant challenge when it comes to fine-tuning them for specific downstream tasks. As an alternative approach, retrieval-based methods have emerged as a promising solution, augmenting model predictions without the need for fine-tuning. Despite their potential, a significant challenge is that the designs of these methods often rely on heuristics, leaving critical questions about what information should be stored or retrieved and how to interpolate such information for augmenting predictions. To tackle this challenge, we first perform a theoretical analysis of the fine-tuning process, highlighting the importance of delta logits as a catalyst for improving model predictions. Building on this insight, we develop a novel retrieval-based method, FT2Ra, which aims to mimic genuine fine-tuning. While FT2Ra adopts a retrieval-based mechanism, it uniquely adopts a paradigm with a learning rate and multi-epoch retrievals, which is similar to fine-tuning. We conducted a comprehensive evaluation of FT2Ra in both token-level and line-level code completions. Our findings demonstrate the remarkable effectiveness of FT2Ra when compared to state-of-the-art methods and its potential to genuine fine-tuning. In token-level completion, which represents a relatively easier task, FT2Ra achieves a 4.29% improvement in accuracy compared to the best baseline method on UniXcoder. In the more challenging line-level completion task, we observe a substantial more than twice increase in Exact Match (EM) performance, indicating the significant advantages of our theoretical analysis. Notably, even when operating without actual fine-tuning, FT2Ra exhibits competitive performance compared to the models with real fine-tuning.

链接与引用

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

BibTeX
@inproceedings{paperbot8586,
  title = {FT2Ra: A Fine-Tuning-Inspired Approach to Retrieval-Augmented Code Completion},
  author = {Qi Guo and Xiaohong Li and Xiaofei Xie and Shangqing Liu and Ze Tang and Ruitao Feng and Junjie Wang and Jidong Ge and Lei Bu},
  booktitle = {ISSTA},
  year = {2024},
  doi = {10.1145/3650212.3652130}
}