🧠 AI Ed Wiki

Presents StructRAG, a pattern-aware framework that improves how AI tutoring systems interpret complex engineering diagrams (circuit schematics, network topologies, block flowcharts) in STEM. Current AI systems fail on diagrammatic questions because they cannot reliably extract spatial relationships and structural connectivity from noisy real-world diagrams (curved lines, overlapping elements, occluded labels). StructRAG shifts from surface-level visual recognition to pattern-level structural reasoning: convert the diagram to a graph, retrieve structurally similar canonical patterns, and prompt an LLM to validate plausibility and completeness — enabling detection of missing connections and structure-aware feedback.

Architecture (four components)

1. Diagram-to-Graph Conversion — OCR (Tesseract, multi-scale 1.0/1.5/2.0, majority voting) + classical CV (Hough Line Transform, contour detection, Zhang–Suen skeletonisation for curved paths). Edge confidence Cij = 0.45·scont + 0.25·sprox + 0.20·salign + 0.10·snode; edges ≥ 0.65 accepted, 0.40–0.65 routed to an uncertain-edge set U for pattern-level validation, < 0.40 discarded as noise.

2. Structural Pattern Retrieval — abstracts the recognized graph into topology patterns (star, ring, chain/bus, bridge/mesh, tree, hybrid, cross-layer) and retrieves similar templates from a curated library using graph-edit-distance (GED) matching.

3. Pattern-Aware Prompt Construction — feeds the LLM the graph G, uncertain edges U, retrieved templates, and candidate corrections ΔE.

4. LLM-Guided Structural Reasoning and Correction — GPT-4 jointly interprets G, U, T*, and ΔE to decide which uncertain edges to add and which structures to correct, with output ensembling.

Results (1,650 STEM diagram-based questions)

  • RQ1 (accuracy): macro-average question-level accuracy 89.3% (95% CI [86.8, 91.9]) — beating OCR+CV only (70.8%), GPT-4 graph-only (81.9%), direct-image GPT-4o (84.8%), and StructRAG-without-LLM (82.7%); significant after Holm–Bonferroni correction (p < 0.01).
  • RQ2 (missing-connection recovery): micro-averaged edge-level F1 = 93.0% (CI [91.8, 94.2]) — best in every topology category; largest gains over OCR+CV on irregular (26.4 pts), bridge/mesh (23.1), and ring (21.6) topologies.
  • RQ3 (retrieval strategy): pattern-level retrieval beats node-level statistics and example-based retrieval.
  • Best on star (94.5%) and chain/bus (93.1%); hardest on bridge/mesh (85.8%) and unclassified/irregular (81.4%) diagrams — yet still best-in-class there.
  • Component ablation (Table 10): full pipeline 89.3/93.0 vs pattern-aware GPT-4 without ensembling 87.8/91.4 and template retrieval + GED without LLM 82.7/87.6 — every component contributes.
  • Interpretation

  • Question-level accuracy is always lower than edge-level F1 because Acc demands a perfect whole-diagram match, while F1 captures partial correctness — relevant for education, where identifying most missing connections already yields useful structural feedback.
  • Grounded in cognitive apprenticeship: instructors guide students through visual problem-solving by highlighting analogies, missing links, and logical dependencies; StructRAG's template retrieval mirrors that by making structural relationships explicit and auditable (an intermediate graph representation, rather than end-to-end visual matching).
  • Interviews with 12 STEM educators were positive: actionable structural feedback, adaptability across diagram types, and help explaining missing/ambiguous connections to students struggling with abstract topologies.
  • Limitations: dataset withheld (university teaching materials; schema/code/prompts released), and no learner-outcome study yet — future work should test effects on learning, retention, transfer, motivation, and cognitive load in live tutoring contexts.
  • Connected Concepts

  • Automated Question Generation
  • Socratic Method
  • AI Tutoring
  • Math Education
  • Socratic AI Dialogue
  • Pedagogical Agent
  • Open Source
  • Agentic AI
  • Connected Articles

  • Structured LLM Feedback Programming — The Effects of Structured LLM-Generated Feedback on Programming Assignment Performance
  • Eduguard Safe RAG LLM Tutor — EduGuard: A Safe RAG-Based LLM Tutor for Programming Education
  • Cstutorbench Slm Tutors — CSTutorBench: Benchmarking Small Language Models as Tutors for Block-Based Programming
  • Hybrid E Assessment Semi Automated Grading — Hybrid E-Assessment in Higher Education: Semi-Automated Grading of Paper-Based Written Examinations
  • Retrieval Augmented Tutoring Algorithm Kite — Retrieval-Augmented Tutoring for Algorithm Tracing and Problem-Solving in AI Education
  • LLM Judged Helpfulness Pedagogy Signal — Rethinking LLM-Judged Helpfulness as a Pedagogy Signal: A Pre-Registered Audit Across Tutor Models
  • Citation

    Sun, Y., Liao, Y., & Ma, X. (2026). Advancing diagram-based reasoning in AI tutoring systems: A structural approach for STEM education. Smart Learning Environments. Advance online publication