Code2LoRA: Hypernetwork-Generated Adapters for Code Language Models under Software Evolution
Liliana Hotsko, Yinxi Li, Yuntian Deng, Pengyu Nie
arXiv:2606.06492 · 95▲ · cs.SE, cs.AI, cs.CL
View on arXiv →Premium readers get an interactive explainer for this paper — a figure you can poke at, not just read.
What it is
Code2LoRA is a hypernetwork that reads a code repository (compressed into embeddings by a frozen Qwen3-Embedding model) and generates a repository-specific LoRA adapter for a frozen code LLM in a single forward pass, so repo knowledge lives in parameters instead of the prompt. It has two variants: Static, which maps one repository snapshot to an adapter, and Evo, which uses a GRU to update a hidden state per commit diff so the adapter tracks an evolving codebase.
Why it matters
Instead of paying RAG or dependency-analysis token costs on every query, or training a separate LoRA per repository (about 5 minutes and 32 MB each), you get zero extra inference tokens and adapter generation under 10 ms from a single shared hypernetwork. The Evo variant addresses the practical problem that per-repo adapters go stale as commits pile up, updating cheaply per diff rather than retraining.
Practical takeaway
Watch for repo-conditioned adapter generation as an alternative to stuffing retrieved context into the prompt for code assistants, though the evidence here is limited to Python, one 1.5B backbone (Qwen2.5-Coder-1.5B), and one task (assertion completion). The authors are releasing RepoPeftBench (604 Python repos) and checkpoints if you want to reproduce or extend to other languages.
Key result
On the evolution track cross-repo split, Code2LoRA-Evo hits 60.3% exact match, +5.2 pp over a single shared LoRA (55.1%) and matching/exceeding the per-repo LoRA upper bound on the in-repo split without per-repo training. Caveat: the out-of-distribution holdout gain shrinks to ~1.8 pp EM, and the authors flag that OOD scores are inflated because those repos have shorter assertion targets (median 7 vs 12-13 chars).
Subscribe
Get the next issue.
Free. One email a week. Unsubscribe any time: no account, no dark patterns.