Linear Layer Repair: Residual-Controlled Layer Profiling for Fault-Tolerant Transformer Inference

Jiya Sheetal Rathi, André Bauer


Abstract
Deciding which transformer layers can be cheaply replaced - when a node fails mid-computation, or when a block is pruned - requires knowing what each layer actually computes. A straightforward approach is to fit a linear map between consecutive hidden states and read off its R2. In our analysis, these fits look excellent, exceeding R2 of 0.97. However this number is largely an artifact of the residual stream: an untrained network scores just as well. The informative quantity is instead how linearly predictable a layer’s update hL+1-hL is. Measured this way, and across six models from three architecture families, layers fall into a clear U-shaped pattern: those at the beginning and end of the stack perform large but almost perfectly linear transformations, while those in the middle perform small nonlinear ones. Given these insights, we present Linear Layer Repair, a policy that reads a layer’s profile and prescribes one of three responses when it goes missing: (i) skip it, (ii) swap in a fitted linear map, or (iii) declare it unrecoverable. Using WikiText-103, we test Linear Layer Repair by removing layers and measuring the damage. The results show that the linear map beats plain skipping at all 16 LLaMA-3.2-1B layers and 26 of 28 in Qwen2-1.5B; replacing a single middle layer costs under half a point of perplexity against a baseline of 15; even four consecutive layers cost only ∼2.5 points; and at an early layer, where skipping raises perplexity above 105, the patch reduces it more than a thousand-fold. Task-level evaluations show corresponding recovery on prediction-sensitive behavior.
Anthology ID:
2026.blackboxnlp-1.31
Volume:
Proceedings of the 9th BlackboxNLP Workshop: Analyzing and Interpreting Neural Networks for NLP
Month:
October
Year:
2026
Address:
Budapest, Hungary
Editors:
Dana Arad, Yonatan Belinkov, Hanjie Chen, Nils Feldhus, Aaron Mueller, Hosein Mohebbi, Gabriele Sarti, Martin Tutek
Venues:
BlackboxNLP | WS
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
514–522
Language:
URL:
https://aclanthology.org/2026.blackboxnlp-1.31/
DOI:
Bibkey:
Cite (ACL):
Jiya Sheetal Rathi and André Bauer. 2026. Linear Layer Repair: Residual-Controlled Layer Profiling for Fault-Tolerant Transformer Inference. In Proceedings of the 9th BlackboxNLP Workshop: Analyzing and Interpreting Neural Networks for NLP, pages 514–522, Budapest, Hungary. Association for Computational Linguistics.
Cite (Informal):
Linear Layer Repair: Residual-Controlled Layer Profiling for Fault-Tolerant Transformer Inference (Rathi & Bauer, BlackboxNLP 2026)
Copy Citation:
PDF:
https://aclanthology.org/2026.blackboxnlp-1.31.pdf