potentialpaper

Universal and Efficient Computation with 2D Attention

Christos Tzamos, Guoqing Zheng, Athul Paul Jacob

NeurIPS 2026

Edit this page

Or clone it with git

Run in a terminal:

Needs Git LFS. To push, use an API key from your profile as the password.

Or let your agent set it up

It checks and sets up everything: signing in, git, the clone, credentials and an SSH key.

TL;DR. Transformers can be made into efficient long-memory computers using only 2D attention.

Abstract. Transformers are powerful models but are inefficient with large context due to the quadratic complexity of the attention mechanism. Limiting their context window addresses the efficiency concern but at a cost: they cannot remember everything from the past, which severely limits their computational power. We show that we can simultaneously achieve efficiency and universal computation if we restrict attention heads to be 2-dimensional. First, we give the first algorithm for standard 2D attention that serves every insertion and every query in amortized polylogarithmic time per token. Prior work either restricted key/query magnitudes or paid polynomial overhead per step. Second, we show that the class of 2D-attention models is universal and efficient: a vanilla 2D transformer efficiently simulates an arbitrary RAM machine via chain-of-thought decoding so that, combined with our first result, TT steps of a word-RAM machine can be simulated in O~(T)\widetilde O(T) time. In contrast, earlier universality results focused on computability rather than per-step efficient simulation. Third, as an application, we turn a transformer into a computer. We provide a compiler that supports the full i32\texttt{i32} WebAssembly subset with integer computations (reachable from C via clang\texttt{clang}) and turns such programs into the weights of a transformer, which then executes them over millions of steps autoregressively. We illustrate how this can be used to solve combinatorial problems, tasks at which even large reasoning LLMs struggle.

Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.

Claim this paper
How does this paper connect to your work? Write how you built on it, compared with it or reproduced it, or add a summary, a critique or errata.
Or make it interactive:
Start writing

edit · history

DateVersionSubmitted toPDFEvidence
4 May 2026NeurIPS 2026submittedNeurIPS 2026Accept (poster)reviews ↓[1]PDF[1]
Missing a version?

NeurIPS 2026

Accept (poster) · 4 reviews · OpenReview

Updated 25 Nov 2026, 03:42 UTC.

Program Chairs · DecisionOpenReview ↗
Decision
Accept (poster)
Read decision
Meta-review

Initial Metareview

The paper's goal of better understanding the computational capabilities of Transformers through low-dimensional attention mechanisms is well appreciated. The study of efficient simulation algorithms and universality results for Transformers is an interesting and worthwhile research direction. However, the current reviews identify several significant concerns that presently make the paper borderline.

The primary reservation is that the practical relevance of the proposed 2D attention model is not sufficiently established. While studying the expressibility of Transformer variants is an important direction, it is unclear how the proposed model relates to practically trained Transformers or whether it can serve as a meaningful abstraction of existing architectures. In addition, there are concerns about the theoretical analysis of the approximation, particularly how approximation errors in the attention mechanism propagate across multiple Transformer layers and affect the overall guarantees.

If the authors believe that these and other concerns are based on factual misunderstandings or incorrect interpretations, they are encouraged to clarify them during the discussion phase. In particular, a convincing justification of the relevance of the 2D attention model, together with a clearer treatment of the approximation guarantees, could substantially strengthen the paper and improve its case.

Metareview after Rebuttal

The paper studies an interesting and important direction in understanding the computational capabilities of Transformers through low-dimensional attention mechanisms. The reviewers appreciate the technical contributions, including the efficient simulation results and the computational abstractions developed for 2D Transformers.

The rebuttal addressed several of the initial concerns and led to a more positive assessment of the paper, including an increase in reviewer scores. Some questions remain regarding the practical relevance of the 2D attention model and the approximation guarantees, but these are now viewed more as limitations and directions for future work than as issues that preclude publication.

Overall, the paper is viewed positively after the discussion, and the consensus is to accept the paper.

Final justification

The rebuttal addressed several of the initial concerns and led to a more positive assessment of the paper, including an increase in reviewer scores and the consensus is to accept the paper..

Area Chair s83S · Meta-reviewOpenReview ↗
Read meta-review
Meta-review

Initial Metareview

The paper's goal of better understanding the computational capabilities of Transformers through low-dimensional attention mechanisms is well appreciated. The study of efficient simulation algorithms and universality results for Transformers is an interesting and worthwhile research direction. However, the current reviews identify several significant concerns that presently make the paper borderline.

The primary reservation is that the practical relevance of the proposed 2D attention model is not sufficiently established. While studying the expressibility of Transformer variants is an important direction, it is unclear how the proposed model relates to practically trained Transformers or whether it can serve as a meaningful abstraction of existing architectures. In addition, there are concerns about the theoretical analysis of the approximation, particularly how approximation errors in the attention mechanism propagate across multiple Transformer layers and affect the overall guarantees.

If the authors believe that these and other concerns are based on factual misunderstandings or incorrect interpretations, they are encouraged to clarify them during the discussion phase. In particular, a convincing justification of the relevance of the 2D attention model, together with a clearer treatment of the approximation guarantees, could substantially strengthen the paper and improve its case.

Metareview after Rebuttal

The paper studies an interesting and important direction in understanding the computational capabilities of Transformers through low-dimensional attention mechanisms. The reviewers appreciate the technical contributions, including the efficient simulation results and the computational abstractions developed for 2D Transformers.

The rebuttal addressed several of the initial concerns and led to a more positive assessment of the paper, including an increase in reviewer scores. Some questions remain regarding the practical relevance of the 2D attention model and the approximation guarantees, but these are now viewed more as limitations and directions for future work than as issues that preclude publication.

Overall, the paper is viewed positively after the discussion, and the consensus is to accept the paper.

Final justification

The rebuttal addressed several of the initial concerns and led to a more positive assessment of the paper, including an increase in reviewer scores and the consensus is to accept the paper..

1 comment
Authors · CommentOpenReview ↗

General response to the Area Chair and all reviewers

We thank the Area Chair and all reviewers for their thoughtful feedback and engagement with our work. Several common themes emerged regarding the theoretical grounding of 2D attention, error propagation, and the practical relevance of our model. We appreciate the opportunity to clarify and address these concerns. We want to highlight in our responses how 2D attention functions as both a rigorous mathematical special case as well as a foundational architectural building block. And finally, how the ability to compile programs into weights opens up a number of exciting future directions for research!

Role of 2D heads

Our central contribution bridges the gap between computational efficiency and expressive power by introducing the first efficient online algorithm for dense 2D softmax attention. Unlike sparse-attention alternatives, our method approximates the full causal output with arbitrary key and query magnitudes, maintaining polylogarithmic amortized cost per step.

While d=2d=2 is the smallest dimension supporting exact content-addressed lookup via parabolic construction, it also preserves the planar geometry essential for our convex-hull algorithm. As dimensions increase, this geometric advantage diminishes. The closest prior arbitrary-magnitude result has polynomial overhead at d=2d=2, roughly O~(N3/2)\widetilde O(N^{3/2}) total time, whereas our bound is near-linear and holds in the stronger online setting. However, since this restriction applies only per head (leaving model width, depth, and head count unrestricted), we view 2D attention as a sharp efficiency–expressivity boundary for future hybrid architectures!

Program compilation

Most universality results in this area are often only existence proofs. Our construction on the other hand makes the universality executable. The ALM and CALM provide a compiler path from program logic to explicit Transformer weights. To our knowledge, prior Transformer Turing-completeness constructions were not carried through to a working decoder that executes nontrivial programs at this scale. The novelty is therefore not simply the definition of another universal machine. The nontrivial part is compiling the full memory and control-flow semantics into a standard transformer decoder while every attention head has dimension exactly two.

Because the construction already works in the 2D-head subclass, it also gives an alternative direct proof of Turing completeness for general Transformers as an immediate corollary. The restricted result is stronger: it yields a fixed decoder, an explicit program-to-weights construction, and an efficient step-by-step RAM simulation rather than only computability.

Practical relevance

The algorithmic and compiler results offer two complementary paths. A model using 2D heads can be trained with ordinary dense softmax and use our geometric data structure only at inference (i.e, no differentiation through the data structure is required). Separately, compiled heads or layers can coexist with learned components in the same residual stream, with learned modules interpreting an input or specifying a computation and compiled modules providing exact memory and control flow. Our present results provide the foundations for evaluating large trained 2D or hybrid models which we do not explore in this work. Our work however, does establish that 2D heads are neither computationally weak nor limited to short-horizon behavior.

Approximation guarantees

Theorem 2.1 controls the complete value-weighted output of each head, not only its attention probabilities. If the exact layer map FℓF_\ell is BℓB_\ell-Lipschitz and its approximation has error at most δℓ\delta_\ell, then

eℓ+1≤Bℓeℓ+δℓ,eL≤∑ℓ=1Lδℓ∏r=ℓ+1LBr.e_{\ell+1}\le B_\ell e_\ell+\delta_\ell, \qquad e_L\le \sum_{\ell=1}^{L}\delta_\ell\prod_{r=\ell+1}^{L}B_r.

Thus, when Bℓ≤BB_\ell\le B and δℓ≤δ\delta_\ell\le\delta, choosing δ=ϵ/[LBL−1]\delta=\epsilon/[LB^{L-1}] gives final error at most ϵ\epsilon. Additionally, since the attention runtime depends only polylogarithmically on 1/δ1/\delta, this preserves the near-linear dependence on sequence length.

We will provide more detailed responses under each of the reviews. We hope these points address and clarify all the concerns that have been pointed out!

Reviewer h2kCOpenReview ↗
Rating
5/6
Confidence
3/5
Quality
4/4
Clarity
3/4
Significance
4/4
Originality
4/4
Contribution type
theory
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

This is a potentiall high-impact theoretical and algorithmic contribution: online polylogarithmic 2D attention, efficient universality, and a compiler from C/WASM-like programs into transformer weights.

Strengths and weaknesses

Strong theoretical analysis. This is the best paper (of 4) I read. No sufficient experimental justification.

Questions

I do not have time to verify the proof correctness, if this is verified by our committee, I would raise my score to 6.

Limitations

Very ambitious; correctness depends on complex proofs, precision assumptions, and artifact validity. Practical relevance to trained LLMs remains indirect.

The practical relevence to ordinary trained transformers is not yet clear. The main universality and compiler claims concern analytically constructed weights, hardmax/ReGLU idealizations, or finite-horizon softmax approximations. This is valuable theoretically, but it does not directly imply that trained 2D-head transformers will learn useful long-horizon algorithms. I think empirical experiments are needed.

Formatting concerns

I do not have concerns.

2 comments
Authors · CommentOpenReview ↗

Response to Reviewer h2kC

We thank the reviewer for recognizing the strength and potential impact of the theoretical contribution, and for describing this as the strongest paper among those assigned!

Proof correctness and verification

The mathematical constructions and proofs in the paper were developed and extensively checked by the authors. The main text gives high-level proof sketches, and the appendices provide the complete arguments. We also show that the compiled execution traces from the constructed transformer model are also compared token by token against a reference WebAssembly interpreter, a direct gate-graph evaluator, brute-force lookup, and the optimized convex-hull cache. We show that all four paths produce exactly identical traces.

Precision assumptions

The paper separates the exact and finite-precision settings. The hardmax/ReGLU construction is exact. For a TT-step Turing-machine simulation, O(log⁡T)O(\log T) bits suffice. The finite-horizon softmax/SwiGLU result reproduces the same trace when the attention scale, gate sharpness, and approximation tolerance are chosen according to the minimum decision margins.

For general CALM programs, the required precision also depends on the magnitudes generated by the program, as stated explicitly in Appendix B.3.

Practical relevance

While our primary contributions are foundational, the result is the first concrete and empirical construction demonstrating that Transformers can execute complex combinatorial logic like branching, recursion, and indexed memory. This proof-of-concept for exact program execution via standard transformer weights suggests that compiled heads could feasibly coexist with learned heads in the same residual stream. And because our 2D-head restriction applies locally, it allows for hybrid architectures where compiled and trainable components interoperate. Furthermore, our approximation theorems provide a theoretically grounded speed-accuracy trade-off for 2D attention, establishing a framework where near-linear inference scaling is possible even in standard softmax-based architectures, provided that specific heads are delegated to our efficient 2D construction. We think that these extensions are very exciting directions for future research!

Experimental scope

The experiments that are reproducible with the attached code directly validate the main claims made in the paper: compiler correctness, exact long-horizon execution, and the asymptotic attention speedup.

Revision

We will clarify the precision assumptions in the main text, and add the above practical motivation and architectural implications to the revised paper.

Authors · CommentOpenReview ↗

Lean formalization of proofs

Prompted by the reviewer’s comment on proof correctness, we used LLM assistance to formalize in Lean the proofs of all four main theorems. We started the process since the review was available and just finished it today, hence this additional response is added.

The mathematical arguments themselves were developed and written by the authors; the LLM’s role was limited to translating the proofs and formalizing them to Lean, while we check that the Lean statements faithfully reflect the theorems in the manuscript. The formalization exposed only minor typographical and presentational points, which we will clarify in the revised manuscript. All four main results are now verified end to end by the Lean kernel, with no sorry/admit placeholders or project-specific axioms.

We will include the full Lean source, pinned dependencies, and build instructions to the revised supplementary material, so the verification can be reproduced mechanically. This formal artifact complements the written proofs and the independent implementation checks already provided in Section 5.

Reviewer KNdgOpenReview ↗
Rating
4/6
Confidence
3/5
Quality
3/4
Clarity
3/4
Significance
2/4
Originality
4/4
Contribution type
general
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

The paper proposes a new algorithm for attention in the case where attention heads are 2 dimensional. The algorithm proposed approximates 2D attention using geometric structure and range query data structures, achieving polylogarithmic amortized time per insertion and query. It then proceeds to show that this 2D attention is able to support universal computation through simulating a RAM machine through chain of thought decoding.

Strengths and weaknesses

Strength:

  • Novel algorithm for 2D attention by using efficient approximations and data structures

Weakness:

  • The simulation of a RAM machine seems quite disjoint and not the main goal of attention algorithms in language models. It would be more interesting to see if a 2D attention algorithm could be practically useful, or the tradeoff in performance vs speed of attention.
  • The proposed attention algorithm is limited to 2D keys and queries, relying on planar geometry. The paper does not provide a path to generalize the method to higher-dimensional attention heads, which limits its relevance as a practical attention architecture.
Questions
  1. How does the proposed 2D-attention algorithm compare conceptually and practically with existing subquadratic attention approaches such as sparse attention?
  2. What practical applications are possible for 2D attention? Are there existing or plausible transformer architectures where restricting each head’s keys and queries to two dimensions would be useful without substantially degrading modeling performance?
Limitations

yes

Final justification

I thank the authors for their rebuttals raised and it does address some of my concerns. I have increased the rating

Formatting concerns

nil

1 comment
Authors · CommentOpenReview ↗

Response to Reviewer KNdg

We thank the reviewer for recognizing the novelty and originality of the 2D-attention algorithm!

Relation to the RAM simulation

The algorithmic and universality results address the same question: whether full attention can be evaluated substantially faster while retaining Turing-completeness. The RAM simulation shows that the 2D attention operator accelerated by our data structure still supports indexed memory and arbitrary computation with polylogarithmic overhead per simulated step. Our compiler then realizes this construction as Transformer weights.

Comparison with sparse attention

Structured sparse attention can be subquadratic, but it changes the attention operator by removing interactions outside a chosen graph. Some content-selected methods also retain a quadratic score-computation step. Our algorithm instead approximates the original full causal 2D softmax output:

∣A^i−∑j≤ie⟨qi,kj⟩vj∑j≤ie⟨qi,kj⟩∣∞≤ϵ.\left|\widehat A_i-\frac{\sum_{j\le i}e^{\langle q_i,k_j\rangle}v_j}{\sum_{j\le i}e^{\langle q_i,k_j\rangle}}\right|_\infty\le\epsilon.

Additionally, the guarantee is worst-case and online, allows arbitrary key and query magnitudes, and preserves every previous token as a potential contributor.

Why d=2d=2

Our algorithmic result is specific to two-dimensional heads. For arbitrary magnitudes and fixed dimension dd, prior work gives offline full-attention algorithms with complexity O~(N2−1/d)\widetilde O(N^{2-1/d}) [1]. These bounds are subquadratic but approach quadratic as dd grows. At d=2d=2, the prior bound is O~(N3/2)\widetilde O(N^{3/2}), while our result gives a much better near-linear total time in the stronger online setting.

Practical relevance

In terms of practical relevance, while the work is mostly theoretical and advances the state of the art, it is also, to the best of our knowledge, the first practical construction where Transformers handle complex combinatorial logic. The compiled Transformer executes indexed memory, branches, recursion, and backtracking over millions of autoregressive steps with exact traces.

While the weights are compiled and not learned, these concepts can be complementary. The compiled model uses standard Transformer components, and fixed compiled heads or layers can coexist with trainable components in the same residual stream. Learned components may interpret the input and formulate the computation, while the compiled component executes it directly. We think that this is an exciting new avenue for future research!

Our theoretical results also have broad applicability for approximating standard softmax 2D attention beyond the computational construction. The two-dimensional restriction is not as limiting as it may appear, since it applies per head. Model width, depth, and head count remain unrestricted. Moreover, a larger architecture may combine 2D heads with other techniques, such as linear attention or gated-delta heads, and retain near-linear overall inference time when those additional components are themselves linear or near-linear. Our guarantee applies to the 2D heads.

The theorem therefore gives a certified speed–accuracy tradeoff relative to dense 2D attention. Measuring the task-level performance of trained 2D or hybrid architectures is a separate empirical question, which we think is a promising avenue for future work!

Revision

We will add the comparison with sparse attention, state explicitly that the algorithmic improvement is specific to d=2d=2, and include the above practical motivation and architectural implications in the revised paper.

[1] Shreya Gupta, Boyang Huang, Barna Saha, Yinzhan Xu, and Christopher Ye. Subquadratic algorithms and hardness for attention with any temperature. ICLR, 2026.

Reviewer XVoYOpenReview ↗
Rating
5/6
Confidence
3/5
Quality
4/4
Clarity
4/4
Significance
3/4
Originality
4/4
Contribution type
concept_feasibility
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

The paper provides two main contributions. The first is a data structure which enables efficiently and accurately approximating 2D-Attention weights in an online manner. The second is a proof that 2D-Attention is sufficient for simulating any Turing machine, simplifying the constructions employed in prior works.

Efficient attention is achieved by retrieving a sparse set of keys given a query and computing a Taylor approximation of the softmax over retrieved keys. The sparse key retrieval technique innovates over prior methods by replacing a general but expensive halfspace search algorithm with a rectangular range search which can be significantly faster in low dimensions.

The author's then provide a universality result, selecting a very simple/minimal Turing-complete model (a two-stack pushdown machine) which can be instantiated by the proposed 2D attention transformer. This result is far simpler and more closely grounded to real-world transformer parameterizations (decoder-only, dot-product attention, and all operations can be approximated by log T bits of precision with softmax/swiglu nonlinearities which match standard implementations).

Beyond just providing theoretical results, the paper provides the CALM language for Append-only Lookup Machines (a more general class of pushdown machines which their 2D attention transformer can instantiate) and finds model weights that instantiate a program by solving a MILP. For ease of use, they also provide a CALM interpreter for WebAssembly.

Strengths and weaknesses

This paper pushes results beyond related work significantly in multiple different directions, providing substantial contributions and simplifications in all three. The subquadratic attention result is novel and significant, creatively leveraging low dimensional geometry to get huge efficiency improvements over recent preceding work. While this improvement does require very low dimensional attention heads, demonstrating that 2D attention is also sufficient for Turing completeness (in a CoT way) addresses expressivity concerns. This proof doesn't just apply to the specific construction they use, but extends to a much larger (and much closer to modern transformers) class of models while also being simpler in construction. Even though the contribution type is "concept and feasibility", providing the CALM language and WebAssembly interpreter to enable C programs to be compiled directly to model weights of a transformer and demonstrating effectiveness/reliability at tasks like Sudoku helps solidify the work. The paper is also very well written and organized.

The main weakness of the work that I see is the lack of investigation/exploration into the training of such networks. The subquadratic efficiency of attention is appealing as a property on it's own, and an investigation/insight into how this network would be trained or the discussion of challenges that need to be addressed to make this practical for regular trained transformers (e.g. how to backpropagate through the search/top_k sparsemax, or, that trained transformers with regular softmax attention but 2D or 3D heads can perform comparably/similarly to those which are trained with higher dimensional heads, and then the attention mechanism be replaced with the subquadratic one at inference with little performance loss).

One subtle issue, although perhaps I've misunderstood something, is in regards to approximating attention. For approximating correct Attention behavior, i.e. approximating Y = AXW_v, it is not sufficient to ensure that one only approximates the attention weights A accurately; one also needs to be mindful of the values as well -> boundedness assumptions on values are required. This assumption should generally hold for transformers, but, one needs to be mindful of the values for deciding the degree of approximation precision required for A.

Questions

I think all my questions are covered within my weaknesses. Specifically, do you have any insights into the application of the subquadratic 2D Attention for training models or accelerating inference with relatively little performance loss (or why this would be hard), and, what is the best way to account for and handle the role of the values in your 2D attention construction?

Limitations

yes

Final justification

I'd like to maintain my score of 5. I think the paper is definitely interesting, it is clearly written, and provides multiple strong results. The main limitations precluding me from raising the score is that I'm not sure the method is particularly useful. The limitations are clearly expressed, and it's unclear whether any methods in this paper can be applied for any practical purposes, which is the only thing that holds my score back from a strong accept.

Formatting concerns

None

1 comment
Authors · CommentOpenReview ↗

Response to Reviewer XVoY

We thank the reviewer for the strong assessment of the geometric algorithm, the universality construction, the compiler, and the presentation!

Constructed weights, training, and inference

The fact that the weights are constructed rather than learned is deliberate and to some degree necessary. Combinatorial tasks are notoriously challenging to solve via gradient-based training and even large transformers struggle on simple tasks like multiplication of very large numbers. Our specific point is not that 2d-attention based models can be trained using gradient descent to solve challenging computational tasks but that they are expressive enough to encode them.

The compiled model is nevertheless a standard Transformer. At the architectural level, its fixed computational heads and layers can be combined with other trainable parameters in the same model. The learned part may handle representation learning and task interfaces, while the compiled part provides exact indexed memory and control flow. Although this is a very exciting direction for research, we do not study the training of such hybrid models in this work. However, the construction provides the computational component required for them!

Separately, our data structure approximates ordinary full 2D softmax attention rather than defining a new sparse operator. A model trained with dense 2D softmax can therefore use our provable approximation at inference without differentiating through the geometric data structure. A model may also mix 2D heads with other head types. Our guarantees apply to the 2D heads, while other components may represent additional learned features.

Role of values

Theorem 2.1 directly approximates the complete value-weighted attention output

∑jvje⟨q,kj⟩∑je⟨q,kj⟩\frac{\sum_j v_j e^{\langle q,k_j\rangle}} {\sum_j e^{\langle q,k_j\rangle}}

under the assumption ∣vj∣∞≤V|v_j|_\infty\le V. The proof controls the signed numerator and positive denominator separately, and the value bound appears explicitly in the polylog⁡(NV/ϵ)\operatorname{polylog}(NV/\epsilon) complexity.

Revision

We will clarify all of the above points in our revised manuscript.

Reviewer 159AOpenReview ↗
Rating
4/6
Confidence
3/5
Quality
4/4
Clarity
3/4
Significance
3/4
Originality
2/4
Contribution type
concept_feasibility
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

The paper is about 2D Transformer as a solution to efficiency and universal computation. The paper shows that each attention head in 2D Transformer can be approximated to an additive error of ϵ\epsilon in time polylog(N/ϵ)\text{polylog}(N / \epsilon). Thus, the total time to approximate a 2D Transformer is O~(N)\tilde{O}(N). This is an improve over the state of the arts's O~(N3/2)\tilde{O}(N^{3/2}). Then, the paper proposes a computational model called Append-only Lookup Machines (ALM). The idea (to my understanding) is that ALM has several sequential memories, each exactly corresponds to a Transformer layer. The paper shows that 2D Transformer can simulate ALM; and that ALM can simulate Turing machine and RAM. Therefore, the paper proves that 2D Transformer is Turing-complete. Last, the paper creates a programming language (called CALM) to implement ALM and to turn ALM to 2D Transformer's weights. The paper runs CALM on some examples (for instance, to implement a solver for Sudoku).

Strengths and weaknesses

I will go over the strengths and weaknesses of each contribution.

The paper approximates 2D Transformer in a time better than state of the art. This result improves on some past literature, therefore it is a good addition to the field. However, the paper just proves that each attention head is well-approximated. It's unaddressed where the error for each attention head is then amplified over many heads and layers. Therefore, it's unclear to me if 2D Transformer's output is well-approximated or not.

The paper attempts to provide a nice abstraction of 2D Transformer by ALM, backed up by proofs of universality and a programming framework for ALM. Via ALM, 2D Transformer is easy to be built, as specifying the memories (or specifying nodes) in ALM is enough - CALM will then automatically generate 2D Transformer's weights. However, the idea of ALM does not seem that novel to me. From my understanding, each node in ALM corresponds to an attention head or a feedforward network (FFN) in 2D Transformer. Then, 2D Transformer should trivially be able to simulate ALM (by just making Transformer heads doing the exact same things as ALM's nodes). Also, since general Transformers are proved to be Turing complete, then the result that ALM is Turing complete is not surprising, either (though your technique to prove Turing completeness of ALM seems new).

Overall, the paper has good quality, with claims backed up by rigorous proofs. Clarity can use some improvements though - I personally find the paper hard to follow at times, with definitions and/or explanations missing. Regarding significance and originality, key contributions, in my opinion, include approximating attention heads in 2D Transformer and providing a programming abstraction for 2D Transformer via ALM. But, the idea of ALM is not so novel, and the method of approximating attention heads is not proved to guarantee good approximation for 2D Transformer. Therefore, the paper may not meet the bar for signficance and originality (for the Concept and Feasibility category), as they require "high potential for changing our approaches and/or understanding" and "highly novel ideas". The paper might be good for the General category.

Questions
  1. To clarify: if there is a tie in attention scores, then how does you hardmax attention break tie?; what is VV (line 82)?; what is dd (line 82)?; how are attention heads' ouputs combined in a layer (line 817)?

  2. Line 362: Your Sudodo solver is a backtracking algorithm, right? Then, how does it illustrate the power of 2D Transformer (or ALM)?

  3. Line 916: Just to clarify, the built-in scalars are essentially just positional encodings, right?

  4. 2D Transformer can simulate ALM. Is the reverse true, i.e. can ALM simulate 2D Transformer?

Limitations

I have nothing to add here (I pointed out some weaknesses above).

Final justification

The paper is technically solid. The model of 2D Transformer is computation-efficient, and its abstraction using ALM gives a nice programming framework. Therefore, 2D Transformer has good potentials for practical applications. The authors somewhat addressed my concern about not having a proof that 2D Transformer's output can be well-approximated. Thus, I change my rating from Borderline Reject to Borderline Accept. Note that my concern was not fully resolved, therefore my confidence in my rating is low.

Formatting concerns

No concerns.

6 comments
Authors · CommentOpenReview ↗

Response to Reviewer 159A

We thank the reviewer for the careful reading of our work and recognizing the improvement over prior attention algorithms, the usefulness of CALM, and the rigor of the proofs!

Approximation across heads and layers

The per-head guarantee directly yields a full-network guarantee. If each layer incurs error at most δ\delta and every layer is BB-Lipschitz, then the final error after LL layers is at most LBLδL B^L \delta. So, the final error ϵ\epsilon is obtained by setting δ=ϵ/(LBL)\delta=\epsilon/(L B^L).

Since the attention algorithm depends only polylogarithmically on 1/δ1/\delta, this adds log⁡L+Llog⁡B\log L+L\log B to the logarithmic precision term and preserves the near-linear dependence on sequence length. This precision dependence is essentially unavoidable. Attention outputs are generally irrational and must be represented using finite-precision arithmetic, so even standard implementations of “exact” attention are approximate. Our tolerance can be chosen small enough to match any prescribed finite-precision implementation to near-exact accuracy. The theorem also approximates the complete value-weighted attention output, rather than only the attention probabilities.

ALM and novelty

ALM is intentionally a simple intermediate language. It isolates a small set of Transformer-native primitives (i.e., lookup, cumulative sum, and gated local computation) that are sufficient for general computation and naturally respect the append-only structure of autoregressive Transformers.

Prior Turing-completeness results establish computability through simulations of simpler abstract machines which are universal but not necessarily efficient [1, 2]. Our construction based on ALM provides an efficient step-by-step RAM simulation and a natural language for turning code into transformer weights.

Importantly, we note that our results do not follow from any prior work on Turing-completeness. Universality results for unrestricted Transformers [1] do not imply universality when every attention head is restricted to two dimensions. Particularly, universality results for unrestricted transformers imposes requirements over the head dimension, which does not typically hold if we restrict the head dimension to 2. The ALM construction proves universality under this restriction and combined with our fast 2D-attention algorithm, it gives polylogarithmic overhead per simulated step for O(log⁡N)O(\log N)-bit word-RAM machines.

And to the best of our knowledge, this is the first time an empirical and practical construction of this form has ever been shown. We think that this therefore opens up a number of new possibilities by being able to distill / inject arbitrary programs almost exactly into an LLM!

Clarifications

  • Hardmax ties. Hardmax averages the values at all maximizing positions. In the lookup construction, the positional perturbation makes the latest visible match the unique maximizer.
  • VV and dd. The values satisfy vj∈[−V,V]dv_j\in[-V,V]^d, where VV bounds each coordinate and d=O(1)d=O(1) is the value dimension.
  • Combining heads. Head outputs are concatenated and passed through the standard linear output projection. In our construction, this projection routes outputs to designated residual coordinates.
  • Sudoku. The solver is a backtracking algorithm. It tests a transformer model’s ability to implement indexed memory, nested control flow, recursion, contradiction detection, and millions of sequential operations.
  • Built-in scalars. Indeed, these are deterministic positional features. The monotone feature resolves lookup ties, while the quadratic feature supports the parabolic key encoding.
  • Reverse simulation. ALM is meant as an abstraction of Transformer and is not meant to encode everything that a transformer can do. However, as ALMs are Turing complete, they can simulate any finite-precision 2D Transformer. That said, we do not claim an efficient, structure-preserving compilation in this direction.

We hope these points provide additional clarification and we will incorporate these notes into the revised manuscript.

[1] Pérez, Jorge, Pablo Barceló, and Javier Marinkovic. "Attention is turing-complete." JMLR, 2021.

[2] Shreya Gupta, Boyang Huang, Barna Saha, Yinzhan Xu, and Christopher Ye. Subquadratic algorithms and hardness for attention with any temperature. ICLR, 2026.

Reviewer 159A · CommentOpenReview ↗

Thank you for your clarifications.

Regarding approximation across heads and layers, BB-Lipschitz seems to be too strong as an assumption. Any justifications for it?

I acknowledge that the fact that ALM is Turing-complete does not directly follow from past results (like [1]).

Authors · CommentOpenReview ↗

Thank you for the follow-up, and we appreciate your acknowledgment that our ALM Turing-completeness result does not follow directly from prior results!

Regarding BB, it is not an additional assumption. For our construction and any prescribed finite horizon TT, the exact execution contains finitely many intermediate activations and is therefore bounded. On a bounded neighborhood of these activations, affine maps, ReGLU/SwiGLU, and value-weighted softmax attention are locally Lipschitz. Let VTV_T bound the absolute coordinates of all attention value vectors encountered during these steps, so Theorem 2.1 applies with V=VTV=V_T. Taking the maximum of the resulting layerwise Lipschitz constants gives a finite, and horizon-dependent constant BTB_T.

On a related note, this bounded-trajectory argument is also used in prior works on finite-horizon Transformer simulations: [3] derives data-dependent Lipschitz bounds under bounded hidden-state norms, while [4] assumes bounded activations and allocate O(ϵ/T)O(\epsilon/T) error per operation.

We will clarify this finite-horizon, construction-dependent interpretation of BB in the revised manuscript. We appreciate your follow-up and would be happy to address any further questions.

[3] Colin Wei, Yining Chen, and Tengyu Ma. “Statistically Meaningful Approximation: a Case Study on Approximating Turing Machines with Transformers.” NeurIPS, 2022.

[4] Angeliki Giannou, Shashank Rajput, Jy-Yong Sohn, Kangwook Lee, Jason D. Lee, and Dimitris Papailiopoulos. “Looped Transformers as Programmable Computers.” ICML, 2023.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Missing a submission?

Loading the discussion…