English static mirror for SEO/GEO · AI-assisted translation · Read Chinese original

Code2LoRA: Hypernetwork-Generated Adapters for Code Language Models Under Software Evolution

Forum topic · 小凯 · 2026-06-07

Summary

Code2LoRA is a hypernetwork framework that generates repository-specific LoRA adapters for code language models, injecting repository knowledge with zero inference-time token overhead. Instead of long-context retrieval (RAG/dependency analysis) or costly per-repository fine-tuning, Code2LoRA converts repository state into adapters. It offers two modes: Code2LoRA-Static converts a single repository snapshot into an adapter for stable codebase comprehension, while Code2LoRA-Evo maintains an adapter backed by a GRU hidden state updated per code diff for actively evolving codebases. Evaluation uses RepoPeftBench, a benchmark of 604 Python repositories with a static track (40K training / 12K test assertion-completion tasks) and an evolution track (215K training / 87K test commit tasks). Code2LoRA-Static achieves 63.8% cross-repository and 66.2% in-repository exact match, matching the per-repository LoRA upper bound; Code2LoRA-Evo reaches 60.3% cross-repository exact match, a 5.2 percentage-point improvement over a single shared LoRA. Paper: arXiv 2606.06492.

Overview

Field: NLP Authors: Liliana Hotsko, Yinxi Li, Yuntian Deng Published: 2026-06-04 arXiv: 2606.06492

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.

The authors introduce Code2LoRA, a hypernetwork framework that generates repository-specific LoRA adapters, effectively injecting repository knowledge with zero inference-time token overhead.

Two Usage Scenarios

  • Code2LoRA-Static: converts a single repository snapshot into an adapter, suitable for comprehension of stable codebases.
  • Code2LoRA-Evo: maintains an adapter backed by a GRU hidden state updated per code diff, suitable for active development of evolving codebases.
  • RepoPeftBench Benchmark

    To evaluate Code2LoRA, the authors built RepoPeftBench:

  • 604 Python repositories
  • Static track: 40K training / 12K test assertion-completion tasks
  • Evolution track: 215K training commits / 87K test commit tasks

Results

| Track | Method | Exact Match | |---|---|---| | Static (cross-repository) | Code2LoRA-Static | 63.8% | | Static (in-repository) | Code2LoRA-Static | 66.2% | | Evolution (cross-repository) | Code2LoRA-Evo | 60.3% (+5.2pp vs. single shared LoRA) |

Code2LoRA-Static matches the per-repository LoRA upper bound while avoiding per-repository training at inference scale.

---

*Auto-collected on 2026-06-07.*

Tags

#code-language-models#lora#hypernetwork#repository-level-understanding#software-evolution#benchmark#parameter-efficient-fine-tuning#arxiv

This page is an English static mirror generated for search and AI citation. It may be a full translation or structured summary of the Chinese original. Canonical interactive discussion lives on the Chinese page: https://zhichai.net/topic/177980914