Code models need to know your repository — its imports, APIs, and conventions — to be useful. The usual fixes are clumsy: stuff all that context into a long prompt (RAG, dependency crawls), or fine-tune a LoRA per repo, which is expensive and goes stale the moment the code changes. Code2LoRA, a new arXiv paper, takes a different route: a hypernetwork that generates a repository-specific adapter, baking in repo knowledge with zero added tokens at inference.
## Static and evolving modes
It comes in two flavors. Code2LoRA-Static turns one repo snapshot into an adapter — good for understanding a stable codebase. Code2LoRA-Evo keeps an adapter alive with a GRU hidden state that updates on every code diff, so the model tracks an actively changing project instead of needing a fresh fine-tune each time.
## The benchmark
To measure it, the authors built RepoPeftBench — 604 Python repositories split into a static track and an evolution track built from real commit history. The framing that matters: adapters that evolve with the code, not snapshots that rot the day after you make them.

Leave a comment