PreprintCited by 16Topic ModelingComputability, Logic, AI AlgorithmsNatural Language Processing Techniques

What Algorithms can Transformers Learn? A Study in Length Generalization

Open access
Zhou, Hattie, Bradley, Arwen, Littwin, Etai, Razin, Noam, Saremi, Omid, Susskind, Josh, Bengio, Samy, Nakkiran, Preetum·2023·arXiv

Abstract

Large language models exhibit surprising emergent generalization properties, yet also struggle on many simple reasoning tasks such as arithmetic and parity. This raises the question of if and when Transformer models can learn the true algorithm for solving a task. We study the scope of Transformers' abilities in the specific setting of length generalization on algorithmic tasks. Here, we propose a unifying framework to understand when and how Transformers can exhibit strong length generalization on a given task. Specifically, we leverage RASP (Weiss et al., 2021) -- a programming language designed for the computational model of a Transformer -- and introduce the RASP-Generalization Conjecture: Transformers tend to length generalize on a task if the task can be solved by a short RASP program which works for all input lengths. This simple conjecture remarkably captures most known instances of length generalization on algorithmic tasks. Moreover, we leverage our insights to drastically improve generalization performance on traditionally hard tasks (such as parity and addition). On the theoretical side, we give a simple example where the "min-degree-interpolator" model of learning from Abbe et al. (2023) does not correctly predict Transformers' out-of-distribution behavior, but our conjecture does. Overall, our work provides a novel perspective on the mechanisms of compositional generalization and the algorithmic capabilities of Transformers.

AI snapshot

Written from the paper’s full text.

TL;DR

The paper proposes the RASP-Generalization Conjecture: Transformers tend to length-generalize on algorithmic tasks when the task can be solved by a short, uniform RASP-L program. It validates this framework across synthetic tasks and uses it to construct interventions that yield strong length generalization on parity and addition for Transformers trained from scratch.

Key findings

  • Tasks with short RASP-L solutions length-generalized well, while tasks without them did not: at +10 length, Count 100%, Mode 100%, Unique Copy 96%, Sort 96%, versus Mode (hard) 0%, Repeat Copy 0%, Addition 0%, and Parity 0%.
  • Reformatting tasks to admit shorter RASP-L programs improved generalization: “Addition (new)” and “Parity (new)” reached 100% at +10 length; reverse-order addition with index hints generalized on hard-carry length-50 examples once training length exceeded 40, and parity with scratchpad generalized perfectly on length 50 when training length reached 40.
  • Increasing training diversity also helped: balanced carry sampling unlocked forward addition on hard-carry evaluation, and sort models trained with length 35 or more generalized strongly to length 50.
  • In a Boolean-AND setting from Abbe et al. (2023), the trained Transformer reached 100% test accuracy on the unseen test set, matching the RASP-based prediction but not the min-degree-interpolator prediction.

Methods

  • The authors introduce RASP-L, a restricted, learnable subset of RASP with int8 variables, restricted index operations, and min/max aggregation, and state the RASP-Generalization Conjecture with conditions of realizability, simplicity, and diversity.
  • They train decoder-only causal Transformers from scratch with learned positional embeddings, using context packing and shifting, online i.i.d. batches, exact-match evaluation, and median results over 20 seeds unless otherwise specified.
  • Experiments cover easy tasks (count, mode, copy with unique tokens, sort) and hard tasks (copy with repeating tokens, addition, parity), plus interventions using index hints, reverse-order output, scratchpads, and balanced carry sampling; a theoretical comparison contrasts RASP-L complexity with minimum-degree interpolation.

Limitations

  • The paper states RASP and RASP-L are not complete: not all efficiently Transformer-representable functions have efficient RASP implementations, numerical algorithms are ill-suited, and RASP supports only deterministic outputs and binary attention masks.
  • The paper states the complexity measure is imperfect: RASP-L program length does not perfectly correspond to Transformer complexity, more refined notions may exist, and finding the minimum RASP-L program is likely intractable.
  • The paper states the conjecture is not fully formal and cannot precisely predict the extent of length generalization or the required data diversity; it also leaves mechanistic verification of whether learned weights match compiled RASP-L programs to future work.

Model-written summary. Check it against the paper before relying on it.

Integrity signals

Registry

DataCite · 10.48550/arxiv.2310.16028

Cites

76 of 76 references verified0 citation errors · 0 not checkable

Statistics

Nothing to recompute.

Claims the paper makes

29 of 37 cited sources checked · 11 supported · 2 flagged · accuracy not yet measured

  • Premisecitation

    Learned positional embedding is better than a number of more sophisticated embedding approaches on length generalization.

    “This is consistent with the findings reported in Kazemnejad et al. (2023), which showed that learned positional embedding is better than a number of more sophisticated embedding approaches on length generalization.”
    Quote in the paperNot a substantial claim1 of 1 sources checked
    • cites Kazemnejad et al. (2023) source

      The Model Evaluation section says the study used sinusoidal absolute position embeddings, not learned ones, because learned embeddings cannot produce embeddings for unseen positions. The Discussion reports that NoPE outperformed explicit positional encodings and that Rotary marginally outperformed APE—the opposite of the claimed comparison. (LLM, conf=0.88)

      Checked by a reasoning model — may be wrong.

      Experimental — accuracy not yet measured
  • Premisecitation

    Even models finetuned from pretrained LLMs struggle on simple algorithmic tasks.

    “even models finetuned from pretrained LLMs struggle on simple algorithmic tasks (Anil et al., 2022).”
    Quote in the paperSubstantial claim1 of 1 sources checked
    • cites Anil et al., 2022 source

      Section 3 (p. 4) reports that models finetuned from pretrained language-model checkpoints perform poorly on out-of-distribution lengths in simple algorithmic tasks. The Contributions section (p. 2) also says they can attain perfect in-distribution accuracy, so the unqualified claim that they struggle on the tasks omits the crucial length-generalization condition. (LLM, conf=0.88)

      Experimental — accuracy not yet measured
  • Premisecitation

    Transformers trained from scratch on addition and other arithmetic tasks exhibit little to no length generalization in prior work.

    “Transformers trained from scratch on addition and other arithmetic tasks exhibit little to no length generalization in prior work (Nye et al., 2021;Nogueira et al., 2021;Lee et al., 2023)”
    Quote in the paperSubstantial claim2 of 3 sources checked
    • cites Nye et al., 2021 source

      Section 3 (Addition; page unavailable) reports that baseline Transformers trained on 1–8-digit addition completely failed on out-of-distribution 9–10-digit problems. But Section 2 (Method; page unavailable) says all experimental models were pre-trained before task-specific fine-tuning, not trained from scratch. The cited result therefore supports poor length generalization on addition, but not the claim about from-scratch training or other arithmetic tasks. (LLM, conf=0.88)

      Experimental — accuracy not yet measured
    • cites Nogueira et al., 2021 source

      Appendix C (pp. 10–12) reports poor extrapolation on many addition and subtraction tests, supporting a limitation in length generalization. But its largest model achieves high accuracy on several 50-to-60-digit tests. Appendix E (p. 13) compares models trained from scratch with pretrained models only when training and testing cover the same lengths; it does not establish the claimed length-generalization result specifically for models trained from scratch. (LLM, conf=0.85)

      Experimental — accuracy not yet measured
    • cites Lee et al., 2023

      Couldn’t be matched to a paper in Crossref, so it can’t be checked.

  • Interpretationcitation

    The copy with unique tokens task is easy because an induction head can be leveraged.

    “Intuitively, this task is easy because we can leverage what is called an “induction head” (Olsson et al., 2022).”
    Quote in the paperSubstantial claim1 of 1 sources checked
    • cites Olsson et al., 2022 source
  • Premisecitation

    Models trained from scratch show little to no length generalization on addition.

    “Models trained from scratch show little to no length generalization on addition (Nye et al., 2021;Lee et al., 2023)”
    Quote in the paperSubstantial claim1 of 2 sources checked
    • cites Nye et al., 2021 source

      Section 3 (page not specified) reports that models trained without scratchpads completely failed to generalize from 1–8-digit addition to 9–10-digit addition. But Section 2 (page not specified) says all experiments used pre-trained language models, and Section 3 says they were fine-tuned for addition. This paper therefore supports the length-generalization result for fine-tuned models without scratchpads, not models trained from scratch. (LLM, conf=0.88)

      Experimental — accuracy not yet measured
    • cites Lee et al., 2023

      Couldn’t be matched to a paper in Crossref, so it can’t be checked.

  • Classified as probably not a substantial claim. 34
  • May combine two claims. 35
  • The quote only partly states this claim. 4
  • Classified as probably not a substantial claim. May combine two claims.

    Premisecitation

    RASP-L is a human-readable programming language whose programs can be compiled into Transformer weights, with each line compiling into at most one Transformer layer.

    “RASP-L is a human-readable programming language which defines programs that can be compiled into Transformer weightsfoot_0 , such that each line of RASP-L compiles into at most one Transformer layer.”
    Quote in the paperSubstantial claim2 of 2 sources checked
    • cites Weiss et al., 2021 source

      Section 3.1 (p. 6) says RASP programs compile to Transformer architectures, but explicitly states that full compilation to concrete Transformer weights is beyond the paper’s scope. The paper calls its language RASP, not RASP-L, and does not establish that each line compiles into at most one layer. (LLM, conf=0.90)

      Checked by a reasoning model — may be wrong.

      Experimental — accuracy not yet measured
    • cites Lindner et al., 2023 source

      Section 2.2 describes RASP—not RASP-L—as human-readable, and the Machine code section says Tracr compiles RASP programs into Transformer weights. The paper does not establish a one-line-to-at-most-one-layer rule; Appendix D.2 describes a selector-width primitive that compiles into both an attention layer and an MLP layer. Page numbers were not available in our copy. (LLM, conf=0.88)

      Experimental — accuracy not yet measured
  • May combine two claims.

    Interpretationown data

    The min-degree-interpolator model of learning from Abbe et al. (2023) does not correctly predict Transformers' out-of-distribution behavior, but the RASP conjecture does.

    “we give a simple example where the “min-degree-interpolator” model of learning from Abbe et al. (2023) does not correctly predict Transformers’ out-of-distribution behavior, but our conjecture does.”
    Quote in the paperSubstantial claim1 of 1 sources checked
    • cites Abbe et al. (2023) source
  • Classified as probably not a substantial claim.

    Premisecitation

    Length generalization can sometimes occur for particular architectural choices and scratchpad formats.

    “length generalization can sometimes occur for particular architectural choices and scratchpad formats (Jelassi et al., 2023;Kazemnejad et al., 2023;Li & McClelland, 2023).”
    Quote in the paperSubstantial claim1 of 3 sources checked
    • cites Jelassi et al., 2023

      Couldn’t be matched to a paper in Crossref, so it can’t be checked.

    • cites Kazemnejad et al., 2023 source
    • cites Li & McClelland, 2023

      Couldn’t be matched to a paper in Crossref, so it can’t be checked.

  • The quote only partly states this claim.

    Interpretationnone given

    A decoder-only autoregressive Transformer is likely to length-generalize when trained to completion on an algorithmic task if the task can be solved by a short RASP-L program that works for all input lengths.

    “introduce the RASP-Generalization Conjecture: Transformers tend to length generalize on a task if the task can be solved by a short RASP program which works for all input lengths.”
    Quote in the paperSubstantial claim1 of 1 sources checked
    • cites Weiss et al., 2021 source

      The Abstract (p. 1) proposes RASP as a model for transformer encoders, and Experiments (pp. 8–9) show that transformers can learn several tasks with RASP solutions. But the paper does not state the claimed length-generalization conjecture: Appendix A.2 (p. 13) reports training and testing on sequences within the same 0–100 length range. The cited evidence also does not establish the claim for decoder-only autoregressive Transformers or RASP-L. (LLM, conf=0.86)

      Experimental — accuracy not yet measured
    • The authors state this as an assumption: In-distribution generalization is achieved nearly-optimally.
  • May combine two claims.

    Premisecitation

    Merrill et al. (2022) studied a binary-only version of the mode task and demonstrated strong length generalization.

    “Merrill et al. (2022) studied a binary-only version of this task and demonstrated strong length generalization.”
    Quote in the paperNot a substantial claim1 of 1 sources checked
    • cites Merrill et al. (2022) source
  • Classified as probably not a substantial claim. May combine two claims.

    Premisecitation

    Olsson et al. (2022) found that induction heads are reliably learned even by simple Transformers, and conjectured them to be a component of what enables in-context learning in LLMs.

    “Olsson et al. (2022) found that induction heads are reliably learned even by simple Transformers, and conjectured them to be a component of what enables in-context learning in LLMs.”
    Quote in the paperSubstantial claim1 of 1 sources checked
    • cites Olsson et al., 2022 source
  • Probably not a substantial claim: may not pass S4 (based).

    Interpretationnone given
    § shifts sequence x to the right by n positions return kqv(indices(x) + n, indices(x), x, equals, default=default)

    The approach bypasses the limitations presented in Hahn (2020), which exploit non-saturating softmaxes.

    “This bypasses the limitations presented in Hahn (2020), which exploit non-saturating softmaxes.”
    Quote in the paperNot a substantial claim1 of 1 sources checked
    • cites Hahn (2020) source
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Premisecitation

    There is a fundamental noise floor to error-free length-generalization of autoregressive models.

    “we agree with Dziri et al. (2023) that there is a fundamental”
    Quote in the paperNot a substantial claim1 of 1 sources checked
    • cites Dziri et al. (2023) source

      Section 4, “Error Propagations: The Theoretical Limits” (page not provided), shows that errors accumulate as compositional tasks grow when the estimator has a nonzero error probability and the propositions’ other assumptions hold. “Theoretical Findings and their Empirical Implications” says these proofs apply to autoregressive language models in general, but qualifies the result as being under reasonable assumptions. The claim omits those conditions and makes the limit sound unconditional. (LLM, conf=0.83)

      Experimental — accuracy not yet measured
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Premisecitation
    § shifts sequence x to the right by n positions return kqv(indices(x) + n, indices(x), x, equals, default=default)

    Lindner et al. (2023) provide an explicit compiler from RASP programs to Transformer weights.

    “In factLindner et al. (2023) provide an explicit compiler from RASP programs to Transformer weights.”
    Quote in the paperNot a substantial claim1 of 1 sources checked
    • cites Lindner et al. (2023) source
  • May combine two claims.

    Findingown data

    Tasks that admit a short RASP-L solution exhibit strong length generalization, and tasks with strong length generalization admit a short RASP-L solution.

    “We show that all tasks which admit a short solution in the RASP-L programming language also exhibit strong length generalization performance, and vice versa.”
    • Also stated in: § 1. Realizability. The true next-token function for the task can be represented by a single causal · plain
      “empirically, if a task can be solved by a RASP-L program, then it can be learned easily by a Transformer, and vice versa.”
    Quote in the paperSubstantial claim
    • Rests on an assumption: Length generalization on algorithmic tasks is a measure of how well language models can learn to reason.
  • May combine two claims.

    Findingreasoning

    Parity does not have a RASP-L program, but addition with index hints does.

    “This helps explain why parity does not have a RASP-L program, but addition with index hints does.”
    Quote in the paperSubstantial claim
  • May combine two claims.

    Findingown data

    Tasks with simple RASP-L programs length-generalize well, while tasks without them length-generalize poorly.

    “We show that the tasks with simple RASP-L programs length-generalize well, while the remaining tasks length-generalize poorly.”
    Quote in the paperSubstantial claim
    • Rests on an assumption: Length generalization on algorithmic tasks is a measure of how well language models can learn to reason.
  • May combine two claims.

    Findingreasoning

    Index-arithmetic and precise indexing operations are forbidden in RASP-L.

    “Such operations are forbidden in RASP-L, as they require index-arithmetic which are difficult to represent in a global, length-generalizing way.”
    Quote in the paperSubstantial claim
  • May combine two claims.

    Findingown data

    Under the paper's experimental settings, no length generalization is observed for addition; test performance does not exceed random chance when evaluated on examples 5 or more tokens longer than the training set.

    “Under our experimental settings, we find that no length generalization is observed for both addition and pairity tasks: test performance does not exceed random chance when evaluated on examples 5 or more tokens longer than the training set.”
    Quote in the paperSubstantial claim
  • May combine two claims.

    Findingown data

    The mode scratchpad performs significantly worse than no scratchpad, both on exact match and on accuracy of the final answer.

    “We show in Figure 3c that the scratchpad performs significantly worse than no scratchpad, both when measured on exact match and also on the accuracy of the final answer.”
    Quote in the paperSubstantial claim
  • May combine two claims.

    Findingnone given

    Addition, parity, and copy with repeating tokens do not admit simple RASP-L solutions.

    “Next, we study three tasks that do not admit simple RASP-L solutions: addition, parity, and copy with repeating tokens.”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Findingnone given

    The sort task has a one-line RASP-L program.

    “Indeed, there is a oneline RASP-L program for this task (Listing 7).”
    Quote in the paperNot a substantial claim
  • May combine two claims.

    Findingown data

    Under the paper's experimental settings, no length generalization is observed for parity; test performance does not exceed random chance when evaluated on examples 5 or more tokens longer than the training set.

    “Under our experimental settings, we find that no length generalization is observed for both addition and pairity tasks: test performance does not exceed random chance when evaluated on examples 5 or more tokens longer than the training set.”
    Quote in the paperSubstantial claim
  • May combine two claims.

    Findingreasoning

    RASP-L is a useful predictive tool: empirically, if a task can be solved by a RASP-L program, then it can be learned easily by a Transformer, and vice versa.

    “We only claim that RASP-L is a useful predictive tool: empirically, if a task can be solved by a RASP-L program, then it can be learned easily by a Transformer, and vice versa.”
    Quote in the paperNot a substantial claim
  • May combine two claims.

    Findingown data

    Both scratchpads optimize much better than parity with no scratchpad, which is unable to even fit the training set and demonstrates no length generalization.

    “Both scratchpads optimizes much better than parity with no scratchpad, which is unable to even fit the training set and demonstrates no length generalization.”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Findingnone given

    The paper cannot precisely predict the extent of length generalization for different tasks.

    “For example, we cannot precisely predict the extent of length generalization for different tasks.”
    Quote in the paperNot a substantial claim
  • May combine two claims.

    Findingown data

    Both forward and reverse addition with index hints demonstrate strong length generalization.

    “We see that both settings demonstrate strong length generalization, thus demonstrating the usefulness of the index hints.”
    Quote in the paperSubstantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing), S4 (based).

    Findingnone given

    Disallowing floating-point operations and unbounded numbers are not necessary for most symbolic programs.

    “Although disallowing floating-point operations and unbounded numbers may seem like a strong restriction, we find these are not necessary for most symbolic programs.”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing). May combine two claims.

    Findingnone given
    § shifts sequence x to the right by n positions return kqv(indices(x) + n, indices(x), x, equals, default=default)

    Models always output the start token as the first output, but do not always output the EoS token once the ending token has been outputted.

    “We see that models always output the start token as the first output, but do not always output the EoS token once the ending token has been outputted.”
    Quote in the paperNot a substantial claim
  • May combine two claims.

    Findingown data

    The main Easy Scratchpad optimizes much more quickly than the sum-mod-10 Hard Scratchpad, even though the easy scratchpad has much longer output sequences.

    “We see that the main scratchpad (”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing). May combine two claims.

    Findingnone given

    The paper's toy model is a mechanistic model and provides intuition for the RASP conjecture.

    “Our toy model is a mechanistic model and provides intuition for the RASP conjecture”
    Quote in the paperNot a substantial claim
  • The quote only partly states this claim.

    Findingown data
    § shifts sequence x to the right by n positions return kqv(indices(x) + n, indices(x), x, equals, default=default)

    No length generalization is observed for forward addition with index hints on hard carry examples of length 50.

    “No length generalization is observed.”
    Quote in the paperSubstantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Findingreasoning

    The paper's Main Conjecture is not fully formal.

    “We acknowledge that our Main Conjecture is not fully formal, because there are aspects we do not fully understand.”
    Quote in the paperNot a substantial claim
  • The quote only partly states this claim.

    Findingown data
    § shifts sequence x to the right by n positions return kqv(indices(x) + n, indices(x), x, equals, default=default)

    For parity with scratchpad on length 50, no runs show significant length generalization in this setting.

    “We see that no runs show significant length generalization in this setting.”
    Quote in the paperSubstantial claim
  • The quote only partly states this claim.

    Findingown data
    § shifts sequence x to the right by n positions return kqv(indices(x) + n, indices(x), x, equals, default=default)

    Most runs start to generalize perfectly on 50 digit addition once the training length is greater than 35 for parity with scratchpad.

    “Most runs start to generalize perfectly on 50 digit addition once the training length is greater than 35.”
    Quote in the paperNot a substantial claim
  • May combine two claims.

    Findingnone given
    § shifts sequence x to the right by n positions return kqv(indices(x) + n, indices(x), x, equals, default=default)

    A RASP-L program solves the counting task from the Introduction, along with an autoregressive Transformer that implements this program.

    “A RASP-L program that solves the counting task from the Introduction, along with an autoregressive Transformer that implements this program.”
    Quote in the paperSubstantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing), S4 (based). May combine two claims.

    Findingnone given

    RASP supports only deterministic outputs and binary attention masks.

    “Moreover, RASP supports only deterministic outputs and binary attention masks.”
    Quote in the paperNot a substantial claim
  • May combine two claims.

    Interpretationreasoning

    The next token can be generated by using an induction head on the current token, since all tokens are unique.

    “Thus, the next token can be generated by simply using an induction head on the current token, since all tokens are unique.”
    Quote in the paperSubstantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Premiseown data

    Induction heads are simple to implement in RASP-L.

    “Induction heads are simple to implement in RASP-L, as the induct function in Listing 3.”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S4 (based).

    Interpretationnone given

    If models trained in the simple setting can still exhibit non-trivial length generalization on a given task, then that task is amenable to generalization.

    “If models trained in this simple setting can still exhibit non-trivial length generalization on a given task, we can conclude that this task is amenable to generalization.”
    Quote in the paperNot a substantial claim
  • Classified as probably not a substantial claim.

    Interpretationreasoning

    With the mode scratchpad, the model must explicitly sort frequencies and convert them into decimal representations to produce its scratchpad.

    “Intuitively, instead of internally counting element-frequencies and outputting the maximum, the model must now explicitly sort the frequencies, and convert these into decimal representations to produce its scratchpad.”
    Quote in the paperSubstantial claim
  • May combine two claims.

    Interpretationreasoning

    Transformers can only update their internal state in very restricted ways, but they can update their external state (context) in much more powerful ways.

    “The intuition here is that Transformers can only update their internal state in very restricted ways -given by the structure of attentionbut they can update their external state (i.e.context) in much more powerful ways.”
    Quote in the paperSubstantial claim
  • Probably not a substantial claim: may not pass S4 (based).

    Interpretationnone given

    One forward-pass of a Transformer cannot directly simulate n sequential iterations of a loop.

    “fundamentally because one forward-pass of a Transformer cannot directly simulate n sequential iterations of the loop.”
    Quote in the paperNot a substantial claim
  • May combine two claims.

    Interpretationreasoning

    In copy with repeating tokens, the model must perform precise index-arithmetic, which is prohibited under RASP-L.

    “Instead, the model must perform precise index-arithmetic, which are prohibited under RASP-L.”
    Quote in the paperSubstantial claim
  • May combine two claims.

    Interpretationnone given

    The intuition that it is easier to represent boolean conjunction, and the experimental result, does not hold for MLPs; it is specific to the Transformer architecture.

    “Notably, this intuition (and indeed, the experimental result) does not hold for MLPs; it is specific to the Transformer architecture.”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S4 (based). May combine two claims.

    Study design and conductnone given

    Packing and shifting the context allows all positional embeddings to be trained and encourages the Transformer to treat all positions symmetrically.

    “It is an important detail: packing and shifting the context allows all positional embeddings to be trained, and encourages the transformer to treat all positions symmetrically.”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing). May combine two claims.

    Interpretationreasoning

    Learning to ignore the last 5 bits would have been possible, but is an additional complication, and does not help in fitting the train set.

    “Learning to ignore the last 5 bits would have been possible, but is an additional complication, and does not help in fitting the train set in any case.”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S4 (based). May combine two claims.

    Interpretationreasoning

    Simplicity implies realizability, because being able to write a RASP-L program for a task guarantees realizability.

    “Simplicity implies realizability, as being able to come up with a RASP-L program for a task guarantees realizability.”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Premisereasoning

    The original RASP allows for certain operations which are possible to represent but not easy to represent or learn.

    “The original RASP technically allows for certain operations which are possible to represent, but not”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing), S4 (based). May combine two claims.

    Study design and conductreasoning

    Training in the online setting avoids overfitting issues and is closer to the training of modern LLMs.

    “We train in the online setting, where each batch is sampled iid from the train distribution instead of from a finite train set -this avoids overfitting issues, and is closer to the training of modern LLMs.”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S2 (checkable), S3 (load-bearing).

    Interpretationcitation

    It may be difficult to find the minimum RASP-L program for a task for similar reasons that Kolmogorov complexity is uncomputable.

    “intuitivly, it may be difficult to find the minimum RASP-L program for a task for similar reasons that Kolmogorov complexity is uncomputable (Kolmogorov, 1963).”
    Quote in the paperNot a substantial claim0 of 1 sources checked
    • cites Kolmogorov, 1963

      Couldn’t be matched to a paper in Crossref, so it can’t be checked.

  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Study design and conductnone given

    For the mode task, if there is a tie for the most frequent element, randomly selecting a token from one set and changing it to a token from the other set ensures that there is one unique answer.

    “If there is a tie for the most frequent element, we randomly select a token from one set and changes it to a token from the other set, thus ensuring that there is one unique answer.”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Interpretationnone given

    It is theoretically possible to reduce error-propagation in length generalization by scaling up data, model, train time, and other axes.

    “However, it is theoretically possible to reduce the error-propogation by”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Interpretationreasoning

    There are likely even stronger computational restrictions on RASP programs than on generic Transformers.

    “we observe that there are likely even stronger computational restrictions on RASP programs than on generic Transformers”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Interpretationreasoning

    The linear-time limitation may not apply to RASP-L because RASP-L allows max/min aggregation types that require softmax to implement.

    “This limitation technically may not apply to RASP-L, since we allow for”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Interpretationreasoning

    RASP programs can only solve tasks where the next-token function can be computed in linear time, as opposed to the O(n^2) upper bound on generic Transformers.

    “Thus, RASP programs can only solve tasks where the next-token function can be computed in linear-time (as opposed to the O(n 2 ) upper bound on generic Transformers).”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Premisecitation

    RNNs tend to length generalize on tasks equivalent to regular languages, like Parity.

    “For example, it is well-known that RNNs tend to length generalize on tasks equivalent to regular languages, like Parity (e.g.Delétang et al. (2023)).”
    Quote in the paperNot a substantial claim0 of 1 sources checked
    • cites Delétang et al. (2023)

      Couldn’t be matched to a paper in Crossref, so it can’t be checked.

  • May combine two claims.

    Interpretationnone given

    Certain programs have complex computational graphs when written in C to run on a CPU, such as sorting algorithms, but have much simpler computational graphs when written in RASP to run on a Transformer, and vice versa.

    “certain programs have complex computational graphs when written in C, to run on a CPU (such as sorting algorithms), but have much simpler computational graphs when written in RASP, to run on a Transformer -and vice versa.”
    Quote in the paperSubstantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Interpretationreasoning

    The sum-mod-10 scratchpad is still simpler than parity without any scratchpad because it helps simplify the final operation of getting the parity of the sum.

    “However, it is still simpler than parity without any scratchpad because it helps to simplify the final operation of getting the parity of the sum.”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Premisenone given
    § shifts sequence x to the right by n positions return kqv(indices(x) + n, indices(x), x, equals, default=default)

    The exact set of functions representable by Transformers depends on definitional details such as finite versus infinite precision and bounded versus unbounded weights.

    “Note that the exact set of which functions are representable depends on certain definitional details of Transformers such as finite vs. infinite precision, bounded vs. unbounded weights, etc, which is why some of these references arrive at different conclusions.”
    Quote in the paperNot a substantial claim
  • May combine two claims.

    Interpretationreasoning
    § shifts sequence x to the right by n positions return kqv(indices(x) + n, indices(x), x, equals, default=default)

    The scratchpad hurts in the mode setting, both final answer accuracy and exact match, since it is not computable by a short RASP-L program.

    “The scratchpad hurts in this setting (both final answer accuracy and exact match), since it is not computable by a short RASP-L program.”
    Quote in the paperSubstantial claim
  • May combine two claims.

    Interpretationreasoning

    The model learns the correct RASP-L program and generalizes because of it.

    “This lends credence to the intuition that the model learns the correct RASP-L program and generalizes because of it.”
    Quote in the paperSubstantial claim
  • Classified as probably not a substantial claim. May combine two claims.

    Interpretationreasoning

    The int8 constraint handles issues with both infinite-precision and learnability of tokenwise operations.

    “This constraint handles issues with both infinite-precision and with learnability of the tokenwise operations (since all tokenwise functions now have small finite domains and co-domains, int8 → int8, and so can be easily memorized).”
    Quote in the paperSubstantial claim
  • Probably not a substantial claim: may not pass S2 (checkable), S3 (load-bearing), S4 (based).

    Interpretationnone given

    The paper's conjecture has more predictive power than many prior theories.

    “Nonetheless, we view our conjecture as a step forward in understanding the implicit bias of Transformers, as it has more predictive power than many prior theories.”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S4 (based). May combine two claims.

    Interpretationnone given

    The Transformer must learn the same program to predict the first output digit as for the second and third output digits, and the simplest such program to represent for a Transformer treats all digits symmetrically.

    “From our perspective, one potential way to understand this is that the Transformer must learn the same program to predict the first output digit as for the second and third output digits, and the”
    Quote in the paperNot a substantial claim
  • May combine two claims.

    Premisenone given

    RASP programs can be compiled into standard Transformers and also into linear-attention Transformers by essentially the same construction.

    “RASP programs can be compiled into standard Transformers, but they can also be compiled into”
    Quote in the paperNot a substantial claim
  • May combine two claims.

    Interpretationreasoning

    The sum-mod-10 scratchpad does not simplify the parity problem as much as the previous scratchpad because it does not leverage autoregressive inference to process the task sequentially and relies on a more complicated sum operation.

    “This scratchpad does not simplify the problem as much as the previous one, because it does not leverage the autoregressive inference of the Transformer to process the task sequentially, and instead relying on a more complicated sum operation.”
    Quote in the paperNot a substantial claim
62 of 62
  • The authors state this as an assumption.

    In-distribution generalization is achieved nearly-optimally.

    “we assume that in-distribution generalization is achieved nearly-optimally, and focus our attention on the induced out-of-distribution generalization.”
  • The paper relies on this without support.

    Length generalization on algorithmic tasks is a measure of how well language models can learn to reason.

    “We adopt the approach of recent studies and focus on length generalization on algorithmic tasks as a measure of how well language models can learn to reason (Nogueira et al., 2021;Kim et al., 2021;Anil et al., 2022;Lee et al., 2023;Dziri et al., 2023;Welleck et al., 2022;Liu et al., 2023).”
  • The paper relies on this without support.

    The standard addition algorithm requires the carry value to be propagated in reverse order from least- to most-significant digit.

    “This algorithm requires the carry value to be propagated in reverse order from least-to most-significant digit”
  • The paper relies on this without support.

    The standard addition algorithm requires index-arithmetic and precise indexing operations.

    “The standard addition algorithm requires index-arithmetic (e.g.finding the middle of the prompt sequence) and precise indexing operations (e.g.look up the corresponding summand digits for the current output digit).”
  • The paper relies on this without support.

    The natural algorithm for parity is to run a finite-state-machine for n steps, keeping the running parity of prior bits as state.

    “The natural algorithm for parity on n is to run a finite-state-machine for n steps, keeping the runningparity of prior bits as state.”
  • The paper relies on this without support.

    Uniformly random summands will only produce addition instances with short carry-chains in expectation.

    “However, uniformly random summands will only produce addition instances with short carry-chains (in expectation)”
  • The paper relies on this without support.

    The natural algorithm for parity is to iterate through all input tokens, updating some internal state along the way.

    “The natural algorithm for parity is to iterate through all input tokens, updating some internal state along the way.”
  • The paper relies on this without support.

    The natural algorithm for mode is to calculate the counts of each unique token in the sequence, then output the token with the maximum count.

    “A natural algorithm one might come up with is to calculate the counts of each unique token in the sequence, then output the token with the maximum count.”
  • The authors state this as an assumption.

    Simple-to-represent programs are more likely to be learned.

    “The RASP Generalization Conjecture suggests that simple-to-represent programs are also more likely to be learned.”
  • The authors state this as an assumption.

    The pairsums has first element 0.

    “NOTE: assumes the pairsums has first element 0”
10 of 10

Self-check

Percentages, sums and reported differences re-computed from the paper’s own numbers.

Each contradiction between two passages listed here was confirmed by an independent check.

  • Counting prompts disagree about the separator token

    Minor

    The task definition includes a `>` token after the two numbers, but the prompt used to illustrate its RASP-L program omits it. This changes which token the program must follow with the first output number.

  • Listed argmax calls kqv without its required predicate

    Minor

    The RASP-L library's `argmax` implementation omits the `pred` argument required by the stated `kqv` signature. As printed, this call cannot run, although the mode program uses `argmax`.

2 of 2

Cites

Flagged first, then by citations

Research works printed but not linked: 4

  1. Sanjeev Arora and Boaz Barak. Computational complexity: a modern approach. Cambridge Univer- sity Press, 2009.
  2. Aitor Lewkowycz, Anders Andreassen, David Martin Dohan, Ethan S Dyer, Henryk Michalewski, Vinay Ramasesh, Ambrose Slone, Cem Anil, Imanol Schlag, Theo Gutman-Solo, Yuhuai Wu, Behnam Neyshabur, Guy Gur-Ari, and Vedant Misra. Solving quantitative reasoning problems with language models. 2022b. URL https://arxiv.org/abs/2206.14858. · arXiv
  3. Jorge Pérez, Pablo Barceló, and Javier Marinkovic. Attention is turing complete. The Journal of Machine Learning Research, 22(1):3463-3497, 2021.
  4. Shai Shalev-Shwartz and Shai Ben-David. Understanding machine learning: From theory to algo- rithms. Cambridge university press, 2014.

Cited by

Sorted by citations

Authors
Zhou, H., Bradley, A., Littwin, E., Razin, N., Saremi, O., Susskind, J., Bengio, S., & Nakkiran, P.
Affiliations
  • Université de Montréal (CA)
  • Tel Aviv University (IL)
Venue
arXiv
Publisher
arXiv
Published
2023
ISSN
2331-8422 (ISSN-L)
OpenAlex
W4387947637
Cited by
10
References
62
Citations by year
2026: 3 · 2025: 5 · 2024: 2
Type
posted content
Language
en
Open access
Locations
  • arXiv (Cornell University) (submittedVersion)
  • arXiv (Cornell University)
Topics
  • Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
  • Physical Sciences › Computer Science › Computational Theory and Mathematics › Computability, Logic, AI Algorithms
  • Physical Sciences › Computer Science › Artificial Intelligence › Natural Language Processing Techniques
Keywords
length generalization, transformer models, RASP, compositional generalization, parity, addition, out-of-distribution generalization, large language models, emergent capabilities

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

Claims read by deepseek-v4.1-flash under definition version 3 (extract-v3) on 2026-10-23.

Classified by jev-1.13-20260917 (gold-guideline-v0.2) on 2026-10-23.

Cited sources are checked by gpt-6-sol.

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review