acceptodds
Published as a conference paper at NeurIPS 2026

Logarithmic Depth Suffices for In-Context Gradient Descent

Yingze Li, Dong Wang, Xianglong Liu, Qingyun Zou, Chunnan Wang, Zhiyu Liang, Hongzhi Wang

Abstract

Transformers can perform in-context learning at depths far smaller than the number of optimizer updates suggested by existing gradient-descent interpretations. Prior work shows that an L-layer Transformer can emulate L gradient-descent updates, but this leaves open whether depth is merely a step counter. We show that it is not: in linear self-attention, each layer compounds the algebraic capacity built by previous layers, yielding a tight Θ(log k) depth characterization for computing the final result of k gradient-descent steps on diagonal quadratic tasks. Controlled experiments validate this mechanism: trained linear-attention models exhibit the predicted logarithmic depth transition, and kernel and oracle comparisons identify polynomial degree as the governing bottleneck. Broader experiments show the same depth signal under standard Transformer components, broader ICL regression families, and early-exit probes on Qwen2.5.

Related papers

See more related submissions when the market opens.