paper-with-me

홈 › Papers

Teaching Arithmetic to Small Transformers

2023-07-07 · Nayoung Lee, Kartik Sreenivasan, Jason D. Lee, Kangwook Lee, Dimitris Papailiopoulos

Large language models like GPT-4 exhibit emergent capabilities across general-purpose tasks, such as basic arithmetic, when trained on extensive text data, even though these tasks are not explicitly encoded by the unsupervised, next-token prediction objective. This study investigates how small transformers, trained from random initialization, can efficiently learn arithmetic operations such as addition, multiplication, and elementary functions like square root, using the next-token prediction objective. We first demonstrate that conventional training data is not the most effective for arithmetic learning, and simple formatting changes can significantly improve accuracy. This leads to sharp phase transitions as a function of training data scale, which, in some cases, can be explained through connections to low-rank matrix completion. Building on prior work, we then train on chain-of-thought style data that includes intermediate step results. Even in the complete absence of pretraining, this approach significantly and simultaneously improves accuracy, sample complexity, and convergence speed. We also study the interplay between arithmetic and text data during training and examine the effects of few-shot prompting, pretraining, and model scale. Additionally, we discuss length generalization challenges. Our work highlights the importance of high-quality, instructive data that considers the particular characteristics of the next-word prediction objective for rapidly eliciting arithmetic capabilities.

📄 PDF Abstract BibTeX arXiv:2307.03381

Code (1)

lee-ny/teaching_arithmetic 공식 구현 pytorch

Tasks

Low-Rank Matrix CompletionMatrix Completion

Methods 이 논문이 사용한 방법론

Multi-Head Attention 설명 없음
Attention 설명 없음
Linear Layer A Linear Layer is a projection $\mathbf{XW + b}$.
Adam 설명 없음
Dense Connections Dense Connections, or Fully Connected Connections, are a type of layer in a deep neural network that use a linear operation where every input is connected to every output…
Softmax The Softmax output function transforms a previous layer's output into a vector of probabilities. It is commonly used for multiclass classification. Given an input vector $x$…
Position-Wise Feed-Forward Layer 설명 없음
Label Smoothing Label Smoothing is a regularization technique that introduces noise for the labels. This accounts for the fact that datasets may have mistakes in them, so maximizing the…

Similar Papers 제목 키워드 기반

Teaching Transformers Modular Arithmetic at Scale

2024-10-04 · Eshika Saxena, Alberto Alfarano, Emily Wenger, Kristin Lauter

Modular addition is, on its face, a simple operation: given $N$ elements in $\mathbb{Z}_q$, compute their sum modulo $q$. Yet, scalable machine learning solutions to this problem remain elusive: prior work trains ML mode…

Cryptanalysis

Self-supervised Models are Good Teaching Assistants for Vision Transformers

2021-09-29 · Haiyan Wu, Yuting Gao, Ke Li, Yinqi Zhang 외

Transformers have shown remarkable progress on computer vision tasks in the past year. Compared to their CNN counterparts, transformers usually need the help of distillation to achieve comparable results on middle or sma…

Image ClassificationKnowledge Distillation

Positional Description Matters for Transformers Arithmetic

2023-11-22 · Ruoqi Shen, Sébastien Bubeck, Ronen Eldan, Yin Tat Lee 외

Transformers, central to the successes in modern Natural Language Processing, often falter on arithmetic tasks despite their vast capabilities --which paradoxically include remarkable coding abilities. We observe that a …

Memorization

How Numerical Precision Affects Mathematical Reasoning Capabilities of LLMs

2024-10-17 · Guhao Feng, Kai Yang, Yuntian Gu, Xinyue Ai 외

Despite the remarkable success of Transformer-based Large Language Models (LLMs) across various domains, understanding and enhancing their mathematical capabilities remains a significant challenge. In this paper, we cond…

Mathematical Reasoning

Toward In-Context Teaching: Adapting Examples to Students' Misconceptions

2024-05-07 · Alexis Ross, Jacob Andreas

When a teacher provides examples for a student to study, these examples must be informative, enabling a student to progress from their current state toward a target concept or skill. Good teachers must therefore simultan…

Misconceptions