跳到正文
arXiv cs.AI· Liliana Hotsko, Yinxi Li, Yuntian Deng, Pengyu Nie·· 14 小时前AI 评分38

Code2LoRA:用超网络生成适配器,为软件演化中的代码语言模型注入仓库知识

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

AI 导读

Code2LoRA 提出超网络框架,为代码语言模型生成仓库专属 LoRA 适配器,实现零推理 token 开销的仓库知识注入。

正文 · 原文

View PDF HTML (experimental)

Abstract: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 codebases. To evaluate Code2LoRA against parameter-efficient fine-tuning baselines, we build RepoPeftBench, a benchmark of 604 Python repositories with two tracks: a static track with 40K training and 12K test assertion-completion tasks, and an evolution track with 215K commit-derived training and 87K commit-derived test tasks. On the static track, Code2LoRA-Static achieves 63.8% cross-repo and 66.2% in-repo exact match, matching the per-repository LoRA upper bound; on the evolution track, Code2LoRA-Evo achieves 60.3% cross-repo exact match (+5.2 pp over a single shared LoRA). Code2LoRA's code can be found at this https URL the model checkpoints and RepoPeftBench datasets can be found at this https URL.
Subjects: Software Engineering (cs.SE); Artificial Intelligence (cs.AI); Computation and Language (cs.CL)
Cite as: arXiv:2606.06492 [cs.SE]
  (or arXiv:2606.06492v2 [cs.SE] for this version)
  https://doi.org/10.48550/arXiv.2606.06492

arXiv-issued DOI via DataCite

Submission history

From: Pengyu Nie [view email]
[v1] Thu, 4 Jun 2026 17:59:46 UTC (521 KB)
[v2] Tue, 27 Oct 2026 18:08:36 UTC (541 KB)

来源:arXiv cs.AI · arxiv.org