MedTraj treats reasoning trajectories as core objects that can be constructed, evaluated, and optimized. The pipeline first generates structured multi‑step chains from medical reasoning sources, parsing each trajectory into clinical observations, evidence, numbered reasoning steps, and a final conclusion. The trajectory is then scored on five quality dimensions: coherence, evidence support, hallucination, completeness, and traceability. Controlled error injection introduces targeted faults into otherwise correct trajectories to create causal links between specific reasoning failures and measurable quality drops. Step‑level filtering based on marginal contribution identifies which individual steps drive or undermine trajectory quality. Finally, quality‑weighted context learning feeds the evaluation back to the model at inference time, allowing it to learn from strong demonstrations while avoiding weak ones. Experiments on CareQA, PubMedQA, and CECMed show that trajectory context consistently improves coherence, with gains of 0.029–0.041 over a zero‑shot baseline. On CECMed, quality‑weighted context nearly doubles correctness and cuts hallucination rate by 87%. Marginal‑contribution analysis reveals that a small minority of steps carry most of the quality signal, and extending chains beyond four steps yields diminishing returns.
Review