CMU 11-667 · Fall 2025 · Team project

Structured medical QA

Can a small language model produce an answer with a reliable hierarchy, rather than a flat list of suggestions?

My role Built the transformed training dataset and ran the full fine-tuning and LoRA experiments. Teammate Xinshi Wang developed the evaluation approach and in-context-learning experiments.

Structural compliance: Qwen full 95%, Qwen LoRA 47.5%, DeepSeek full 92.5%, DeepSeek LoRA 62.5%
Results from the project report, Table 4. Forty held-out questions; all four models evaluated under the same structural rules.

Task and implementation

The model takes a medical question and produces a hierarchy of categories, subcategories, and details. The structure aims for mutually exclusive, collectively exhaustive (MECE) groups, at least three levels, and at most five children per node.

I converted source doctor answers into this format with a parallel DeepSeek API pipeline, then compared Qwen2.5-0.5B and DeepSeek-R1-1.5B under full fine-tuning and rank-8 LoRA. Training masks the input tokens so the loss applies to the answer.

Result and interpretation

Qwen full fine-tuning reached 95% structural compliance , compared with 47.5% for the tested LoRA configuration. DeepSeek full and LoRA reached 92.5% and 62.5%. These are results for this dataset, evaluation script, and 40-question test set.

The result favors full fine-tuning in this experiment. It does not show that LoRA generally cannot learn hierarchical output: the adapter targets, rank, training budget, and small evaluation sample limit that conclusion.

Structural compliance measures output organization. It does not establish medical correctness, diagnostic safety, or clinical benefit.

Related language-model systems work

In a separate CMU assignment, I compared language-model training configurations using FlashAttention, gradient checkpointing, and optimizer precision, then benchmarked vLLM against Hugging Face generation. The work is coursework on controlled configurations; it is separate from a production serving system.

Methods: PyTorch, Hugging Face Transformers, supervised fine-tuning, prompt masking, LoRA, structural evaluation.