Tokenization counts: the impact of tokenization on arithmetic in frontier LLMs
作者: Aaditya K. Singh, DJ Strouse
分类: cs.CL, cs.LG
发布日期: 2024-02-22
备注: 21 pages, 18 figures
💡 一句话要点
研究数字标记化对前沿LLM算术性能的影响
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 数字标记化 大型语言模型 算术推理 推理能力 模型性能
📋 核心要点
- 现有LLM在数字推理任务中对标记化的选择缺乏系统研究,可能导致性能不佳。
- 本文提出通过比较左向和右向标记化对算术任务的影响,探索数字标记化的最佳实践。
- 实验结果表明,右向标记化显著提升了模型性能,且模型能够有效转换标记化方式。
📝 摘要(中文)
标记化,即将输入文本划分为输入标记,是大型语言模型(LLM)流程中常被忽视的一个方面,可能是有用或有害的归纳偏差来源。本文研究了数字标记化选择对算术推理的影响,发现右向标记化在性能上显著优于左向标记化,并揭示了模型在使用标准左向标记化时的错误模式具有系统性。我们希望本研究能激励实践者在构建数字推理模型时更仔细地考虑与数字标记化相关的选择。
🔬 方法详解
问题定义:本文旨在解决数字标记化对大型语言模型在算术推理任务中性能的影响,现有方法在标记化选择上缺乏针对性,可能导致系统性错误。
核心思路:通过比较左向和右向标记化的效果,探讨不同标记化方案对模型推理能力的影响,特别是在数字处理方面。
技术框架:研究采用了GPT-3.5和GPT-4模型,分别实施左向和右向标记化,分析其在算术任务中的表现差异。主要模块包括标记化方案的设计、模型推理过程的比较及错误模式分析。
关键创新:首次系统研究数字标记化选择如何影响模型在算术任务上的表现,揭示了标记化方向对模型性能的显著影响。
关键设计:在实验中,采用了逗号分隔数字的右向标记化方式,并分析了模型在不同标记化下的错误模式,发现错误呈现出系统性而非随机性。实验还表明,随着模型规模的增大,标记化方向的性能差距有所缩小。
🖼️ 关键图片
📊 实验亮点
实验结果显示,右向标记化在算术任务中的性能显著优于左向标记化,尤其是在处理多位数字时。具体而言,右向标记化的模型在多个算术任务中表现出更高的准确率,错误模式也更为系统化,表明模型计算的可预测性。
🎯 应用场景
该研究的潜在应用领域包括自然语言处理中的数字推理、教育技术中的自动评分系统以及金融数据分析等。通过优化标记化策略,可以提升模型在处理数字信息时的准确性和效率,具有重要的实际价值和未来影响。
📄 摘要(原文)
Tokenization, the division of input text into input tokens, is an often overlooked aspect of the large language model (LLM) pipeline and could be the source of useful or harmful inductive biases. Historically, LLMs have relied on byte pair encoding, without care to specific input domains. With the increased use of LLMs for reasoning, various number-specific tokenization schemes have been adopted, with popular models like LLaMa and PaLM opting for single-digit tokenization while GPT-3.5 and GPT-4 have separate tokens for each 1-, 2-, and 3-digit numbers. In this work, we study the effect this choice has on numerical reasoning through the use of arithmetic tasks. We consider left-to-right and right-to-left tokenization for GPT-3.5 and -4, finding that right-to-left tokenization (enforced by comma separating numbers at inference time) leads to largely improved performance. Furthermore, we find that model errors when using standard left-to-right tokenization follow stereotyped error patterns, suggesting that model computations are systematic rather than approximate. We show that the model is able to convert between tokenizations easily, thus allowing chain-of-thought-inspired approaches to recover performance on left-to-right tokenized inputs. We also find the gap between tokenization directions decreases when models are scaled, possibly indicating that larger models are better able to override this tokenization-dependent inductive bias. In summary, our work performs the first study of how number tokenization choices lead to differences in model performance on arithmetic tasks, accompanied by a thorough analysis of error patterns. We hope this work inspires practitioners to more carefully ablate number tokenization-related choices when working towards general models of numerical reasoning.