Algorithmic Task Capture, Computational Complexity, and Inductive Bias of Infinite Transformers

Orit Davidovich, Zohar RingelarXiv 2026

TL;DR

While transformers are theoretically capable of expressing almost any function, their inherent inductive bias strictly limits the complexity of the algorithms they can actually learn. By defining "algorithmic capture" based on how efficiently a model scales to larger problem sizes, this paper proves that infinite-width transformers are fundamentally bounded to capturing low-complexity tasks (at most $O(T^3)$ or $O(T^2)$ inference complexity). This provides a mathematical explanation for why transformers excel at simple tasks like sorting but fail at complex graph problems and grammar parsing.

What Problem Does This Paper Address?

A major debate in deep learning is whether Large Language Models (LLMs) genuinely "understand" the algorithmic rules of a task or if they are simply performing sophisticated pattern matching (statistical interpolation).

Part of the issue is that "understanding" is a fuzzy, philosophical term. To make it rigorous, the authors focus on combinatorial tasks where the model must extrapolate to much larger instance sizes (longer sequence lengths, $T$) than it saw during training. In these out-of-distribution (OOD) settings, simple pattern matching fails. The paper addresses a fundamental question: Does the inductive bias of a transformer promote or inhibit the internalization of robust algorithmic logic as problem sizes scale?

Methods

The authors introduce two key theoretical frameworks:

  1. Algorithmic Capture: A formal definition stating that a network has "captured" a task if, after initial training on small instances ($T_0$), it can adapt to arbitrarily large instances ($T > T_0$) using only a logarithmic number of additional samples ($O(\log(T/T_0))$). This allows a small amount of slack for architectural issues like attention dilution without letting the model completely relearn the task.
  2. Efficient Polynomial-Time Heuristic Scheme (EPTHS): A new distributional complexity class that categorizes tasks based on the existence of algorithms that are correct with high probability and run in polynomial time relative to the instance size.

To find the limits of what transformers can learn, the authors analyze infinite-width transformers using Neural Network Gaussian Process (NNGP) and Neural Tangent Kernel (NTK) frameworks across both "lazy" (kernel-like) and "rich" (feature-learning) regimes. By tracking how token-to-token covariance propagates through the network layers, they derive upper bounds on the inference-time computational complexity of tasks these networks can capture.

Datasets

The authors evaluate their framework using six synthetic combinatorial tasks designed to test length generalization:

  • Induction: Finding a specific trigger token and copying the token immediately following it.
  • Sorting Vocabulary: Autoregressively sorting a list of random integers.
  • String Matching: Detecting if a specific 3-token pattern appears in a sequence, using adversarial "near-miss" negative examples.
  • Context-Free Grammar (CFG) Recognition: Determining if a string belongs to a strict Chomsky Normal Form grammar, using adversarial sub-tree substitutions.
  • Shortest Path Problem (SPP): Finding the value of the shortest path between a source and target node in a Random Geometric Graph (RGG).
  • Max Flow / Minimal Cut (MinCut): Finding the minimal cut value in an RGG.

Key Insights and Ideas

  • Universal Expressivity $\neq$ Learnability: Even though an infinitely wide transformer has the capacity to express virtually any function, its inductive bias heavily disfavors complex algorithmic procedures.
  • The Inference Complexity Bottleneck: The paper proves that an infinite-width transformer cannot capture a combinatorial task if the task's heuristic complexity exceeds $O(T^3)$ (or $O(T^2)$ under finite-width convergence assumptions).
  • Feature Learning Doesn't Bypass Complexity Limits: While moving from the lazy regime to the rich regime (feature learning) drastically improves sample efficiency, it does not alter these fundamental inference-time complexity bounds.

Key Results

The empirical results closely mirror the authors' theoretical boundaries:

  • Successful Capture: The simpler tasks—Induction, Sorting, and String Matching—show clear evidence of algorithmic capture. As the context length $T$ scales up to 2.5 orders of magnitude, the relative data cost required to maintain accuracy follows a clean, predictable logarithmic curve.
  • Failure to Capture: Complex tasks like CFG parsing, SPP, and MinCut fail the capture test. Instead of a flat logarithmic curve, their relative adaptation costs accelerate sharply as problem sizes grow, meaning the models fail to generalize the underlying logic.

These contrasting behaviors are clearly illustrated in the paper's empirical scaling plots:

Figure 1: Empirical Combinatorial Task Capture. We train various models on combinatorial task instances of size T0 (1st point on the x-axes) reaching accuracy δ after seeing P0(δ) datapoints. We then fine-tune these models on larger instance sizes (T > T0), re-achieving δ-accuracy after P extra datapoints. Panels (a)-(c) show linear-log plots of relative adaptation cost (P/P0). Panels (a)-(b) show evidence of task capture consistent across seeds. Panel (c) shows task capture on average while individual seeds transition between different slopes. Panels (e)-(f) present results from a study of the combinatorial graph tasks, SPP and MinCut, that exhibit accelerating curves on a linear-linear scale. Solid lines are best fits to C log(T/T0) meant to guide the eye. To mitigate expressivity concerns, depth 40 networks were used for the purple datapoints in Panels (e)-(f). For the Context Free Grammar task on Panel (g), our theoretical bounds prohibit capture at fixed-depth regardless of model capacity. Panels (a,e,f) show average empirical curves with one STD error bars together with best fits to a log. Panels (b,c,g) report individual seeds (thin lines) as well as averages (thick lines).

Limitations and Future Work

A notable limitation is that the derived complexity bounds ($O(T^3)$ or $O(T^2)$) are upper bounds and are somewhat conservative. For example, the Shortest Path Problem (SPP) falls well within the permissible complexity bounds theoretically, yet transformers still fail to capture it empirically. This indicates that the true inductive bias constraints might be even tighter than proven here.

Additionally, this work focuses strictly on standard next-token prediction at a fixed depth. It does not account for the potential computational boosts provided by dynamic depth scaling or explicit scratchpads/Chain-of-Thought (CoT) mechanisms. The authors suggest that extending this framework to architectures utilizing CoT and reinforcement learning with verifiable rewards (RLVR) is a highly promising direction for future research.

Summary updated

BibTeX
@misc{davidovich2026algorithmic,
  author = {Orit Davidovich and Zohar Ringel},
  title = {{Algorithmic Task Capture, Computational Complexity, and Inductive Bias of Infinite Transformers}},
  year = {2026},
  eprint = {2603.11161},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2603.11161},
}
Figure