Mind the Gaps: From Failure Attribution to Closed-Form Repair of Code Language Models
Not on the map. Why?
Abstract (arXiv)
Code language models must be maintained like the software around them: when a library evolves, a model keeps writing the interface that it saw during training. Repairing the model itself lets one correction reach all downstream uses. Existing repair methods attribute a failure to neurons, select the highest-ranked ones, and apply a generic update. This pipeline assumes that the attributed neurons are the ones to patch and that a generic update fits every failure, and neither assumption has been examined. We examine both on executable API evolution tasks in Python and Rust with three code models and identify two gaps. The targeting gap separates the neurons that failure attribution targets from the neurons that can carry a patch: their top sets have a Jaccard overlap of only 0.15 to 0.20. The tailoring gap separates a generic update from a patch built for the failure: the patches that different carrier neurons need are nearly orthogonal. To address both gaps, we propose ASTRA. It targets neurons by contrastive semantics, an attribution that scores a neuron by its contribution to the logit contrast between the target token and the produced token. It then tailors the patch by solving one small linear system in closed form, which corrects all failing tokens of a sample jointly and needs neither an optimizer nor a backward pass. Contrastive semantics selects significantly better carrier neurons than gradient-based attributions in 3 of 6 settings and comparable ones in the others. On average, ASTRA reaches 66.7 percent Pass@1, against 48.4 percent for the best of AlphaEdit, STAR and low-rank adaptation, and repairs a sample in 2.7 seconds. It is the best method in all 6 settings and for every type of API change, and this advantage persists under an unseen phrasing of the test prompt. Its side effects on unrelated code are small on the large models and larger on the small one.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 49 of its 64 references that are in the map. First posted on arXiv 4 Oct 2026.
Builds on
49 of 64 references.
References · 49
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,297
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2017Axiomatic Attribution for Deep Networkscited by 3,384
- 2022Locating and Editing Factual Associations in GPTcited by 2,691
- 2020Transformer Feed-Forward Layers Are Key-Value Memoriescited by 1,336
- 2022Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 smallcited by 1,165
- 2022Mass-Editing Memory in a Transformercited by 1,001
- 2023Towards Automated Circuit Discovery for Mechanistic Interpretabilitycited by 724
- 2024MiniCPM: Unveiling the Potential of Small Language Models with Scalable Training Strategiescited by 723
- 2023Eliciting Latent Predictions from Transformers with the Tuned Lenscited by 623
- 2021Editing Factual Knowledge in Language Modelscited by 553
- 2022Transformer Feed-Forward Layers Build Predictions by Promoting Concepts in the Vocabulary Spacecited by 532
37 more
- 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 367
- 2023Towards Best Practices of Activation Patching in Language Models: Metrics and Methodscited by 359
- 2024AlphaEdit: Null-Space Constrained Knowledge Editing for Language Modelscited by 236
- 2024Transcoders Find Interpretable LLM Feature Circuitscited by 200
- 2024Beyond Functional Correctness: Exploring Hallucinations in LLM-Generated Codecited by 107
- 2024Model Editing Harms General Abilities of Large Language Models: Regularization to the Rescuecited by 103
- 2022Interpreting Language Models with Contrastive Explanationscited by 92
- 2025AnyEdit: Edit Any Knowledge Encoded in Language Modelscited by 76
- 2021Provable Repair of Deep Neural Networkscited by 42
- 2024Knowledge Graph Enhanced Large Language Model Editingcited by 40
- 2025LongCodeZip: Compress Long Context for Code Language Modelscited by 39
- 2021DeepLocalize: Fault Localization for Deep Neural Networkscited by 38
- 2024LLMs Meet Library Evolution: Evaluating Deprecated API Usage in LLM-based Code Completioncited by 32
- 2019DeepFault: Fault Localization for Deep Neural Networkscited by 30
- 2025The Mirage of Model Editing: Revisiting Evaluation in the Wildcited by 27
- 2021NNrepair: Constraint-based Repair of Neural Network Classifierscited by 26
- 2024CodeUpdateArena: Benchmarking Knowledge Editing on API Updatescited by 19
- 2025Precise Localization of Memories: A Fine-grained Neuron-level Knowledge Editing Technique for LLMscited by 18
- 2024VersiCode: Towards Version-controllable Code Generationcited by 17
- 2025The Hidden Cost of Readability: How Code Formatting Silently Consumes Your LLM Budgetcited by 12
- 2024AI Coders Are Among Us: Rethinking Programming Language Grammar Towards Efficient Code Generationcited by 10
- 2024Model Editing for LLMs4Code: How Far are We?cited by 10
- 2025RustEvo^2: An Evolving Benchmark for API Evolution in LLM-based Rust Code Generationcited by 10
- 2024Vocabulary-Defined Semantics: Latent Space Clustering for Improving In-Context Learningcited by 8
- 2022Patching Weak Convolutional Neural Network Models through Modularization and Compositioncited by 6
- 2023Reusing Deep Neural Network Models through Model Re-engineeringcited by 6
- 2024A Semantic-Aware Layer-Freezing Approach to Computation-Efficient Fine-Tuning of Language Modelscited by 6
- 2023Neuron Patching: Semantic-based Neuron-level Language Model Repair for Code Generationcited by 5
- 2025How Programming Concepts and Neurons Are Shared in Code Language Modelscited by 5
- 2025Neuron-Guided Interpretation of Code LLMs: Where, Why, and How?cited by 5
- 2023Modularizing while Training: A New Paradigm for Modularizing DNN Modelscited by 4
- 2025Token Sugar: Making Source Code Sweeter for LLMs through Token-Efficient Shorthandcited by 4
- 2024DNN Modularization via Activation-Driven Trainingcited by 3
- 2025A Semantic-based Optimization Approach for Repairing LLMs: Case Study on Code Generationcited by 2
- 2026SemRF: A Semantic Reference Frame for Residual-Stream Dynamics in Language Modelscited by 2
- 2025NeMo: A Neuron-Level Modularizing-While-Training Approach for Decomposing DNN Modelscited by 1
- 2025Beyond Neural Incompatibility: Cross-Scale Knowledge Transfer in Language Models through Latent Semantic Alignmentcited by 1
Built on by
Not cited yet.