M
MedCurate
Curated synthetic data beats raw for medical QA
Created on 25th October 2026
•
M
MedCurate
Curated synthetic data beats raw for medical QA
The problem MedCurate solves
Local LLM Track · PS #8: Data-scarce domains
Medical QA needs expert labels, which are scarce and expensive: PubMedQA has only 1,000 expert-labelled yes/no/maybe questions against 61,000 unlabelled abstracts. MedCurate shows how to turn unlabelled domain text into training data with a fully local stack, and proves that curating synthetic data beats training on raw generated data.
Pipeline (single T4 GPU):
- SGLang serves every model: the Qwen2.5-7B generator/judge, all fine-tuned students, evals, a throughput benchmark and the live demo.
- CuratorKIT generates yes/no/maybe QA from 300 unlabelled abstracts and filters it with a grounding + label-check gate, an LLM reward judge, and near-duplicate removal. 858 generated → 388 curated (55% rejected).
- AlignTune LoRA fine-tunes Qwen2.5-1.5B on RAW (858), RAW-MATCHED (388, size control) and CURATED (388) with identical settings, then merges the adapters.
- AuditKIT evaluates all models on 500 held-out expert labels.
Results:
- Curated model accuracy 0.670 vs 0.594 for size-matched raw (+7.6 pts, McNemar p = 0.0003) and 0.604 for 2.2× more raw data (p = 0.003). The gain comes from quality, not quantity.
- The 1.5B student beats its own 7B teacher on accuracy (0.670 vs 0.618, p = 0.036).
- Raw synthetic data taught the model to hedge ("maybe" on 100+ clear-cut questions); curation removed that.
- Honest limit: macro-F1 only ties, because the gates also removed most genuine "maybe" examples. Label-aware curation is the next step.
Everything is reproducible: 9 notebooks, pinned versions, and every decision logged in DECISIONS.md.
Challenges I ran into
- Only a T4 (sm75) was available. SGLang's default FlashInfer kernels crashed while JIT-compiling (
ninjanot found). Root fix: put the SGLang venv'sbin/on the server's PATH, use the triton attention backend and fp16, and disable prefill CUDA-graph capture (startup went from 201 s to 56 s). - Dependency conflicts: AlignTune pulls
trl[vllm], which can't share an environment with SGLang. We isolated SGLang in its own venv and talked to it over HTTP. - The judge was lenient with its own output. A pilot at the default thresholds rejected only 19%. We recorded every judge score and swept thresholds offline, choosing grounding ≥ 0.80 and reward ≥ 0.75 (about 40–55% rejected).
- CUDA out-of-memory during training at batch 4. Fixed with batch 2 × 8 gradient accumulation (same effective batch 16) plus gradient checkpointing.
- A statistics bug: AuditKIT's paired-bootstrap p-values came out at about 0.5 for every comparison. The source showed the resampled differences aren't centred under the null. We switched to exact McNemar tests and bootstrap CIs, and documented the issue.
- Assistant-only loss wasn't available through AlignTune for Qwen2.5's chat template, so all arms use full-sequence loss (identical, documented).
- Colab reclaimed idle VMs mid-demo. We added a keep-alive and made every notebook idempotent and resumable from Google Drive.
Tracks Applied (1)
Local LLM Track
RadixArk
Discussion
Builders also viewed
See more projects on Devfolio