Paper Overview
Research Area: NLP Authors: Liliana Hotsko, Yinxi Li, Yuntian Deng Published: 2025-06-11 arXiv: 2506.08296
Abstract (Chinese summary, translated)
Code language models need repository-level context to resolve imports, APIs, and project conventions. Existing methods inject this knowledge as long inputs (retrieved via RAG or dependency analysis) or through per-repository fine-tuning/LoRA—costly at repository scale and fragile for evolving codebases. The authors introduce Code2LoRA, a hypernetwork framework that generates repository-specific LoRA adapters, effectively injecting repository knowledge with zero inference-time token overhead. Code2LoRA supports two scenarios: a static version that converts a single repository snapshot into an adapter, and an evolution version that maintains the adapter via a GRU hidden state updated with each code diff.
Original Abstract
Code language models need repository-level context to resolve imports, APIs, and project conventions. 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 scenarios: static conversion for stable codebases, and evolution tracking via GRU hidden state for active development.
Key Points
- Problem: Repository context (imports, APIs, conventions) is hard to provide efficiently—long-input retrieval inflates tokens, while per-repo LoRA is expensive and brittle under code changes.
- Approach: A hypernetwork generates LoRA adapters directly from repository content, adding no inference-time token overhead.
- Static mode: One-shot conversion of a repository snapshot into an adapter, suited to stable codebases.
- Evolution mode: A GRU hidden state is updated with each code diff, keeping the adapter aligned with active development.
- Paper: https://arxiv.org/abs/2506.08296