Code2LoRA: Hypernetwork-Generated Adapters for Code Language Models under Software Evolution
Researchers introduce Code2LoRA, a hypernetwork framework that generates repository-specific LoRA adapters for code language models, eliminating the need for expensive fine-tuning or lengthy context injection. The approach achieves competitive performance with lower computational overhead and introduces RepoPeftBench, a 604-repository benchmark for evaluating code model adaptation techniques.
Code2LoRA addresses a fundamental challenge in code language models: understanding repository-specific context without incurring massive computational costs. Traditional approaches either retrieve large code contexts through RAG pipelines—adding inference-time tokens—or perform expensive per-repository fine-tuning that breaks when codebases evolve. This research proposes a hypernetwork-based solution that dynamically generates lightweight LoRA adapters tailored to individual repositories, achieving zero inference-time overhead.
The framework's dual-track design reflects real-world development scenarios. Code2LoRA-Static targets stable repositories where a single snapshot suffices, while Code2LoRA-Evo maintains an evolving adapter via GRU-backed state updates synchronized with code diffs, addressing active development workflows. This distinction matters because most code intelligence tools fail gracefully as repositories change—developers constantly modify imports, refactor APIs, and establish new conventions.
The performance results validate the approach's efficiency. Code2LoRA-Static matches per-repository LoRA baselines (66.2% in-repo exact match) while eliminating per-repo training, and Code2LoRA-Evo substantially outperforms simpler alternatives on evolving codebases (+5.2 percentage points). The RepoPeftBench benchmark with 604 repositories and 400K+ tasks provides a standardized evaluation framework previously lacking in this research area.
For the AI development community, this work signals that efficient code understanding may not require massive context windows or continuous retraining. The approach has practical implications for IDE integrations, code review automation, and internal development tools at enterprises managing large polyrepo environments. Success here could influence how future code models balance contextual awareness against computational efficiency.
- →Code2LoRA generates repository-specific adapters with zero inference-time overhead, eliminating expensive RAG retrieval or per-repo fine-tuning
- →Code2LoRA-Evo uses GRU-backed state updates to maintain adapter relevance as codebases evolve through commits and diffs
- →The framework matches per-repository fine-tuning performance (66.2% exact match) while remaining computationally efficient
- →RepoPeftBench establishes the first large-scale benchmark for evaluating parameter-efficient code model adaptation across 604 repositories
- →Cross-repository transfer remains challenging (63.8% exact match vs 66.2% in-repo), suggesting repository-specificity is critical for code understanding