Code2LoRA: Hypernetwork-Generated Adapters for Code Language Models under Software Evolution
AuthorsLiliana Hotsko, Yinxi Li, Yuntian Deng, Pengyu Nie
Resources
Code2LoRA turns code repositories into lightweight, updateable adapters so code models can learn project-specific context without stuffing the prompt or retraining for every repo.
Key results
Python repositories used to construct the benchmark
Assertion-completion training tasks on the static track
Commit-derived training tasks for Code2LoRA-Evo
Code2LoRA-Static on cross-repo static-track test
Code2LoRA-Evo on cross-repo evolution-track test
Code2LoRA-Evo on the 92-repository temporal holdout
What the paper found
Code2LoRA, from the University of Waterloo, reframes repository-level code adaptation as hypernetwork-generated LoRA rather than retrieval or per-repository fine-tuning, using a frozen Qwen2.5-Coder-1.5B backbone and a frozen Qwen3-Embedding-0.6B repository encoder to emit adapters with zero inference-time token overhead. The paper introduces two modes: Code2LoRA-Static maps one repository snapshot to adapters for stable codebases, while Code2LoRA-Evo adds a GRU over sequential code diffs to refresh the adapter as software evolves. To evaluate this idea, the authors build RepoPeftBench, a benchmark of 604 Python repositories with 39,612 static training tasks, 215,129 evolution-track training tasks, and a 92-repository temporal holdout. On the static track, Code2LoRA-Static reaches 63.8% cross-repo exact match and 66.2% in-repo exact match, beating the strongest baseline by 9.9 percentage points and matching the per-repository LoRA upper bound. On the evolution track, Code2LoRA-Evo reaches 60.3% cross-repo exact match and 64.5% in-repo exact match, improving by 5.2 points over a single shared LoRA and outperforming static snapshot adaptation under commit-level drift. The paper also reports that Code2LoRA-Evo remains strongest on the 92-repository out-of-distribution holdout at 74.1% exact match, while preserving the key deployment advantage of no extra inference tokens.
Original 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 https://anonymous.4open.science/r/code2lora-6857; the model checkpoints and RepoPeftBench datasets can be found at https://huggingface.co/code2lora.
Read the original paperMore in Code Generation
Browse all 43 papers →Compact Documentation for Coding Agents: A Benchmark, an Optimizer, and Why It Does Not Transfer
Md Shohel Arman, Igor Molybog
Better code documentation can faithfully reconstruct software, but surprisingly does not necessarily help AI coding agents fix real issues when the source code is already available.
Groupwise Agentic Grading and Advantage Redistribution for Code Agent RL
Jinhao Dong, Liang Zhao, Zihao Yue, Wenhan Ma, Linghao Zhang, Lei Li, Shicheng Li, Yifan Song, Bowen Ye, Fuli Luo
GAGAR helps code agents learn not only to pass tests, but to produce cleaner and more targeted implementations by redistributing RL credit according to agentic quality judgments.
Reinforcement Learning from Intermediate Renders for Image-to-Code Generation
Omri Kaduri, Kate Feingold, Phillip Isola, Tali Dekel
IR4RL improves image-to-code generation by rewarding models for making useful visual progress at every intermediate rendering step.