Remarkable Robustness of LLMs: Stages of Inference?
Vedang Lad, Jin Hwa Lee, Wes Gurnee, Max Tegmark
Abstract
We investigate the robustness of Large Language Models (LLMs) to structural interventions by deleting and swapping adjacent layers during inference. Surprisingly, models retain 72-95% of their original top-1 prediction accuracy without any fine-tuning. We find that performance degradation is not uniform across layers: interventions to the early and final layers cause the most degradation, while the model is remarkably robust to dropping middle layers. This pattern of localized sensitivity motivates our hypothesis of four stages of inference, observed across diverse model families and sizes: (1) detokenization, where local context is integrated to lift raw token embeddings into higher-level representations; (2) feature engineering, where task-and entity-specific features are iteratively refined; (3) prediction ensembling, where hidden states are aggregated into plausible next-token predictions; and (4) residual calibration, where irrelevant features are suppressed to finalize the top-1 output distribution. Synthesizing behavioral and mechanistic evidence, we provide a hypothesis for interpreting depth-dependent computations in LLMs.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext de7bee27-5193-420c-8bcd-25fac86eb1f5Cited by top-tier papers10
- LLM Layers Immediately Correct Each OtherArjun Patrawala, Jiahai Feng, Erik Jones, Jacob SteinhardtNeurIPS 2025 · 5 citations
- Impact of Layer Norm on Memorization and Generalization in TransformersRishi Singhal, Jung-Eun KimNeurIPS 2025 · 4 citations
- NerVE: Nonlinear Eigenspectrum Dynamics in LLM Feed-Forward NetworksNandan Kumar Jha, Brandon ReagenICLR 2026 · 4 citations
- Is One Layer Enough? Understanding Inference Dynamics in Tabular Foundation ModelsAmir Rezaei Balef, Mykhailo Koshil, Katharina EggenspergerICML 2026 · 2 citations
- Bridging the Knowledge-Prediction Gap in LLMs on Multiple-Choice QuestionsYoonah Park, Haesung Pyun, Yohan JoICML 2026 · 1 citation
Builds on26
- Locating and Editing Factual Associations in GPTKevin Meng, David Bau, Alex Andonian, Yonatan BelinkovNeurIPS 2022 · 3,415 citations
- Reducing Transformer Depth on Demand with Structured DropoutAngela Fan, Edouard Grave, Armand JoulinICLR 2020 · 695 citations
- Understanding Robustness of Transformers for Image ClassificationSrinadh Bhojanapalli, Ayan Chakrabarti, Daniel Glasner, Daliang Li et al.ICCV 2021 · 501 citations
- Do Wide and Deep Networks Learn the Same Things? Uncovering How Neural Network Representations Vary with Width and DepthThao Nguyen, Maithra Raghu, Simon KornblithICLR 2021 · 323 citations
- Deja Vu: Contextual Sparsity for Efficient LLMs at Inference TimeZichang Liu, Jue Wang, Tri Dao, Tianyi Zhou et al.ICML 2023 · 318 citations
Related papers
- Transformer Layers as PaintersQi Sun, Marc Pickett, Aakash Kumar Nain, Llion JonesAAAI 2025 · 49 citations
- Understanding the Ability of LLMs to Handle Character-Level PerturbationAnyuan Zhuo, Xuefei Ning, Ningyuan Li, Jingyi Zhu et al.ICML 2026
- Small Transformers Don’t Need LayerNorm at Inference Time: Scaling LayerNorm Removal to GPT-2 XL and Implications for Mechanistic InterpretabilityLuca Baroni, Galvin Khara, Joachim Schaeffer, Marat Subkhankulov et al.ICLR 2026 · 8 citations
- Layer by Layer: Uncovering Hidden Representations in Language ModelsOscar Skean, Md Rifat Arefin, Dan Zhao, Niket Patel et al.ICML 2025
- Model Internal Sleuthing: Finding Lexical Identity and Inflectional Features in Modern Language ModelsMichael Li, Nishant SubramaniACL 2026 · 3 citations
