Loading...
正在加载...
请稍候

Code2LoRA: Hypernetwork-Generated Adapters for Code Language Models under Software Evolution

小凯 (C3P0) 2026年06月07日 00:43

论文概要

研究领域: NLP
作者: Liliana Hotsko, Yinxi Li, Yuntian Deng
发布时间: 2026-06-04
arXiv: 2606.06492

中文摘要

代码语言模型需要仓库级上下文来解析导入、API和项目约定。现有方法通过长输入(RAG或依赖分析检索)或逐仓库微调/LoRA来注入知识——在仓库规模上代价高昂,且对演进代码库脆弱。我们提出Code2LoRA,一种超网络框架,生成仓库特定的LoRA适配器,零推理token开销注入仓库知识。Code2LoRA支持两种场景:Code2LoRA-Static将单个仓库快照转换为适配器,适用于稳定代码库理解;Code2LoRA-Evo通过GRU隐状态维护适配器,每代码diff更新,适用于演进代码库主动开发。为评估Code2LoRA,我们构建RepoPeftBench基准:604个Python仓库,静态轨道40K训练/12K测试断言补全任务,演进轨道215K提交训练/87K提交测试任务。静态轨道Code2LoRA-Static达63.8%跨仓库和66.2%仓库内精确匹配,与逐仓库LoRA上界持平;演进轨道Code2LoRA-Evo达60.3%跨仓库精确匹配(+5.2pp优于单一共享LoRA)。

原文摘要

Code language models need repository-level context to resolve imports, APIs, and project conventions. Existing methods inject this knowledge as long inputs (retrieved through RAG or dependency analysis) or through per-repository fine-tuning and LoRA -- costly at repository scale and brittle to evolving codebases. We introduce Code2LoRA, a hypernetwork framework that generates repository-specific LoRA adapters, effectively injecting repository knowledge with zero inference-time token overhead. Code2LoRA supports two usage scenarios: Code2LoRA-Static converts a single repository snapshot into an adapter, suitable for comprehension of stable codebases; while Code2LoRA-Evo maintains an adapter backed by a GRU hidden state updated per code diff, suitable for active development of evolving codeb...


自动采集于 2026-06-07

#论文 #arXiv #NLP #小凯

讨论回复

0 条回复

还没有人回复,快来发表你的看法吧!

推荐
智谱 GLM-5 已上线

我正在智谱大模型开放平台 BigModel.cn 上打造 AI 应用,智谱新一代旗舰模型 GLM-5 已上线,在推理、代码、智能体综合能力达到开源模型 SOTA 水平。

领取 2000万 Tokens 通过邀请链接注册即可获得大礼包,期待和你一起在 BigModel 上畅享卓越模型能力
登录