让小模型也能高效完成数学逻辑推理任务
Improving Small-Scale Large Language Models Function Calling for Reasoning Tasks
- 用小模型模拟大模型的函数调用推理链生成数据
- 通过人类偏好优化训练,小模型推理准确率提升显著
- 适合资源有限但需精准推理的应用场景
近期大型语言模型在自然语言理解与生成方面展现出卓越能力,但在数学问题求解和逻辑推理方面仍存在挑战。为此,研究者探索了函数调用能力,使模型能执行预定义函数并利用其输出完成任务。然而,大规模模型在特定任务上效率低下,因训练与推理阶段计算开销巨大。本文提出一种新框架,专为小型语言模型设计函数调用能力,聚焦于逻辑与数学推理任务。该方法通过一个智能体,将可调用函数描述与示例注入提示,逐步构建推理链,并利用大模型生成正确与错误的推理链对话数据。这些数据用于训练小型模型,采用基于人类反馈的强化学习(RLHF)中的直接偏好优化(DPO)技术。实验表明,该方法在模型规模与性能之间取得良好平衡,显著提升了小模型在函数调用推理任务上的表现。
原文摘要 · Abstract (English)
Recent advancements in Large Language Models (LLMs) have demonstrated exceptional capabilities in natural language understanding and generation. While these models excel in general complex reasoning tasks, they still face challenges in mathematical problem-solving and logical reasoning. To address these limitations, researchers have explored function calling abilities, allowing LLMs to execute provided functions and utilize their outputs for task completion. However, concentrating on specific tasks can be very inefficient for large-scale LLMs to be used, because of the expensive cost of training and inference stages they need in terms of computational resources. This study introduces a novel framework for training smaller language models in function calling, focusing on specific logical and mathematical reasoning tasks. The approach aims to improve performances of small-scale models for these tasks using function calling, ensuring a high level of accuracy. Our framework employs an agent that, given a problem and a set of callable functions, queries the LLM by injecting a description and examples of the usable functions into the prompt and managing their calls in a step-by-step reasoning chain. This process is used to create a dataset of correct and incorrect reasoning chain chat completions from a large-scale LLM. This dataset is used to train a smaller LLM using Reinforcement Learning from Human Feedback (RLHF), specifically employing the Direct Preference Optimization (DPO) technique. Experimental results demonstrate how the proposed approach balances the trade-off between model size and performance, improving the ability of function calling for reasoning tasks, in smaller models.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。