Overview
Field: NLP Authors: Liliana Hotsko, Yinxi Li, Yuntian Deng Published: 2026-06-04 arXiv: 2606.06492
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.
The authors introduce Code2LoRA, a hypernetwork framework that generates repository-specific LoRA adapters, effectively injecting repository knowledge with zero inference-time token overhead.
Two Usage Scenarios
- Code2LoRA-Static: converts a single repository snapshot into an adapter, suitable for comprehension of stable codebases.
- Code2LoRA-Evo: maintains an adapter backed by a GRU hidden state updated per code diff, suitable for active development of evolving codebases.
- 604 Python repositories
- Static track: 40K training / 12K test assertion-completion tasks
- Evolution track: 215K training commits / 87K test commit tasks
RepoPeftBench Benchmark
To evaluate Code2LoRA, the authors built RepoPeftBench:
Results
| Track | Method | Exact Match | |---|---|---| | Static (cross-repository) | Code2LoRA-Static | 63.8% | | Static (in-repository) | Code2LoRA-Static | 66.2% | | Evolution (cross-repository) | Code2LoRA-Evo | 60.3% (+5.2pp vs. single shared LoRA) |
Code2LoRA-Static matches the per-repository LoRA upper bound while avoiding per-repository training at inference scale.
---
*Auto-collected on 2026-06-07.*