Language Models as Science Tutors

Alexis Chevalier, Jiayi Geng, Alexander Wettig, Howard Chen, Sebastian Mizera, Toni Annala, Max Jameson Aragon, Arturo Rodríguez Fanlo, Simon Frieder, Simon Machado, Akshara Prabhakar, Ellie Thieu, Jiachen T. Wang, Zirui Wang, Xindi Wu, Mengzhou Xia, Wenhan Xia, Jiatong Yu, Jun-Jie Zhu, Zhiyong Jason Ren, Sanjeev Arora, Danqi Chen

TL;DR

This paper introduces TUTOREVAL and TUTORCHAT, a new benchmark and synthetic dataset designed to evaluate and train language models as long-context science tutors. By fine-tuning models on a curated mixture of textbook dialogues and math problems (MathMix), the authors develop open-source 7B and 34B Llemma models that excel at explaining complex scientific concepts across long contexts while maintaining top-tier math problem-solving skills.

What Problem Does This Paper Address?

While large language models (LLMs) excel at standard short-form STEM benchmarks (like GSM8K or MATH), these benchmarks typically evaluate only the final answer to a discrete problem. They fail to capture real-world educational use cases, such as a student asking for clarification on a complex concept buried deep within a long textbook chapter.

Existing models trained on general dialogue datasets perform poorly in these long-context, multi-disciplinary scientific settings. To bridge this gap, the authors address two core challenges: the lack of realistic long-context scientific tutoring benchmarks, and the difficulty of training models that are both effective conversational tutors and strong mathematical problem solvers.

Methods

The authors propose a two-stage pipeline to build and evaluate effective AI science tutors:

  1. Context Extension: The authors extended the context window of base Llemma models to 32K tokens using RoPE (Rotary Position Embedding) base scaling, fine-tuning on a 5B-token subset of OpenWebMath.
  2. Dialogue Fine-Tuning: Models were fine-tuned on synthetic teacher-student dialogues. Open-book dialogues included the entire textbook chapter in the context, while closed-book dialogues removed it.
  3. LM-as-Evaluator with Key Points: To evaluate free-form generations reliably without prohibitive human cost, they used GPT-4 as an evaluator. Crucially, they augmented the evaluation prompt with expert-annotated "key points" (sketches of the ground-truth answer), which significantly boosted correlation with human grading and prevented the model from unfairly favoring its own generations.

Datasets

The paper introduces several key datasets for training and evaluation:

  • TUTOREVAL: A new evaluation benchmark consisting of 834 expert-written questions based on 202 open-source textbook chapters across Mathematics, Computer Science, Physics, Life Sciences, and Environmental Science. It includes challenging subsets like "misleading questions" to test model robustness against sycophancy.
  • TUTORCHAT: A new training dataset containing 78,000 long synthetic dialogues (160M words total) generated by GPT-3.5 and GPT-4 based on textbook chapters from libretexts.org.
  • MathMix: A specialized data mixture combining the STEM subset of TUTORCHAT with the MetaMath dataset (reformatted into long sequences) to balance conversational tutoring and raw problem-solving capability.

Key Insights and Ideas

  • The Tutoring vs. Problem-Solving Trade-off: Fine-tuning on conversational data alone (like UltraChat or even TutorChat) degrades a model's raw mathematical problem-solving skills. Conversely, training purely on math problems yields poor conversationalists. Combining them into MathMix provides a Pareto-optimal synergy.
  • Weak Students Prevent Sycophancy: Including synthetic dialogues that simulate "weak students" (who are unfocused or make mistakes) helps the model learn to politely correct errors rather than blindly agreeing with a confused user.
  • Open-Book Dialogue Value: Open-book dialogues—where an LM and a user discuss a common piece of text—are rare in existing datasets, making TUTORCHAT a highly valuable contribution for long-context grounding.

Key Results

The authors' models, Llemma-7B-32K-MathMix and Llemma-34B-MathMix, achieved highly competitive results on TUTOREVAL, outperforming generalist baselines and closely rivaling powerful closed-source or much larger models.

Figure 2: Left: performance breakdown on TUTOREVAL by domains. Right: leaderboard of popular models on TUTOREVAL. Our models, marked in bold, achieve competitive TUTOREVAL performance.
  • On TUTOREVAL, Llemma-34B-MathMix scored 57.2, outperforming Mistral-7B-V2 (50.9) and approaching Mixtral-8x7B (66.3).
  • As shown in the performance tradeoff plot below, the MathMix models successfully bridge the gap between conversational tutoring quality and hard mathematical reasoning, outperforming the strong Mistral-7B-V2 baseline on math tasks while matching its TUTOREVAL performance.
Figure 5: Combined performance on TUTOREVAL and math oriented datasets (average of GSM8K & MATH). In red are our models trained with MathMix, with 7B and 34B param- eters. In purple are 7B-parameter baselines trained from Llemma-7B-32K. We also include the pre-trained Mistral- 7B-V2 in green.

Limitations and Future Work

  • Domain Bias: TUTOREVAL is currently heavily weighted toward Mathematics and Computer Science, with smaller representation for Life and Environmental sciences.
  • Single-Turn Evaluation: Although the models show strong qualitative performance in multi-turn conversations, the TUTOREVAL benchmark itself primarily evaluates single-turn question answering based on a long context.
  • Future Directions: The authors plan to expand TUTOREVAL to cover more scientific disciplines, higher difficulty levels, and more diverse educational use cases through large-scale crowd-sourcing.

Summary updated

BibTeX
@inproceedings{chevalier2024language,
  author = {Alexis Chevalier and Jiayi Geng and Alexander Wettig and Howard Chen and Sebastian Mizera and Toni Annala and Max Jameson Aragon and Arturo Rodríguez Fanlo and Simon Frieder and Simon Machado and Akshara Prabhakar and Ellie Thieu and Jiachen T. Wang and Zirui Wang and Xindi Wu and Mengzhou Xia and Wenhan Xia and Jiatong Yu and Jun-Jie Zhu and Zhiyong Jason Ren and Sanjeev Arora and Danqi Chen},
  title = {{Language Models as Science Tutors}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=WFyolnFZOR},
}
Figure