SBI-RAG: Enhancing Math Word Problem Solving for Students through Schema-Based Instruction and Retrieval-Augmented Generation.

Prakhar Dixit, Tim Oates

TL;DR

The authors introduce SBI-RAG, a framework that marries Schema-Based Instruction (an evidence-based pedagogical technique) with Retrieval-Augmented Generation to solve math word problems. By first classifying a problem’s mathematical structure and retrieving targeted instructional context before generating a solution with Llama 3.1, SBI-RAG produces significantly clearer, step-by-step educational explanations that outperform standalone LLMs like GPT-4.

What Problem Does This Paper Address?

Math word problems (MWPs) present a major barrier to elementary and middle-school students: surveys show that nearly half of struggling students can read the text of a word problem but fail to determine the underlying mathematical question or operations needed. While Large Language Models (LLMs) can solve many arithmetic problems using Chain-of-Thought (CoT) prompting, CoT has significant educational shortcomings. It is notoriously brittle to prompt phrasing, can generate hallucinated or illogical intermediate steps, and often focuses merely on calculating the final answer rather than scaffolding structured, pedagogical reasoning for learners.

Methods

SBI-RAG breaks the problem-solving and explanation generation process into four distinct pipeline stages:

  1. Schema Classification: The system uses a fine-tuned distilBERT-base-uncased model to classify an incoming problem into one of two primary educational schemas and six sub-categories (e.g., Additive Total, Additive Difference, Multiplicative Equal Groups, Multiplicative Comparison).
  2. Schema-Specific Prompting: The predicted schema and sub-category are injected into a structured prompt template:
    "Using the {schema} schema and {sub_category} sub-category, solve the following problem: {question}".

  3. Context Retrieval (RAG): Using Ollama embeddings and a Chroma vector store, the system retrieves relevant pedagogical guidelines, strategy explanations, and worked examples from an indexed educational resource (the IRIS Center at Vanderbilt University). Documents are re-ranked using cosine similarity.

  4. Answer Generation: The retrieved instructional context, schema metadata, and problem are fed into an open-weight LLM (Llama 3.1 via Ollama) to produce an pedagogically grounded, step-by-step solution.

Datasets

  • Custom Schema-Based Instruction (SBI) Dataset: 360 math word problems evenly distributed across 6 schema sub-categories (~60 problems per category). Used for training (75%) and evaluating (25%) the DistilBERT schema classifier.
  • GSM8K: A standard benchmark of 8,500 grade-school math word problems (7.5K train, 1K test) requiring 2 to 8 arithmetic calculation steps. Used to evaluate end-to-end multi-step reasoning generation.

Key Insights and Ideas

  • Injecting Pedagogical Schemas Outperforms Raw Prompting: Off-the-shelf LLMs struggle with pedagogical clarity when relying solely on generic CoT. Grounding the generation in formal schema instruction forces the model to structure the problem into recognizable conceptual relationships (such as identifying groups vs. items per group).
  • Evaluating Process Over Answer Correctness: In educational tooling, reaching the correct final number is less critical than demonstrating sound logical progression. To capture this, the authors introduce a composite reasoning score that checks both the presence of key conceptual steps and a "delta score" measuring transitions between problem entities, scaled by explanation clarity.

Key Results

  • High-Accuracy Schema Classification: The fine-tuned DistilBERT classifier achieved an overall accuracy of 97% across the six problem sub-categories.
  • Superior Reasoning Quality: On the new reasoning score metric, SBI-RAG achieved a score of 0.588, statistically outperforming both GPT-4 (0.491, $p = 0.00248$) and GPT-3.5 Turbo (0.290, $p = 0.00012$) via paired sample t-tests ($\alpha = 0.05$).
  • LLM-as-a-Judge Scoring: Evaluated using automated LLM judging across clarity, logical flow, and completeness (0–10 scale), SBI-RAG consistently earned higher pedagogical ratings (e.g., achieving an overall score of 9.0–9.5 compared to 7.5–8.5 for baseline LLM generations, which tended to skip intermediate conceptual steps).

Limitations and Future Work

  • Lack of Human Evaluation: The study evaluates educational efficacy via automated metrics and LLM-as-a-Judge rather than controlled classroom trials with real teachers and students.
  • Scope of Mathematics: Current schema coverage is limited to elementary arithmetic categories (GSM8K). The framework needs adaptation to handle higher-order algebra, geometry, or multi-schema compound problems.
  • Retrieval Dependency: Generation quality relies heavily on the quality and ranking of retrieved pedagogical documents. Future work aims to expand the schema knowledge base and incorporate direct feedback from educators to refine instructional prompts.

Summary updated

BibTeX
@inproceedings{dixit2024sbi,
  author = {Prakhar Dixit and Tim Oates},
  title = {{SBI-RAG: Enhancing Math Word Problem Solving for Students through Schema-Based Instruction and Retrieval-Augmented Generation.}},
  booktitle = {MATH-AI @ NeurIPS},
  year = {2024},
  url = {https://openreview.net/forum?id=fn0pQWkFsP},
}

Loading related content...

Figure