arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2403.09629cs.CLcs.AIcs.LG
收藏

Quiet-STaR:语言模型可以在开口前自我思考

Quiet-STaR: Language Models Can Teach Themselves to Think Before Speaking

Stanford University(斯坦福大学);Notbad AI Inc(Notbad AI公司)

Eric Zelikman, Georges Harik, Yijia Shao, Varuna Jayasiri, Nick Haber, Noah D. Goodman

AI总结:

Quiet-STaR通过在每个标记处生成理由来泛化STaR,使语言模型在任意文本中学习推理,从而在无需微调的情况下提升零样本问答性能。

摘要:

在写作和交谈时,人们有时会停下来思考。尽管以推理为重点的工作通常将推理视为回答问题或完成智能体任务的方法,但推理几乎隐含在所有书面文本中。例如,这适用于证明中行间未陈述的步骤,或对话背后的心理理论。在自教推理器(STaR,Zelikman等人,2022)中,通过从问答中的少量示例推断理由,并从那些导致正确答案的理由中学习,从而习得有用的思考。这是一个高度受限的设置——理想情况下,语言模型可以学会在任意文本中推断未陈述的理由。我们提出了Quiet-STaR,这是STaR的一种泛化,其中语言模型在每个标记处生成理由以解释未来文本,从而改进其预测。我们解决了关键挑战,包括:1)生成连续内容的计算成本;2)语言模型最初不知道如何生成或使用内部思考;3)需要预测超出单个下一个标记的范围。为了解决这些问题,我们提出了一种逐标记并行采样算法,使用可学习的标记指示思考的开始和结束,以及一种扩展的教师强制技术。令人鼓舞的是,生成的理由不成比例地帮助模型预测难以预测的标记,并提高了语言模型直接回答难题的能力。特别是,在使用Quiet-STaR对互联网文本语料库上的语言模型进行持续预训练后,我们发现GSM8K(5.9%→10.9%)和CommonsenseQA(36.3%→47.2%)上的零样本改进,并观察到自然文本中困难标记的困惑度改善。至关重要的是,这些改进无需对这些任务进行微调。Quiet-STaR标志着语言模型朝着更通用和可扩展的学习推理方式迈出了一步。

英文摘要:

When writing and talking, people sometimes pause to think. Although reasoning-focused works have often framed reasoning as a method of answering questions or completing agentic tasks, reasoning is implicit in almost all written text. For example, this applies to the steps not stated between the lines of a proof or to the theory of mind underlying a conversation. In the Self-Taught Reasoner (STaR, Zelikman et al. 2022), useful thinking is learned by inferring rationales from few-shot examples in question-answering and learning from those that lead to a correct answer. This is a highly constrained setting -- ideally, a language model could instead learn to infer unstated rationales in arbitrary text. We present Quiet-STaR, a generalization of STaR in which LMs learn to generate rationales at each token to explain future text, improving their predictions. We address key challenges, including 1) the computational cost of generating continuations, 2) the fact that the LM does not initially know how to generate or use internal thoughts, and 3) the need to predict beyond individual next tokens. To resolve these, we propose a tokenwise parallel sampling algorithm, using learnable tokens indicating a thought's start and end, and an extended teacher-forcing technique. Encouragingly, generated rationales disproportionately help model difficult-to-predict tokens and improve the LM's ability to directly answer difficult questions. In particular, after continued pretraining of an LM on a corpus of internet text with Quiet-STaR, we find zero-shot improvements on GSM8K (5.9%$\rightarrow$10.9%) and CommonsenseQA (36.3%$\rightarrow$47.2%) and observe a perplexity improvement of difficult tokens in natural text. Crucially, these improvements require no fine-tuning on these tasks. Quiet-STaR marks a step towards LMs that can learn to reason in a more general and scalable way.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑