arXiv:2410.02167cs.LGcs.CL2024-10ICLR被引 17

首次理论分析非线性Transformer训练实现链式思考推理能力

Training Nonlinear Transformers for Chain-of-Thought Inference: A Theoretical Generalization Analysis

  • 构建非线性注意力Transformer的训练理论框架
  • 证明模型在未见任务上仍具泛化能力,支持分布外测试
  • 揭示含噪声示例下仍可准确推理的条件,优于单步上下文学习

链式思考(CoT)是一种通过添加多步中间推理示例来增强大语言模型推理能力的有效提示方法。尽管实证效果显著,但如何训练具有非线性注意力的Transformer以获得CoT泛化能力的理论理解仍不充分,主要受限于非凸优化在非线性注意力模型中的分析难度。本文首次对非线性注意力Transformer的训练进行理论研究,量化了实现CoT能力所需的训练样本数与迭代次数。进一步证明,该模型在输入包含新任务示例时,可在分布外测试数据上成功实现CoT泛化。此外,理论还刻画了当推理示例存在噪声且不完全准确时,仍能生成正确输出的条件。相比之下,作为无中间步骤的单步链式思考,上下文学习(ICL)可能在CoT有效时失效。实验验证了上述理论发现。

原文摘要 · Abstract (English)

Chain-of-Thought (CoT) is an efficient prompting method that enables the reasoning ability of large language models by augmenting the query using multiple examples with multiple intermediate steps. Despite the empirical success, the theoretical understanding of how to train a Transformer to achieve the CoT ability remains less explored. This is primarily due to the technical challenges involved in analyzing the nonconvex optimization on nonlinear attention models. To the best of our knowledge, this work provides the first theoretical study of training Transformers with nonlinear attention to obtain the CoT generalization capability so that the resulting model can inference on unseen tasks when the input is augmented by examples of the new task. We first quantify the required training samples and iterations to train a Transformer model towards CoT ability. We then prove the success of its CoT generalization on unseen tasks with distribution-shifted testing data. Moreover, we theoretically characterize the conditions for an accurate reasoning output by CoT even when the provided reasoning examples contain noises and are not always accurate. In contrast, in-context learning (ICL), which can be viewed as one-step CoT without intermediate steps, may fail to provide an accurate output when CoT does. These theoretical findings are justified through experiments.

链式思考Transformer理论分析泛化能力

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。