Code2LoRA generated repository-specific adapters with a hypernetwork, giving code models repo context at zero inference token cost
AspireAI community · arXiv
Code language models need repository-level context to resolve imports, APIs and project conventions. The usual options - long retrieved inputs, or per-repository fine-tuning and LoRA - are costly at repository scale and brittle as codebases change.
Code2LoRA uses a hypernetwork to generate repository-specific LoRA adapters, injecting repository knowledge with zero inference-time token overhead. Code2LoRA-Static converts one repository snapshot into an adapter for stable codebases; Code2LoRA-Evo maintains an adapter backed by a GRU hidden state updated per code diff, for actively developed ones.
The evaluation uses RepoPeftBench, a new benchmark of 604 Python repositories with a static track (40K training, 12K test assertion-completion tasks) and an evolution track (215K commit-derived training, 87K commit-derived test tasks). On the static track, Code2LoRA-Static reaches 63.8% cross-repo and 66.2% in-repo exact match, matching the per-repository LoRA upper bound. On the evolution track, Code2LoRA-Evo reaches 60.3% cross-repo exact match, 5.2 points over a single shared LoRA.
The honest limitation is that Code2LoRA-Static still needs a per-repository training pass, and the benchmark covers Python repositories only.
Read the story and explore more from the AspireAI community.
Two sparse-autoencoder analyses have resisted scaling: matching semantically similar features across layers, and compressing large feature circuits into interpretable supernodes. This paper argues both are the same underlying problem, estimating semantic distances between SAE features that sit on different activation manifolds. Its representation treats each feature not as a single decoder vector but as an activation-weighted distribution over the hidden states expressing it, projects those distributions into a shared reference space, and compares them with Wasserstein distance. The representation is proved invariant to activation rescaling and stable under perturbation, and recovers true matches under finite-sample margin conditions. Empirically it outperformed decoder-vector and LLM-based baselines and captured subtle functional distinctions between related features, and it compressed large feature circuits into interpretable supernodes automatically. The limitation is that this is interpretability tooling: the paper demonstrates better feature matching and circuit compression, not that downstream interpretability claims become more accurate.