TL;DR
This paper introduces a novel dataset of ancient Chinese mathematical word problems, extracted from historical texts. They then evaluate the performance of GPT-4o on solving these problems using a Program-of-Thought (PoT) prompting strategy, demonstrating the potential of LLMs for historical mathematics research while highlighting current language understanding limitations.
What Problem Does This Paper Address?
The field of Artificial Intelligence has seen significant progress in solving mathematical word problems, largely driven by advancements in Large Language Models (LLMs). However, existing research and datasets primarily focus on contemporary languages and mathematical contexts. This paper addresses a critical gap: how do LLMs perform when faced with mathematical problems from ancient texts, which may contain unfamiliar terminology, cultural contexts, and linguistic structures? This is crucial for understanding the capabilities of LLMs beyond modern domains and for unlocking new avenues in historical research.
Methods
The core of the paper involves two main methodological thrusts:
- Dataset Creation: The authors developed a dataset by semi-automatically extracting mathematical problems, their answers, and solution procedures from seven ancient Chinese mathematical texts dating back to the Tang dynasty. They leveraged the highly structured nature of these texts, which typically follow a question-answer-procedure format. The process involved sourcing digitized texts, removing commentaries, and parsing them into problem triplets. Numerical solutions were standardized, and units of measurement were handled to facilitate computational analysis.
- LLM Evaluation: The researchers employed a Program-of-Thought (PoT) prompting strategy to evaluate GPT-4o's performance. This approach involves instructing the LLM to generate Python code that solves the problems. They experimented with various prompting techniques, including:
- Few-shot prompting: Providing the model with examples of problems, their English translations, and corresponding Python solutions.
- Zero-shot prompting: Testing the model without explicit examples.
- Alternative prompts: Modifying the system prompt to explore different constraints (e.g., no punctuation, no translation, no procedures).
- Numerical solutions provided: Giving the model the numerical answers upfront to assess its ability to generate the correct code.
Datasets
The primary dataset introduced in this paper is derived from seven ancient Chinese mathematical texts compiled into the "Computational Canon in Ten Books" (Suanjing shishu 算經十書). These texts include:
- "Computational Procedures of Nine Categories" (Jiuzhang suanshu 九章算術)
- "Computational Treatise [Beginning with a Problem about a] Sea Island" (Haidao suanjing 海島算經)
- "Computational Treatise of Five Departments" (Wucao suanjing 五曹算經)
- "Computational Treatise of Master Sun" (Sunzi suanjing 孫子算經)
- "Computational Treatise of Zhang Qiujian" (Zhang Qiujian suanjing 張邱建算經)
- "Computational Treatise on the Continuation [of Tradition] of Ancient [authors]" (Jigu suanjing 緝古算經)
- "Computational Treatise of Xiahou Yang" (Xiahou Yang suanjing 夏侯陽算經)
This dataset comprises 577 problem triplets (question, answer, procedure). It differs from existing benchmarks by focusing on historical texts and pre-modern mathematical language.
Key Insights and Ideas
- LLMs can tackle ancient math, but language is a hurdle: While GPT-4o can solve a significant portion of these ancient problems, its performance is heavily impacted by the archaic language and specialized terminology. This suggests that the primary challenge isn't necessarily mathematical reasoning but linguistic comprehension of historical texts.
- PoT is a powerful tool for historical analysis: Generating executable code from ancient procedures opens up new possibilities for analyzing historical mathematics. It allows for a more systematic and scalable approach to understanding the actual computations performed, moving beyond manual annotation.
- Code alignment enables semantic search: By ensuring the generated code closely mirrors the original procedures, researchers can perform semantic searches across texts based on abstract operations rather than specific keywords, a significant advancement for historical research.
- Text length and complexity matter: Longer problems and those with more unknowns are demonstrably harder for the LLM to solve, indicating that inherent problem complexity, not just language, plays a role.
Key Results
- GPT-4o, using the default few-shot PoT prompting, achieved an overall accuracy of 51.1% across the entire dataset.
- The "best-of-5" (B-o-5) accuracy, where a problem is considered solved if it's solved in at least one of five runs, reached 63.0%.
- Providing numerical solutions upfront significantly boosted accuracy, reaching 54.2% (mean) and 67.6% (B-o-5), highlighting the model's ability to translate known solutions into code.
- Removing procedures from the prompt led to a substantial drop in accuracy, indicating their importance for guiding the LLM.
- Removing punctuation caused a small but significant drop in mean accuracy, underscoring the model's sensitivity to text formatting.
- Performance varied significantly across different texts, with "Sea Island" and "Continuation" showing particularly low accuracy (around 4.4% and 0.0% respectively).
- Error analysis revealed that misunderstood expressions (27 cases) and unit conversions (17 cases) were the most common reasons for failure.
Limitations and Future Work
The authors acknowledge several limitations:
- The dataset was not exhaustively checked for errors.
- Only one LLM (GPT-4o) and a limited set of exemplars were tested.
- No comparison was made against human performance on this dataset.
Future work directions include:
- Exploring more advanced prompting techniques, such as feedback-based learning.
- Investigating retrieval-augmented generation to provide LLMs with explanations of technical terms.
- Developing custom programming languages or libraries tailored to ancient Chinese mathematical operations to better align with the historical context and potentially improve code generation.
- Expanding the dataset and testing on a wider range of LLMs.
Summary updated