Probing Transformer Representations Layer by Layer, Module by Module
Ambroise Odonnat, Theo Gnassounou, Laetitia Chapel, Romain Tavenard, Ievgen Redko
Abstract
Which representation should be probed in a transformer-based foundation model? Recent work shows that the standard practice of probing the final layer is often suboptimal, as intermediate layers can provide better features. Yet, representations are still largely studied along depth alone, treating each transformer block as an atomic unit. In this work, we analyze transformer representations layer by layer, module by module. Through more than 144,000 linear probing evaluations of vision foundation models (VFMs) and large language models (LLMs), we show that layer and module choices should be considered jointly: the best layer-module pair yields substantially larger gains over the final-layer residual stream than the best layer with the residual stream fixed. Moreover, module performance can vary substantially across layers, showing that useful representations cannot be characterized by depth alone. Building on these findings, we evaluate simple fixed probing strategies: the final-layer feedforward activation (Act@100) for vision and the second normalization layer at 60% depth (LN2@60) for language. These strategies improve over the probing baseline in a majority of evaluations and recover, on average, 42% and 86% of the gains from probing the best layer-module pair for vision and language, respectively. For VFMs, these gains increase with the transfer difficulty between pretraining and downstream data.
Create a lesson
Metadata
- Categories
- cs.LG, cs.AI
Related papers
Boundary Representation-Driven Graph Transformer Modeling for Machining Operation Sequencing
Shared title terminologycs.LGFatemeh Elhambakhsh, Gaurav Ameta, Aditi Roy et al.
PVFormer: Proper Velocity Transformer for Stable and Scalable Hyperbolic Representation Learning
Shared title terminologycs.LGXianglong Shi, Nicu Sebe, Bernhard Schölkopf et al.
HEART: Hierarchical Expert Adaptive Refinement Transformer for ECG Representation Learning
Shared title terminologycs.LGJunho Song, Jong-Hwan Jang, Joon-Myoung Kwon et al.
Tokenization and Architecture Jointly Allocate Component Roles in Time Series Transformers
Shared title terminologycs.LGMingyu Kim, Doguk Kim
SwiftLoop: Selective Refinement for Adaptive Implicit Reasoning in Looped Transformers
Shared title terminologycs.LGTianyi Zhao, Ke Wan, Chen Chen
Transformers with Signatures: Towards Universal In-Context Learning in Path Space
Shared title terminologycs.LGZiheng Cheng, Xin Guo, Ben Hambly