Sketch2Feedback: Grammar-in-the-Loop Framework for Rubric-Aligned Feedback on Student STEM Diagrams
Organizations: IEEE
Abstract
Providing timely, rubric-aligned feedback on student-drawn diagrams is a persistent challenge in STEM education. While large multimodal models (LMMs) can jointly parse images and generate explanations, their tendency to hallucinate undermines trust in classroom deployments. We present Sketch2Feedback, a grammar-in-the-loop framework that decomposes the problem into four stages -- hybrid perception, symbolic graph construction, constraint checking, and constrained VLM feedback -- so that the language model verbalizes only violations verified by an upstream rule engine. We evaluate on two synthetic micro-benchmarks, FBD-10 (free-body diagrams) and Circuit-10 (circuit schematics), each with 500 images spanning standard and hard noise augmentation tiers, comparing our pipeline against end-to-end LMMs (LLaVA-1.5-7B, Qwen2-VL-7B), a vision-only detector, a YOLOv8-nano learned detector, and an ensemble oracle. On n=100 test samples per benchmark with 95% bootstrap CIs, results are mixed and instructive: Qwen2-VL-7B achieves the highest micro-F1 on both FBDs (0.570) and circuits (0.528), but with extreme hallucination rates (0.78, 0.98). An ensemble oracle that selects the best prediction per sample reaches F1=0.556 with hallucination 0.320 on FBDs, demonstrating exploitable complementarity between grammar and end-to-end approaches. Confidence thresholding at tau=0.7 reduces circuit hallucination from 0.970 to 0.880 with no F1 loss. Hard noise augmentation reveals domain-dependent robustness: FBD detection is resilient while circuit detection degrades sharply. An LLM-as-judge evaluation confirms that the grammar pipeline produces more actionable circuit feedback (4.85/5) than the end-to-end LMM (3.11/5). We release all code, datasets, and evaluation scripts.
Figures & tables
| Data | Model | Mi-F1 | P | R | Corr. | Act. | Hall. |
|---|---|---|---|---|---|---|---|
| FBD | Grammar | .263 [.13,.35] | .385 | .200 | 3.36 | 3.65 | .375 |
| E2E | .471 [.36,.62] | .571 | .400 | 3.91 | 4.35 | .375 | |
| Vis. | .077 [.18,.45] | 1.00 | .040 | 2.20 | 2.05 | .000 | |
| Circ. | Grammar | .329 | .522 | .240 | 2.95 | 5.00 | .925 |
| E2E | .038 | .333 | .020 | 3.81 | 4.03 | .750 | |
| Vis. | .000 | .000 | .000 | 1.70 | 2.20 | .200 |
| Data | Error Type | Gram. | E2E | Vis. |
|---|---|---|---|---|
| FBD | wrong direction | .500 | .000 | .000 |
| missing force | .000 | .745 | .182 | |
| extra force | .000 | .154 | .000 | |
| Circ. | missing ground | .558 | .091 | .000 |
| missing component | .000 | .000 | .000 | |
| wrong polarity | .000 | .000 | .000 |
VLM Hallucination Mitigation
Vision-language model hallucination mitigation keeps generated claims grounded in visual evidence.
See all 227 papers