Repository context is the bottleneck for code LLMs: every completion needs to<br>know the project's imports, APIs, and conventions, and today we pay for that<br>context at every single query - through RAG, dependency analysis, or<br>ever-longer prompts - or we fine-tune a LoRA per repo and watch it go stale on<br>the next commit.</p>\n<p>We ask a simple question: what if the repository <em>itself</em> were the prompt, but<br>only once? <strong>Code2LoRA</strong> is a hypernetwork that reads a repo (or its stream of<br>commits) and emits a LoRA adapter for a frozen code LLM in a single forward<br>pass. The repo's knowledge lives in the weights, and inference adds zero extra<br>tokens.</p>\n<p>It comes in two flavors. </p>\n<ul>\n<li><p><strong>Code2LoRA-Static</strong> snapshots a repo into an adapter<br>and, with no per-repo training, already matches the per-repository LoRA upper<br>bound on in-repo eval and beats RAG / dependency-resolved-context / FFT+RAG<br>cross-repo (+9.9pp EM). </p>\n</li>\n<li><p><strong>Code2LoRA-Evo</strong> is the part we're most excited about:<br>a GRU walks the commit history and refreshes the adapter in O(1) per commit, so<br>the model keeps up with active development instead of fighting it. On a<br>strictly post-cutoff 92-repo OOD holdout — repos the encoder has never seen —<br>Code2LoRA-Evo lifts a Qwen2.5-Coder backbone from 44.6% to 74.1% EM.</p>\n</li>\n</ul>\n<p>To make all of this measurable we also release <strong>RepoPeftBench</strong>: 604 Python<br>repos, 62K static and 400K commit-derived assertion-completion tasks, with<br>in-repo, cross-repo, and temporal-OOD splits. We hope it's useful as a<br>benchmark for repo-conditioned and evolution-aware code modeling beyond our own<br>setup.</p>\n<p>Code: <a href=\"https://anonymous.4open.science/r/code2lora-6857\" rel=\"nofollow\">https://anonymous.4open.science/r/code2lora-6857</a> · Data & models:<br><a href=\"https://huggingface.co/code2lora\">https://huggingface.co/code2lora</a></p>\n","updatedAt":"2026-06-05T15:27:17.697Z","author":{"_id":"65ec51c5d767680a0c2b1402","avatarUrl":"/avatars/630bd4a44bc32dacf9a70e06fc2458de.svg","fullname":"Liliana","name":"lilianahotsko","type":"user","isPro":false,"isHf":false,"isHfAdmin":false,"isMod":false,"followerCount":1,"isUserFollowing":false}},"numEdits":0,"identifiedLanguage":{"language":"en","probability":0.8814395070075989},"editors":["lilianahotsko"],"editorAvatarUrls":["/avatars/630bd4a44bc32dacf9a70e06fc2458de.svg"],"reactions":[{"reaction":"🚀","users":["olehch"],"count":1}],"isReport":false}},{"id":"6a2337d0668e42aa8902c27a","author":{"_id":"65243980050781c16f234f1f","avatarUrl":"/avatars/743a009681d5d554c27e04300db9f267.svg","fullname":"Avi","name":"avahal","type":"user","isPro":false,"isHf":false,"isHfAdmin":false,"isMod":false,"followerCount":6,"isUserFollowing":false},"createdAt":"2026-06-05T20:55:44.000Z","type":"comment","data":{"edited":false,"hidden":false,"latest":{"raw":"the evo mode, where a GRU ingests commit diffs to refresh the repository adapter, is the slick part here. i’m curious how it handles noisy diffs from big refactors that change api shapes or symbol exports, since the diff alone may not encode the semantic shifts the model needs. in those cases, would the hypernetwork's updates drift the adapter away from the stable repo knowledge over time? btw, arxivlens has a nice breakdown that helped parse the method details: https://arxivlens.com/PaperView/Details/code2lora-hypernetwork-generated-adapters-for-code-language-models-under-software-evolution-6378-8db5ccb2","html":"<p>the evo mode, where a GRU ingests commit diffs to refresh the repository adapter, is the slick part here. i’m curious how it handles noisy diffs from big refactors that change api shapes or symbol exports, since the diff alone may not encode the semantic shifts the model needs. in those cases, would the hypernetwork's updates drift the adapter away from the stable repo knowledge over time? btw, arxivlens has a nice breakdown that helped parse the method details: <a href=\"https://arxivlens.com/PaperView/Details/code2lora-hypernetwork-generated-adapters-for-code-language-models-under-software-evolution-6378-8db5ccb2\" rel=\"nofollow\">https://arxivlens.com/PaperView/Details/code2lora-hypernetwork-generated-adapters-for-code-language-models-under-software-evolution-6378-8db5ccb2</a></p>\n","updatedAt":"2026-06-05T20:55:44.875Z","author":{"_id":"65243980050781c16f234f1f","avatarUrl":"/avatars/743a009681d5d554c27e04300db9f267.svg","fullname":"Avi","name":"avahal","type":"user","isPro":false,"isHf":false,"isHfAdmin":false,"isMod":false,"followerCount":6,"isUserFollowing":false}},"numEdits":0,"identifiedLanguage":{"language":"en","probability":0.8774799704551697},"editors":["avahal"],"editorAvatarUrls":["/avatars/743a009681d5d554c27e04300db9f267.svg"],"reactions":[],"isReport":false}}],"primaryEmailConfirmed":false,"paper":{"id":"2606.06492","authors":[{"_id":"6a22c95276dea4a01ef147ff","user":{"_id":"65ec51c5d767680a0c2b1402","avatarUrl":"/avatars/630bd4a44bc32dacf9a70e06fc2458de.svg","isPro":false,"fullname":"Liliana","user":"lilianahotsko","type":"user","name":"lilianahotsko"},"name":"Liliana Hotsko","status":"claimed_verified","statusLastChangedAt":"2026-06-05T15:05:44.999Z","hidden":false},{"_id":"6a22c95276dea4a01ef14800","name":"Yinxi Li","hidden":false},{"_id":"6a22c95276dea4a01ef14801","name":"Yuntian Deng","hidden":false},{"_id":"6a22c95276dea4a01ef14802","name":"Pengyu Nie","hidden":false}],"mediaUrls":["https://cdn-uploads.huggingface.co/production/uploads/65ec51c5d767680a0c2b1402/CrN0UM9aVZfGK41LKHE10.qt"],"publishedAt":"2026-06-04T00:00:00.000Z","submittedOnDailyAt":"2026-06-05T00:00:00.000Z","title":"Code2LoRA: Hypernetwork-Generated Adapters for Code Language Models under Software Evolution","submittedOnDailyBy":{"_id":"65ec51c5d767680a0c2b1402","avatarUrl":"/avatars/630bd4a44bc32dacf9a70e06fc2458de.svg","isPro":false,"fullname":"Liliana","user":"lilianahotsko","type":"user","name":"lilianahotsko"},"summary":"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.","upvotes":46,"discussionId":"6a22c95376dea4a01ef14803","ai_summary":"Code2LoRA is a hypernetwork framework that generates repository-specific LoRA adapters for code language models, supporting both static and evolving codebases with efficient parameter-efficient fine-tuning.","ai_keywords":["Code2LoRA","hypernetwork framework","LoRA adapters","repository-level context","parameter-efficient fine-tuning","GRU hidden state","code diffs","RepoPeftBench","assertion-completion tasks","cross-repo exact match","in-repo exact match"],"ai_summary_model":"Qwen/Qwen2.5-Coder-32B-Instruct","organization":{"_id":"6230c3ced93e84e2338765f3","name":"UWaterloo","fullname":"University of Waterloo","avatar":"https://cdn-avatars.huggingface.co/v1/production/uploads/1647363004040-6230c34bacb94a81eec91ed5.png"}},"canReadDatabase":false,"canManagePapers":false,"canSubmit":false,"hasHfLevelAccess":false,"upvoted":false,"upvoters":[{"_id":"6643bdd9bc86c9465b551357","avatarUrl":"/avatars/98f04dc2263e79f170e662a9ed113fc5.svg","isPro":false,"fullname":"Pengyu Nie","user":"pengyunie","type":"user"},{"_id":"6a22ec99e5e6e96da5cb54c4","avatarUrl":"/avatars/dab7c7b3b9a01bee73998cef1776d871.svg","isPro":false,"fullname":"Tamila Zihura","user":"tzihura","type":"user"},{"_id":"6a22ecc3f4af4e6854f8f3ba","avatarUrl":"/avatars/4046102c54523fc91a1589ad40ef78af.svg","isPro":false,"fullname":"Svitlana Hovorova","user":"CyberMavka","type":"user"},{"_id":"63081e15a670ed10f9d44229","avatarUrl":"https://cdn-avatars.huggingface.co/v1/production/uploads/63081e15a670ed10f9d44229/w1b9uq-9774bMMgJbSPsS.jpeg","isPro":true,"fullname":"Yuntian Deng","user":"yuntian-deng","type":"user"},{"_id":"646fb2d19ba7aeaacb25e61b","avatarUrl":"https://cdn-avatars.huggingface.co/v1/production/uploads/no-auth/lu79rOcU7tGdECU-Scw6B.png","isPro":true,"fullname":"Austing Dong","user":"AustingDong","type":"user"},{"_id":"6039478ab3ecf716b1a5fd4d","avatarUrl":"https://cdn-avatars.huggingface.co/v1/production/uploads/6039478ab3ecf716b1a5fd4d/_Thy4E7taiSYBLKxEKJbT.jpeg","isPro":true,"fullname":"taesiri","user":"taesiri","type":"user"},{"_id":"62e1403f926f4892a4c545f8","avatarUrl":"/avatars/1f9d09bba8dd2d8657619536078f9ec2.svg","isPro":false,"fullname":"Basit mustafa","user":"BasitMustafa","type":"user"},{"_id":"6a2310dc8536ff11113916d0","avatarUrl":"/avatars/bc0a7f33ca3578b170d71fa707079159.svg","isPro":false,"fullname":"Olena Plysyuk","user":"oplysyuk","type":"user"},{"_id":"646a7b921556443f24b7a73f","avatarUrl":"/avatars/3b7a9603ee09c988dca8e94b92a173a5.svg","isPro":false,"fullname":"Narushynska","user":"narushynska","type":"user"},{"_id":"630b256e4c0945d20b8228fd","avatarUrl":"/avatars/83c3ee7fa7bf0b8a0b33f64f4a1f958a.svg","isPro":false,"fullname":"Patryk Paryska","user":"paryska99","type":"user"},{"_id":"6a13870ef170b47ea7ffc212","avatarUrl":"/avatars/cc9f8687fe83d44aa2605a9551e81906.svg","isPro":false,"fullname":"code2lora","user":"code2lora","type":"user"},{"_id":"6a2324e09dec40338cf13b10","avatarUrl":"/avatars/920cfe951b0a7711ade12d9bc43dc9b2.svg","isPro":false,"fullname":"N Gock","user":"lhucu","type":"user"}],"acceptLanguages":["en"],"dailyPaperRank":1,"organization":{"_id":"6230c3ced93e84e2338765f3","name":"UWaterloo","fullname":"University of Waterloo","avatar":"https://cdn-avatars.huggingface.co/v1/production/uploads/1647363004040-6230c34bacb94a81eec91ed5.png"},"markdownContentUrl":"https://huggingface.co/buckets/huggingchat/papers-content/resolve/2606/2606.06492.md"}">
Code2LoRA: Hypernetwork-Generated Adapters for Code Language Models under Software Evolution
Abstract
Code2LoRA is a hypernetwork framework that generates repository-specific LoRA adapters for code language models, supporting both static and evolving codebases with efficient parameter-efficient fine-tuning.
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.
Community
Repository context is the bottleneck for code LLMs: every completion needs to
know the project's imports, APIs, and conventions, and today we pay for that
context at every single query - through RAG, dependency analysis, or
ever-longer prompts - or we fine-tune a LoRA per repo and watch it go stale on
the next commit.
We ask a simple question: what if the repository itself were the prompt, but
only once? Code2LoRA is a hypernetwork that reads a repo (or its stream of
commits) and emits a LoRA adapter for a frozen code LLM in a single forward
pass. The repo's knowledge lives in the weights, and inference adds zero extra
tokens.
It comes in two flavors.
Code2LoRA-Static snapshots a repo into an adapter
and, with no per-repo training, already matches the per-repository LoRA upper
bound on in-repo eval and beats RAG / dependency-resolved-context / FFT+RAG
cross-repo (+9.9pp EM).
Code2LoRA-Evo is the part we're most excited about:
a GRU walks the commit history and refreshes the adapter in O(1) per commit, so
the model keeps up with active development instead of fighting it. On a
strictly post-cutoff 92-repo OOD holdout — repos the encoder has never seen —
Code2LoRA-Evo lifts a Qwen2.5-Coder backbone from 44.6% to 74.1% EM.
To make all of this measurable we also release RepoPeftBench: 604 Python
repos, 62K static and 400K commit-derived assertion-completion tasks, with
in-repo, cross-repo, and temporal-OOD splits. We hope it's useful as a
benchmark for repo-conditioned and evolution-aware code modeling beyond our own
setup.
Code: https://anonymous.4open.science/r/code2lora-6857 · Data & models:
https://huggingface.co/code2lora
Upload images, audio, and videos by dragging in the text input, pasting, or clicking here.
Tap or paste here to upload images
Cite arxiv.org/abs/2606.06492 in a model README.md to link it from this page.
Cite arxiv.org/abs/2606.06492 in a dataset README.md to link it from this page.
Cite arxiv.org/abs/2606.06492 in a Space README.md to link it from this page.
Discussion (0)
Sign in to join the discussion. Free account, 30 seconds — email code or GitHub.
Sign in →No comments yet. Sign in and be the first to say something.