Lune

ICLR2024顶会

What Algorithms can Transformers Learn? A Study in Length Generalization

Hattie Zhou, Arwen Bradley, Etai Littwin, Noam Razin, Omid Saremi, Joshua Susskind, Samy Bengio, Preetum Nakkiran

摘要

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.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 98 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation 引用了 Language Models are Few-Shot Learners
  • Mechanistically analyzing the effects of fine-tuning on procedurally defined tasks 引用了 Language Models are Few-Shot Learners
  • The Alignment Problem from a Deep Learning Perspective 引用了 Language Models are Few-Shot Learners
  • Solving Quantitative Reasoning Problems with Language Models 引用了 Language Models are Few-Shot Learners
  • Solving Quantitative Reasoning Problems with Language Models 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • Repeat After Me: Transformers are Better than State Space Models at Copying 引用了 Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
  • Repeat After Me: Transformers are Better than State Space Models at Copying 引用了 Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation
  • Repeat After Me: Transformers are Better than State Space Models at Copying 引用了 Language Models are Few-Shot Learners
  • Repeat After Me: Transformers are Better than State Space Models at Copying 引用了 Can Mamba Learn How To Learn? A Comparative Study on In-Context Learning Tasks
  • Can Mamba Learn How To Learn? A Comparative Study on In-Context Learning Tasks 引用了 Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
  • Can Mamba Learn How To Learn? A Comparative Study on In-Context Learning Tasks 引用了 Language Models are Few-Shot Learners
  • CRUXEval: A Benchmark for Code Reasoning, Understanding and Execution 引用了 Language Models are Few-Shot Learners
  • CRUXEval: A Benchmark for Code Reasoning, Understanding and Execution 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper98

  1. The Alignment Problem from a Deep Learning PerspectiveRichard Ngo, Lawrence Chan, Sören MindermannICLR 2024 · 296 次引用
  2. CRUXEval: A Benchmark for Code Reasoning, Understanding and ExecutionAlex Gu, Baptiste Rozière, Hugh James Leather, Armando Solar-Lezama 等ICML 2024 · 270 次引用
  3. Repeat After Me: Transformers are Better than State Space Models at CopyingSamy Jelassi, David Brandfonbrener, Sham M. Kakade, Eran MalachICML 2024 · 176 次引用
  4. Can Mamba Learn How To Learn? A Comparative Study on In-Context Learning TasksJongho Park, Jaeseung Park, Zheyang Xiong, Nayoung Lee 等ICML 2024 · 124 次引用
  5. Mechanistically analyzing the effects of fine-tuning on procedurally defined tasksSamyak Jain, Robert Kirk, Ekdeep Singh Lubana, Robert P. Dick 等ICLR 2024 · 108 次引用

它引用的 Paper29

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
  2. Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma 等NeurIPS 2022 · 22,562 次引用
  3. Transformers are RNNs: Fast Autoregressive Transformers with Linear AttentionAngelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, François FleuretICML 2020 · 2,665 次引用
  4. Solving Quantitative Reasoning Problems with Language ModelsAitor Lewkowycz, Anders Andreassen, David Dohan, Ethan Dyer 等NeurIPS 2022 · 2,039 次引用
  5. Train Short, Test Long: Attention with Linear Biases Enables Input Length ExtrapolationOfir Press, Noah A. Smith, Mike LewisICLR 2022 · 1,168 次引用

相关 Paper

  1. Discovering Interpretable Algorithms by Decompiling Transformers to RASPXinting Huang, Aleksandra Bakalova, Satwik Bhattamishra, William Merrill 等ICML 2026 · 3 次引用
  2. Looped Transformers for Length GeneralizationYing Fan, Yilun Du, Kannan Ramchandran, Kangwook LeeICLR 2025
  3. Length Generalization Bounds for TransformersAndy Yang, Pascal Bergsträßer, Georg Zetzsche, David Chiang 等ICML 2026
  4. Universal Length Generalization with Turing ProgramsKaiying Hou, David Brandfonbrener, Sham M. Kakade, Samy Jelassi 等ICML 2025
  5. Thinking Like TransformersGail Weiss, Yoav Goldberg, Eran YahavICML 2021 · 183 次引用
黄昏的海面,两侧是细线勾勒的悬崖