aiqbench analysis
This research establishes a theoretical framework for when transformer depth provides a computational advantage over single-layer models in in-context learning tasks. The study demonstrates that multi-layer architectures are specifically superior for handling non-Gaussian, hierarchical data distributions by utilizing internal representations to adaptively route information. These findings clarify the fundamental role of depth and feedforward blocks in enabling complex inference mechanisms within generalized linear attention systems.
When Does Depth Matter For In-Context Learning? Adaptive Inference in Deep Transformers
arXiv:2606.16694v2 Announce Type: replace Abstract: Transformers perform computations through many successive attention and feedforward blocks, allowing them to learn complex correlations between a large collection of coupled variables. When does stacking successive attention-feedforward computations over many layers provide a computational advantage over a single transformer block? We address this question by examining in-context learning in generalized linear attention transformers. We first introduce a general theory of distributed inference in such transformers, subject to constraints on communication and depth. We show that such systems can exploit internal representations (`function vectors') to infer a latent context variable at increasingly finer scales over its layers. For an in-context linear regression task, the theory predicts that while one-layer transformers without feedforward blocks are optimal for Gaussian priors over the context variable, multi-layer transformers are superior for non-Gaussian, tree-like priors. Trained linear attention transformers reproduce quantitative predictions from the theory. Using causal key-patching experiments, we verify that function vectors in intermediate layers mediate adaptive routing of information. Our results suggest that depth and feedforward blocks enable transformers to implement adaptive inference, and this is advantageous when the distribution over latent variables has hierarchical structure.
Title:When Does Depth Matter For In-Context Learning? Adaptive Inference in Deep Transformers
Abstract:Transformers perform computations through many successive attention and feedforward blocks, allowing them to learn complex correlations between a large collection of coupled variables. When does stacking successive attention-feedforward computations over many layers provide a computational advantage over a single transformer block? We address this question by examining in-context learning in generalized linear attention transformers. We first introduce a general theory of distributed inference in such transformers, subject to constraints on communication and depth. We show that such systems can exploit internal representations (`function vectors') to infer a latent context variable at increasingly finer scales over its layers. For an in-context linear regression task, the theory predicts that while one-layer transformers without feedforward blocks are optimal for Gaussian priors over the context variable, multi-layer transformers are superior for non-Gaussian, tree-like priors. Trained linear attention transformers reproduce quantitative predictions from the theory. Using causal key-patching experiments, we verify that function vectors in intermediate layers mediate adaptive routing of information. Our results suggest that depth and feedforward blocks enable transformers to implement adaptive inference, and this is advantageous when the distribution over latent variables has hierarchical structure.
Machine Learning (cs.LG); Artificial Intelligence (cs.AI); Applied Physics (physics.app-ph); Neurons and Cognition (q-bio.NC)
arXiv:2606.16694 [cs.LG]
(or arXiv:2606.16694v2 [cs.LG] for this version)
https://doi.org/10.48550/arXiv.2606.16694 Focus to learn more arXiv-issued DOI via DataCite
arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.
Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.
Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.
Full text under the publisher's open licence · 298 words
Related coverage

Runway’s WorldPrompt and the Engineering of Real-Time Worlds
Latent Space · Sep 25, 2026

Presentation: Adaptive Recommenders in the Real World: Inference, Evals, and System Design
InfoQ · Sep 26, 2026

Adaptive Parallel Reasoning: The Next Paradigm in Efficient Inference Scaling
BAIR Blog · May 8, 2026

Informe de riesgos de la IA de frontera (febrero–marzo de 2026)
METR · May 19, 2026