PARAMANU-GANITA: Can Small Math Language Models Rival with Large Language Models on Mathematical Reasoning?

📄 arXiv: 2404.14395v2 📥 PDF

作者: Mitodru Niyogi, Arnab Bhattacharya

分类: cs.CL, cs.AI, cs.LG

发布日期: 2024-04-22 (更新: 2025-03-05)

🔗 代码/项目: HUGGINGFACE


💡 一句话要点

提出Paramanu-Ganita以解决小型数学语言模型的推理能力问题

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 数学推理 生成语言模型 链式思维 领域特定预训练 模型微调 环境可持续性 小型模型

📋 核心要点

  1. 现有的大型语言模型在数学推理方面表现优异,但其训练成本高且环境影响大。
  2. 论文提出了Paramanu-Ganita,通过领域特定的预训练和CoT微调,旨在提高小型模型的数学推理能力。
  3. 实验结果表明,Paramanu-Ganita在多个数学基准测试中超越了大型模型,显示出显著的性能提升。

📝 摘要(中文)

本文研究了小型生成语言模型(SLM)在数学推理方面的表现,特别是通过领域特定的预训练和链式思维(CoT)指令微调,是否能与大型语言模型(LLM)竞争。我们提出了Paramanu-Ganita,这是一个具有2.08亿参数的解码器模型,经过从零开始的预训练,使用了315亿个标记的混合数学语料库。尽管Paramanu-Ganita的规模仅为7B LLM的1/34,但在GSM8K测试准确率上超越了通用LLM约30个百分点,并在多个基准测试中表现优异,展示了其在数学推理任务中的潜力与环境可持续性。

🔬 方法详解

问题定义:本文旨在解决小型生成语言模型在数学推理任务中的性能不足,尤其是与大型语言模型的竞争力和环境可持续性问题。现有方法通常依赖于大型模型,训练成本高且资源消耗大。

核心思路:论文提出的Paramanu-Ganita模型通过领域特定的预训练和链式思维指令微调,旨在提升小型模型在数学推理任务中的表现。通过专门的数学语料库进行训练,使模型能够更好地理解和处理数学问题。

技术框架:Paramanu-Ganita的整体架构为解码器-自回归模型,使用了208百万参数。模型的预训练基于315亿个标记,训练时间为170小时,使用了4096的上下文窗口。训练数据包括网页、源代码、教科书、StackOverflow问答对及LaTeX格式的数学讲义。

关键创新:最重要的创新在于通过领域特定的预训练和CoT微调,使得Paramanu-Ganita在数学推理任务中表现出色,尽管其参数量远小于现有的7B LLM。与传统方法相比,该模型在性能和资源消耗上实现了更好的平衡。

关键设计:模型使用了数学和代码专用的BPE分词器,确保了对数学符号和术语的有效处理。损失函数和训练策略经过精心设计,以适应数学推理的特点,确保模型能够在复杂的数学问题上进行有效推理。

🖼️ 关键图片

fig_0

📊 实验亮点

实验结果显示,Paramanu-Ganita在GSM8K测试准确率上超越了通用LLM约30个百分点,且在MATH基准上提高了6-8个百分点。此外,在LogiQA和MMLU等基准测试中,Paramanu-Ganita也表现出色,超越其他模型1-4%。这些结果证明了小型模型在数学推理任务中的潜力。

🎯 应用场景

该研究的潜在应用领域包括教育、自动化数学问题解答、智能辅导系统等。Paramanu-Ganita能够为学生提供个性化的数学学习支持,帮助他们解决复杂的数学问题,同时也可以用于开发更高效的数学软件工具。未来,该模型可能在数学推理和教育技术领域产生深远影响。

📄 摘要(原文)

In this paper, we study whether domain specific pretraining of small generative language models (SLM) from scratch with domain specialized tokenizer and Chain-of-Thought (CoT) instruction fine-tuning results in competitive performance on mathematical reasoning compared to LLMs? Secondly, whether this approach is environmentally sustainable, highly cost efficient? To address these research questions, we present Paramanu-Ganita, a 208 million-parameter novel decoder-only Auto Regressive SLM on mathematics. We performed pretraining from scratch on 31.5 billion tokens for 170 A100 hours using a context size of 4096 on a mixed mathematical corpus consisting of web pages, source code, textbooks, CoT templatised StackOverflow QA pairs, and mathematical lecture notes in LaTeX curated by us. We also trained a math and code specialised BPE tokenizer. We proposed and performed CoT instruction fine-tuning of Paramanu-Ganita on the MetaMathQA dataset. Our model Paramanu-Ganita, despite being 34 times smaller than the 7B LLMs, outperforms generalist LLMs by approximately 30% points, and even math-specialised LLMs by 3-23% points in GSM8K test accuracy metric. On MATH benchmark, Paramanu-Ganita outperformed the various models by 6-8% points. On benchmarks like LogiQA, MMLU (high school, college level), and competitive exams level, AGIEVAL (AQuA-RAT, SAT-Math), Paramanu-Ganita outperformed others by 1-4%. Our model is available at https://huggingface.co/gyanai/paramanu-ganita-208M-hf .