用前向传播分离模型数学能力,不伤及语言其他功能
Math Neurosurgery: Isolating Language Models' Math Reasoning Abilities Using Only Forward Passes
- 仅通过前向传播分析参数重要性,筛选出专用于数学的权重
- 删掉这些参数后数学能力下降但语言能力基本不变,放大则提升4-35%
- 只需一个样本即可定位关键参数,适合高效干预与可解释性研究
数学推理是大语言模型研究的热点,因其代表人工智能的关键能力,并在数学教育等领域具应用价值。然而,少有研究探讨数学推理如何编码于模型参数中,以及能否将其从模型中分离。本文提出Math Neurosurgery(MathNeuro),一种仅使用前向传播的计算高效方法,用于识别并隔离大语言模型中的数学专用参数。该方法基于权重与激活计算参数重要性,通过过滤对通用语言任务重要的参数,保留仅服务于数学推理的部分。实验表明,移除这些参数会显著削弱模型数学能力,但不影响其通用语言表现;而将这些参数按小常数缩放,可使预训练或指令微调模型在GSM8K上提升4%-17%,在MATH上提升5%-35%。此外,该方法数据效率高,仅需单个样本即可有效定位数学相关参数,为未来针对数学能力的精准干预提供可能。
原文摘要 · Abstract (English)
Math reasoning is an active area of Large Language Model (LLM) research because it is a hallmark of artificial intelligence and has implications in several domains, including math education. However, few works have explored how math reasoning is encoded within LLM parameters and if it is a skill that can be isolated within models. Doing so could allow targeted intervention to improve math performance without altering non-math behavior and foster understanding of how models encode math reasoning. We introduce Math Neurosurgery (MathNeuro), a computationally efficient method we use to isolate math-specific parameters in LLMs using only forward passes. MathNeuro builds on existing work by using weights and activations to calculate parameter importance, but isolates math-specific parameters by filtering out those important for general language tasks. Through pruning parameters MathNeuro identifies, we delete a LLM's math reasoning ability without significantly impacting its general language ability. Scaling the identified parameters by a small constant improves a pretrained or instruction-tuned LLM's performance by 4-17% on GSM8K and 5-35% on MATH while leaving non-math behavior unaltered. MathNeuro is also data efficient: most of its effectiveness holds when identifying math-specific parameters using a single sample. MathNeuro highlights the potential for future work to intervene on math-specific parameters.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。