ChatPaper.aiChatPaper

소형 트랜스포머에 산술 가르치기

Teaching Arithmetic to Small Transformers

July 7, 2023
저자: Nayoung Lee, Kartik Sreenivasan, Jason D. Lee, Kangwook Lee, Dimitris Papailiopoulos
cs.AI

초록

GPT-4와 같은 대규모 언어 모델은 광범위한 텍스트 데이터에 대해 훈련될 때, 비지도 방식의 다음 토큰 예측 목표로 명시적으로 인코딩되지 않은 기본 산술과 같은 일반적인 작업에서도 새로운 능력을 나타냅니다. 본 연구는 무작위 초기화부터 훈련된 소형 트랜스포머가 다음 토큰 예측 목표를 사용하여 덧셈, 곱셈 및 제곱근과 같은 기본 함수와 같은 산술 연산을 어떻게 효율적으로 학습할 수 있는지 조사합니다. 먼저, 기존의 훈련 데이터가 산술 학습에 가장 효과적이지 않으며, 간단한 형식 변경이 정확도를 크게 향상시킬 수 있음을 보여줍니다. 이는 훈련 데이터 규모에 따른 급격한 위상 전환을 초래하며, 경우에 따라 저순위 행렬 완성과의 연결을 통해 설명될 수 있습니다. 선행 연구를 바탕으로, 중간 단계 결과를 포함하는 사고 사슬(chain-of-thought) 스타일의 데이터에 대해 훈련합니다. 사전 훈련이 전혀 없는 경우에도 이 접근 방식은 정확도, 샘플 복잡성 및 수렴 속도를 동시에 크게 향상시킵니다. 또한, 훈련 중 산술과 텍스트 데이터 간의 상호작용을 연구하고, 소수 샷 프롬프팅, 사전 훈련 및 모델 규모의 영향을 검토합니다. 추가적으로, 길이 일반화 문제에 대해서도 논의합니다. 본 연구는 다음 단어 예측 목표의 특성을 고려한 고품질의 교육적 데이터가 산술 능력을 빠르게 이끌어내는 데 중요함을 강조합니다.
English
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.
PDF180December 15, 2024