Abstract
While Large Language Models (LLMs) have demonstrated proficiency in solving discrete mathematical problems, their application as pedagogical assistants in STEM education is often hindered by context limitations and a lack of instructional nuance. This paper introduces TUTOREVAL and TUTORCHAT, a novel benchmark and a large-scale synthetic dialogue dataset designed to bridge these gaps. By fine-tuning Llemma models on long-context, textbook-based conversations, we developed specialized assistants capable of reasoning through complex scientific topics over 32K-token windows. Our results show that domain-specific dialogue training allows open-source models to rival significantly larger generalist models in tutoring efficacy.
Introduction
Large Language Models have become remarkably effective at benchmarks like GSM8K, yet they often fail as "scientific assistants" in real-world educational settings. We identify three critical deficiencies in current models: limited context windows that cannot accommodate full textbook chapters, an evaluation focus on final answers rather than pedagogical reasoning, and a lack of dialogue datasets capturing the specific nuances of STEM instruction. To address these, we propose a multi-stage approach to build and evaluate specialized "LM Tutors."
Methodology: Building the Science Tutor
Context and Data Generation
We extended the context window of Llemma (7B and 34B) models to 32K tokens using Rotary Positional Embedding (RoPE) base frequency scaling and continued pre-training on 5 billion tokens of technical data. To provide high-quality instructional data, we created TUTORCHAT, a training set of 80,000 long-form synthetic dialogues (130M words) covering diverse academic domains. These dialogues simulate various student personas—from highly engaged to error-prone—to train the model in handling misconceptions and avoiding sycophancy.
Evaluating Pedagogical Quality
Traditional metrics are insufficient for evaluating tutoring. We utilize an "LM-as-Evaluator" approach using GPT-4. To ensure reliability, we provide the evaluator with human-annotated "key points" that a response must cover. This grounding significantly improves the correlation between automated scores and human expert judgment.
Results and Discussion
TUTOREVAL Performance
Our models were evaluated on TUTOREVAL, a new benchmark of 834 expert-written questions based on 202 textbook chapters across Math, Physics, Computer Science, Life Sciences, and Environmental Science. The Llemma-34B-MathMix model achieved a correctness score of 57.2, a substantial improvement over the base model's 46.4.
As illustrated in Figure 1, the MathMix models demonstrate competitive performance across various scientific disciplines. Notably, Llemma-34B-MathMix achieves performance levels that approach or rival much larger generalist models like Mixtral-8x7B on these specialized tasks. Furthermore, the fine-tuning process did not degrade general mathematical ability; Llemma-7B-MathMix improved its GSM8K score to 55.9%, up from 31.9% for the base model.
Key Insights
Our findings indicate that general chat data (e.g., UltraChat) is insufficient for scientific tutoring; domain-specific dialogue is essential. Additionally, training on "weak student" personas helps the model learn to politely correct errors rather than hallucinating to agree with the user. Human annotators in blind tests consistently ranked the MathMix models higher for both presentation and factual correctness compared to general-purpose models.
Conclusion
By focusing on long-context capabilities and pedagogically-grounded synthetic data, we have developed open-source models that serve as effective science tutors. While current evaluations are primarily single-turn, future work will focus on expanding the disciplinary breadth of TUTOREVAL and testing long-term coherence over extended multi-turn tutoring sessions.
Summary updated