Abstract
Quantities are distinct and critical components of texts that characterize the magnitude properties of entities, providing a precise perspective for the understanding of natural language, especially for reasoning tasks. In recent years, there has been a flurry of research on reasoning tasks based on large language models (LLMs), most of which solely focus on numerical values, neglecting the dimensional concept of quantities with units despite its importance. We argue that the concept of dimension is essential for precisely understanding quantities and of great significance for LLMs to perform quantitative reasoning. However, the lack of dimension knowledge and quantity-related benchmarks has resulted in low performance of LLMs. Hence, we present a framework to enhance the quantitative reasoning ability of language models based on dimension perception. We first construct a dimensional unit knowledge base (DimUnitKB) to address the knowledge gap in this area. We propose a benchmark DimEval consisting of seven tasks of three categories to probe and enhance the dimension perception skills of LLMs. To evaluate the effectiveness of our methods, we propose a quantitative reasoning task and conduct experiments. The experimental results show that our dimension perception method dramatically improves accuracy (43.55%->50.67%) on quantitative reasoning tasks compared to GPT-4.
Introduction
While Large Language Models (LLMs) have become increasingly adept at arithmetic, they frequently stumble when numbers are attached to physical units—a field known as quantitative reasoning. Most current research into LLM reasoning focuses on "abstract values" (pure numbers). However, real-world text is full of "grounded values" or quantities—numbers paired with units (e.g., "10 meters," "50 kg/m³").
LLMs often fall into "unit traps." For example, if a problem asks for a result in "square feet" but provides a linear "stiffness" value, a model might perform the math correctly but fail to realize the units are dimensionally inconsistent. Current models lack a fundamental "Dimension Law"—the rule that you can only add or compare quantities with the same dimension. This leads to errors in unit conversion, magnitude comparison, and complex multi-step physics problems.
Methodology
The proposed framework infuses LLMs with "dimension awareness" through a three-step process:
- DimUnitKB (Knowledge Base Construction): A comprehensive knowledge base of 1,778 units was built. Crucially, each unit is assigned a Dimension Vector representing the exponents of the seven base SI dimensions (Length, Mass, Time, etc.). For example, the unit for force (Newton) is stored as a vector representing $L^1 M^1 T^{-2}$.
- Dimension Perception (DimEval): A benchmark called DimEval was developed, consisting of seven tasks designed to probe a model's understanding of units, such as Dimension Arithmetic (e.g., what is Joule $\times$ Meter?) and Comparable Analysis (can you compare an Acre to a Light Year?).
- Quantity-Oriented Data Augmentation: To improve reasoning, existing math datasets were augmented using "Unit Format Substitution" (changing "kilograms" to "kg") and "Substitution of Units with Same Dimension" (changing "meters" to "feet" and scaling the numerical value accordingly). This ensures the model learns the relationship between values and units rather than just memorizing patterns.
Datasets and Benchmarks
The research introduces several key resources:
- DimUnitKB: A new, bilingual (English/Chinese) knowledge base of units, significantly larger than previous datasets like UoM.
- DimEval: A new benchmark for evaluating dimension perception across three categories: Basic Perception, Dimension Perception, and Scale Perception.
- Q-MWP (Quantitative Math Word Problems): The authors extended two popular Chinese math datasets, Math23k and Ape210k, into "quantitative" versions (Q-Math23k and Q-Ape210k) by injecting diverse units and requiring unit conversions to solve the problems.
Results and Insights
The fine-tuned 7B model, DimPerc, showed dramatic improvements over state-of-the-art models:
- Quantitative Reasoning: On the Q-Ape210k dataset, DimPerc achieved 50.67% accuracy, significantly outperforming GPT-4 (34.67%) and even GPT-4 augmented with WolframAlpha (43.55%).
- Dimension Perception: On the DimEval benchmark, DimPerc achieved an F1-score of 99.13% in Dimension Prediction, while GPT-4 trailed at 34.40%.
- Efficiency: The results demonstrate that a much smaller, specialized model can outperform "frontier" models on domain-specific reasoning by focusing on the underlying logic of physics and dimensions.
A key insight is that units have a mathematical structure. By representing units as vectors of base dimensions, the model can "calculate" whether a physical operation is even possible. Interestingly, even when GPT-4 is given access to external tools like WolframAlpha, it still struggles because it often fails to identify the "unit trap" in the prompt itself, leading it to ask the tool the wrong question. Internalizing dimension knowledge proved more effective.
Conclusion
This work highlights the importance of dimension perception in quantitative reasoning. While the DimPerc model shows significant promise, future work will address the need for automated maintenance of the DimUnitKB as new units emerge. Additionally, expanding this dimension-aware approach to other fields like finance, chemistry, and professional engineering certifications, as well as broader multilingual support, remains a priority.
Summary updated