Small Language Models are Equation Reasoners

Bumjun Kim, Kunha Lee, Juyeon Kim, Sangam LeearXiv 2024 · DOI

Abstract

Small Language Models (sLMs) often underperform on arithmetic reasoning tasks compared to their larger counterparts. This paper identifies linguistic ambiguity in natural language prompts as a primary bottleneck for models with limited parameter counts. By reformatting training data into a structured equation-only format, the authors demonstrate consistent performance gains across the T5 model family, ranging from 220M down to 16M parameters. Analysis of cross-attention maps reveals that this structured approach allows sLMs to focus limited attention resources on mathematically relevant tokens, suggesting that for resource-constrained models, structural consistency is more valuable than linguistic richness.

Introduction

While Large Language Models (LLMs) like GPT-4 have demonstrated emergent reasoning capabilities through Chain-of-Thought (CoT) prompting, these successes do not easily scale down to Small Language Models (sLMs). For edge devices and real-time systems, sLMs are essential, yet they consistently struggle with multi-step math problems.

The authors hypothesize that the "richness" of natural language—where a single mathematical operation can be described in infinite ways—introduces noise that overwhelms the limited capacity of sLMs. While LLMs can navigate this variability, sLMs lack the parameters to effectively map diverse prose to underlying logic.

Methodology

To address this, the researchers proposed a shift from natural language reasoning to a distilled equation-only format. The process involves extracting the core mathematical logic from word problems and presenting it as a sequence of clear equations.

Overview of the equation-only finetuning pipeline and inference comparison.

The study utilized the GSM8K (Grade School Math 8K) dataset, reformatting its multi-step reasoning examples into the equation-only style. Various sizes of the T5 model—Base (220M), Small (60M), Mini (31M), and Tiny (16M)—were then fine-tuned on both standard and structured formats to compare performance.

Key Results

The transition to an equation-only format provided a consistent accuracy boost across the entire T5 family. Even the smallest model, T5-Tiny, saw a significant relative improvement.

Model Parameters Natural Language Accuracy Equation-Only Accuracy
T5-Base 220M 13% 17%
T5-Small 60M 10% 14%
T5-Mini 31M 8% 11%
T5-Tiny 16M 7% 10%

While absolute accuracy remains lower than that of massive LLMs, the 3-4% absolute improvement represents a major jump for models of this scale, achieved without any increase in computational overhead.

Analysis: The "Attention Gap"

To understand why structure beats vocabulary for sLMs, the researchers analyzed cross-attention score maps. They discovered that natural language reasoning causes "dispersed attention," where the model wastes its limited focus on tokens unrelated to the actual calculation.

Cross-attention maps comparing dispersed attention in natural language vs. focused attention in equation-only formats.

In the equation-only format, the model demonstrated much higher attention scores for relevant pairs, such as mapping the word "times" in a prompt directly to the * symbol in the output. This suggests that the bottleneck for sLMs is not necessarily "intelligence," but rather the efficiency of the data format used to teach them.

Conclusion and Future Work

This research proves that for tiny reasoners, structure is more important than context. By stripping away linguistic ambiguity, sLMs can be made more effective at arithmetic reasoning. Future work may explore whether this structured approach can be applied to other domains, such as formal logic or legal reasoning, and whether decoder-only architectures like Llama show similar sensitivity to format at small scales.

Summary updated

BibTeX
@misc{kim2024small,
  author = {Bumjun Kim and Kunha Lee and Juyeon Kim and Sangam Lee},
  title = {{Small Language Models are Equation Reasoners}},
  year = {2024},
  eprint = {2409.12393},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2409.12393},
}
Figure