paperbot · PL 论文追踪

全部论文 待读 收藏

P2 A Semantic-based Optimization Approach for Repairing LLMs: Case Study on Code Generation

面向 LLM 修复的基于语义的优化方法:以代码生成为例
ICSE Proceedings of the 2026 IEEE/ACM 48th International Conference on Software Engineering2026匹配度 2/10 · 该论文虽属于“机器学习与程序语言”大方向、以代码生成为实验场景,但其核心是把 LM 修复建模为神经元定位与修补的优化问题(模型内部编辑),既不属于“静态分析应用于 ML/Agentic 程序”,也不属于“用 LLM/Agent 改进静态分析与形式化验证”,与浮点/贝叶斯程序分析更无交集;且研究目标本身就落在 LLM 内部而非作为工具使用,与画像的关注点基本错位。引用 2 inbox
Jian Gu, Aldeida Aleti, Chunyang Chen, Hongyu Zhang
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:提出 STAR,将 LLM 修复重构为语义驱动的优化过程,定位并修补故障神经元,在代码生成任务上显著超越现有方法。

大语言模型在代码生成中常产生错误代码,相比只修复输出,修复模型本身更彻底,但完整重训练代价高昂。语言模型修复(LM repair)只需少量数据和较小算力,副作用有限,然而先前方法 MINT 与标准优化方法 SGD 各有局限。本文提出 STAR(Semantic Targeting for Analytical Repair),将 LM 修复的关键操作统一到一个优化过程中:定位「故障神经元」、求解「神经元补丁」并完成修补。神经元补丁由基于语义的解析公式计算,通过引导隐表示,直接将 logits 的变化与神经元增量联系起来,从而兼具 MINT 与 SGD 的优点并缓解其不足;该重构还允许一次性解决多个失败,提升实用性。在流行代码 LM 的编码任务上,STAR 优于当前最优方法:在 CoNaLa 上 ExactMatch 提升 10.5%–19.9%,求解每个模型失败平均加速 2.4–7.0 倍,且在泛化性与特异性的平衡上明显更优。作者还评估了修复的过拟合风险与累积影响,并分析了其与流水线式方法的差异及缓解常见局限的原因。

问题
LLM 生成的代码可能出错,而完整重训练代价高;已有的轻量级语言模型修复方法(如 MINT)与标准优化方法(如 SGD)各有局限,亟需更有效、更高效的模型级修复方案。
方法
提出 STAR,将语言模型修复重构为优化过程,统一实现故障神经元定位、神经元补丁求解与修补;补丁通过基于语义的解析公式计算,引导隐表示,直接建立 logits 变化与神经元增量之间的桥梁,从而结合 MINT 与 SGD 的优势并支持同时修复多个失败。
评估
在流行代码语言模型的代码生成任务上进行评估,例如在 CoNaLa 上 ExactMatch 提升 10.5%–19.9%,求解每个模型失败平均加速 2.4–7.0 倍,并在泛化性与特异性的平衡上显著优于先前工作;还评估了过拟合风险、累积影响,并与流水线式方法进行比较分析。
原文摘要(Abstract)

Language Models (LMs) are widely used in software engineering for code generation, but they may produce erroneous code. Rather than repairing outputs, a more thorough remedy is to address underlying model failures. LM repair offers a lightweight solution: it requires minimal data, lowers computational cost, and limits side effects. Unlike full retraining, LM repair focuses on applying tailored updates to targeted neurons, making it suitable for limited resources, high-performance demands, or strict safety requirements. In this paper, we propose Semantic Targeting for Analytical Repair (STAR), a novel semantic-based optimization method for repairing LLMs. STAR realizes the main operations of repairing LMs in an optimization process, including locating “buggy neurons”, solving “neuron patches”, and patching “buggy neurons”. The neuron patches are computed with a solid semantic-based analytical formula, which directly bridges the changes to logits with the deltas of neurons, by steering latent representations. Compared to the prior work of LM repair (MINT) and standard optimization methods (SGD), STAR integrates their strengths while mitigating their limitations. By reformulating LM repair as an optimization process, STAR may solve multiple failures together, significantly improving the usefulness. Evaluated on coding tasks using popular code LMs, STAR demonstrates superior effectiveness compared with the state-of-the-art. For instance, on CoNaLa, STAR obtained 10.5%–19.9% improvements in ExactMatch score. Besides, STAR exhibits better efficiency, achieving an average of 2.4–7.0 times speedup in solving each model failure. In terms of side effects, namely the balance between generalization and specificity, STAR outperforms prior work by a significant margin. Additionally, we conducted assessments on the overfitting risk of LM repair as well as the cumulative impact. Further, we analyzed the differences with pipeline-based methods and explained the reason why STAR is better and how it mitigated the common limitations of LM repair.

链接与引用

DOI 原文 · arXiv · DBLP

BibTeX
@inproceedings{abs-2503-12899,
  title = {A Semantic-based Optimization Approach for Repairing LLMs: Case Study on Code Generation},
  author = {Jian Gu and Aldeida Aleti and Chunyang Chen and Hongyu Zhang},
  booktitle = {ICSE},
  year = {2026},
  doi = {10.1145/3744916.3773262}
}