[Paper Review] Jump to Conclusions: Short-Cutting Transformers With Linear Transformations
This paper learns layer-to-layer linear mappings to cast hidden transformer representations, enabling better approximations of final-layer outputs and improving efficiency in early exiting and sub-module linear approximations.
Transformer-based language models create hidden representations of their inputs at every layer, but only use final-layer representations for prediction. This obscures the internal decision-making process of the model and the utility of its intermediate representations. One way to elucidate this is to cast the hidden representations as final representations, bypassing the transformer computation in-between. In this work, we suggest a simple method for such casting, using linear transformations. This approximation far exceeds the prevailing practice of inspecting hidden representations from all layers, in the space of the final layer. Moreover, in the context of language modeling, our method produces more accurate predictions from hidden layers, across various model scales, architectures, and data distributions. This allows "peeking" into intermediate representations, showing that GPT-2 and BERT often predict the final output already in early layers. We then demonstrate the practicality of our method to recent early exit strategies, showing that when aiming, for example, at retention of 95% accuracy, our approach saves additional 7.9% layers for GPT-2 and 5.4% layers for BERT. Last, we extend our method to linearly approximate sub-modules, finding that attention is most tolerant to this change. Our code and learned mappings are publicly available at https://github.com/sashayd/mat.
Motivation & Objective
- Motivate interpretability and efficiency gains from using intermediate transformer representations rather than only final-layer representations.
- Propose a lightweight linear mapping (mat) to transform hidden states from any earlier layer to a later layer.
- Evaluate how well mat approximates final-layer representations and predictions across GPT-2 and BERT on multiple data sources.
- Demonstrate practical benefits for early exiting and for approximating sub-modules like attention, FFN, and layer norms.
Proposed method
- For any layer pair ell < ell', learn a d_h x d_h matrix A_{ell',ell} by minimizing the regression loss over hidden-state pairs collected from running sequences through the model.
- Compare mat_{ell→ell'} with the baseline id mapping that simply propagates representations unchanged.
- Measure approximation quality using coordinate-wise R^2 between mat(h^{ell}) and the true h^{ell'}.
- Apply the learned mappings to next-token and masked-token prediction tasks to assess predictive alignment via Precision@k and surprisal.
- Extend the linear shortcut to replace sub-modules (attention, FFN, layer norm) with linear approximations and evaluate impact on predictive accuracy.
- Demonstrate the utility of mat for early exiting by replacing the identity mapping with mat in dynamic exit decisions and compare compute savings.

Experimental results
Research questions
- RQ1Can a simple linear mapping between transformer layers provide a more accurate substitute for final-layer representations than the common identity propagation?
- RQ2How well do such mappings preserve the model's predicted token distributions in next-token and masked-token tasks?
- RQ3Do linear shortcuts enable meaningful efficiency gains in early exiting and in replacing sub-modules like attention, FFN, or layer norms?
Key findings
- Mat consistently yields higher R^2 scores than the identity baseline across GPT-2 and BERT, especially for BERT where identity often fails to map across layers.
- In language modeling tasks, mat improves Prediction@k and lowers Surprisal relative to id, with notable gains in early layers (e.g., substantial accuracy improvements up to layer 44 in GPT-2).
- Using mat for early exiting saves additional layers beyond prior approaches, e.g., 7.9% more GPT-2 layers and 5.4% more BERT layers saved to reach 95% accuracy.
- The approach reveals that early representations often already encode the final prediction to a meaningful extent, with nontrivial predictive alignment observed in early layers (0.28–0.45 for top-1 Precision, etc.).
- Linearly approximating sub-modules shows attention is the most tolerant to linear replacement, while FFN and layer norm are more sensitive, yet can also be linearly approximated in many cases.
- Replacing sub-modules with linear shortcuts can be done without catastrophic loss in some layers, suggesting potential parallelizable compute benefits.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.