Training Models to Reason: Lessons from Medical AI

This is the first in a monthly series where the JAPAN AI research team spotlights important advances in AI. This month, Avinash explores the fascinating challenge of teaching LLMs to reason through medical problems step-by-step
When you ask a lawyer for advice, you don't want a list of legal codes- you want someone who can weigh evidence, interpret the law and build a logical argument. When you see a doctor, you expect more than a list of symptoms and treatments; you want careful reasoning, step-by-step diagnosis, and the ability to adapt as new information comes in.
This difference between memorizing facts and reasoning through problems is at the heart of what makes real-world expertise valuable, and it's exactly where traditional AI models have struggled.
Early large language models were impressive at recalling information but struggled with complex reasoning. The release of OpenAI's o1 preview marked a paradigm shift to models that use test-time compute to "think" through problems step-by-step. This sparked innovations like DeepSeek's R1 and others, each pushing the boundaries of what reasoning models can achieve. Medicine, with its complex diagnostic challenges and high stakes, has become the perfect testbed for these advances.

The Core Challenge: You Can't Train What You Can't Generate
Here's the fundamental problem: to train a model to reason, you need examples of good reasoning. But where do you get thousands of high-quality reasoning traces?
Traditional supervised learning is straightforward:
Input: "What causes fever and cough?"
Output: "Common cold or flu"But reasoning requires something richer:
Input: "Patient has fever and cough for 3 days"
Reasoning: "Let me consider the symptoms: Fever and cough together suggest respiratory infection. Duration of 3 days rules
out allergic reactions.
Need to check for additional symptoms like chest pain (→ pneumonia) or body aches (→ influenza). Without more severe symptoms, likely viral upper respiratory infection..."
Output: "Likely viral upper respiratory infection"The reasoning string is the additional supervision we're missing.

Image: Traditional Model vs Reasoning Model
This creates a chicken-and-egg problem: you need reasoning models to generate reasoning data, but you need reasoning data to train reasoning models. The field has developed several innovative approaches to solve this puzzle, building on work like Tree-of-Thoughts and ReAct that pioneered structured reasoning in LLMs.
What Makes Good Reasoning Data?
Understanding the criteria for quality reasoning data is crucial before exploring generation methods:
1. Step-by-Step Clarity
Each logical step must be explicit, like showing your steps in a math problem. The model needs to learn not just what to think, but how to demonstrate its thinking process.
2. Backtracking and Revision
Real reasoning isn't linear. Good training data includes examples where initial hypotheses are wrong and the model must revise its thinking.

3. Diversity of Reasoning Patterns
Models need to see different reasoning styles:
- Deductivestart with a general rule and apply it to a case:
“All β-blockers lower heart rate; this drug is a β-blocker, so expect bradycardia.”
- Inductiveaggregate observations to form a hypothesis
“Four patients on Drug X developed rash; Drug X may cause dermatologic reactions.”
- Abductive / Differential- generate and rule out competing diagnoses
“Chest pain + diaphoresis → consider MI, PE, or GERD; troponin rules out MI.”
- Causal / Mechanistic trace the ‘why’ behind an outcome:
“Hyperthyroidism ↑ β-adrenergic tone → tachycardia → palpitations.”
4. Verifiable Correctness
Each reasoning chain must lead to a correct answer, but correctness alone isn't enough. The reasoning itself must be valid. We can think of it like a medical resident's note that needs sign-off from an attending physician.
Approaches to Generating Reasoning Traces
Approach 1: Verifier-Guided Generation (HuatuoGPT-o1)
TL;DR: Use a strong model to generate many reasoning paths, then use a verifier to select only the high-quality ones for training.

Image credits: https://arxiv.org/pdf/2412.18925
HuatuoGPT-o1 proposed a two-stage approach to generate high-quality medical reasoning data.
How it works:
Stage 1: Generate and Verify
- Start with 40,000 medical problems (many rewritten for open-ended reasoning)
- Use an LLM to generate multiple reasoning paths using four strategies:
- Exploring New Paths: Try different diagnostic approaches
- Backtracking: Explicitly mark failed paths and backtrack
- Verification: Double-check each reasoning step
- Correction: Fix errors in previous steps
- A verifier model (GPT-4o or fine-tuned 8B model) checks each path:
# Pseudo-code for verification
for reasoning_path in generated_paths:
if verifier.check_medical_accuracy(reasoning_path):
if verifier.check_logical_consistency(reasoning_path):
save_for_training(reasoning_path)Key Innovation: The verifier acts like a senior physician reviewing a resident's work- it doesn't just check the final answer but validates the entire reasoning process.
Stage 2: Reinforcement Learning (RL)
- Deploy the Verifier as a reward model
- Let the model practice and learn while encouraging think-before-answering with a small reward even when the answer is wrong
Results: This approach led to an 8.5% improvement on MedQA (USMLE-style questions) for the 8B model, with the 70B version surpassing other medical LLM tested..
Approach 2: Knowledge-Grounded Generation (MedReason)
TL:DR: Generate reasoning by traversing medical knowledge graphs, like finding the shortest path of dominoes linking symptoms to diseases.

Image credits:https://arxiv.org/abs/2504.00993
MedReason takes a fundamentally different approach: instead of generating reasoning from scratch, it grounds reasoning in structured medical knowledge.
How it works:
- Build on Knowledge Graphs: Uses PrimeKG, which contains:
- 129,375 biomedical entities:
- 17,000 diseases
- 19,000 symptoms
- 23,000 drugs
- 70,000 genes
- 4,050,249 relationships between entities
- Curated from 10+ medical databases
- 129,375 biomedical entities:
- Generate Reasoning by Graph Traversal:
Question: "Patient has chest pain and shortness of breath"
Step 1: Entity Recognition
→ Chest pain (node: SYMP:0000006)
→ Shortness of breath (node: SYMP:0000013)
Step 2: Path Finding
→ Both symptoms connect to "Myocardial Infarction" (3 hops)
→ Both connect to "Pneumonia" (2 hops)
→ Shorter paths suggest higher likelihood
Step 3: Convert to Natural Language
"Chest pain and shortness of breath together often indicate
cardiac issues. The combination is classic for myocardial
infarction, though pneumonia should also be considered..."Key Innovation: By grounding reasoning in verified medical relationships, this approach guarantees medically valid reasoning paths. Similar approaches like Chain-of-Knowledge have shown promise in other domains.
Results: 7.7% improvement on combined MedQA+MedMCQA benchmarks for DeepSeek-8B, with models learning to reason through medical relationships rather than memorizing answers.
Approach 3: Self-Evolution with Process Rewards (MedS³)
TL;DR: Use Monte Carlo Tree Search (the algorithm behind AlphaGo) to explore reasoning paths, with Process Reward Models guiding the search.

Image credits:https://arxiv.org/pdf/2501.12051
MedS³ introduces Monte Carlo Tree Search (MCTS) for reasoning, building on the original ReST (Reinforced Self-Training) approach and its evolution ReST-MCTS*.
Understanding Process Reward Models (PRM):
First, let's understand what makes Process Reward Models (PRMs) special. The concept of process supervision was formalized in "Let's Verify Step by Step" by OpenAI, though related ideas appeared in earlier work on process-based RLHF. Unlike Outcome Reward Models (ORMs) that only score final answers, PRMs evaluate each reasoning step.

This enables:
- Early detection of reasoning errors
- Credit assignment of which steps were helpful
- Exploration of alternative paths
How MCTS + PRM Works for Reasoning:
# Simplified MCTS for reasoning
# Simplified MCTS for reasoning
def explore_reasoning_tree(question, prm_model):
root = Node(question)
for _ in range(num_simulations):
path = select_promising_path(root, prm_model)
new_step = generate_reasoning_step(path)
score = prm_model.evaluate(new_step)
backpropagate_score(path, score)
return best_complete_path(root)Key Innovation: By treating reasoning as a search problem, MedS³ can explore multiple approaches systematically. The PRM guides exploration toward promising directions.
Results: The 8B MedS³ model achieved 71.88% and 65.2% on MedQA and MedMCQA respectively, outperforming a number of open source medical models and generalist models and reaching performance comparable to GPT-4o-mini (75.81% and 67.58%) on specific tasks.
Approach 4: Synthetic Data at Scale (ClinicalGPT-R1)
TL;DR: Combine combines 20k real Electronic Health Records (EHR) cases with a large pool of synthetically + generated reasoning trajectories for diversity.
ClinicalGPT-R1 combines 20,000 real clinical records with synthetic variations (generated using GPT-4-turbo) for diversity while addressing privacy concerns.
The Synthesis Process:
- Start with Real Clinical Records:
Real Case: "45-year-old male, chest pain for 2 hours, radiating to
left arm, sweating, ECG shows ST elevation..."2. Generate Variations:
- Change demographics (age, gender)
- Modify symptom presentation
- Add comorbidities
- Introduce edge cases
3. Add Reasoning Components:
{
"question": "What is the likely diagnosis?",
"reasoning": "Chest pain radiating to left arm with ST elevation
is classic for STEMI. Age and gender increase risk.
Immediate cardiac catheterization needed...",
"answer": "ST-elevation myocardial infarction (STEMI)"
}Key Innovation: The model is penalized (reward=0) for correct answers without showing reasoning, ensuring transparency. This approach to process supervision has proven effective across domains.
Technical Deep Dives
Understanding Process Reward Models in Detail
PRMs are the key mechanism that makes reasoning training work. Let us break down how they are trained. A simplified pipeline for training a PRM would look like:
- Collect Step-Level Annotations:
reasoning_trace = [
("Symptoms suggest respiratory issue", 0.9), # Good step
reasoning_trace = [
("Symptoms suggest respiratory issue", 0.9), *# Good step*
("Could be pneumonia or bronchitis", 0.8), *# Good*
("Patient is young, so likely cancer", 0.1), *# Bad step*
("<backtrack>", 0.7), *# Good recovery*
("Check for infection markers", 0.9) *# Good*
]- Train Binary Classifier:
- Input: Current step + previous context
- Output: Quality score [0, 1]
- Loss: Binary cross-entropy on step quality
- Handle Credit Assignment:
- Steps leading to correct answers get higher scores
- But incorrect final answer doesn't make all steps bad
- Use trajectory analysis to identify where reasoning went wrong
Once trained, these PRMs integrate directly into the reasoning pipelines described earlier: guiding MCTS exploration in MedS³, scoring reasoning paths in HuatuoGPT-o1's verification stage, and providing step-level rewards during RL training. The binary classification approach makes PRMs computationally efficient enough to evaluate hundreds of reasoning trajectories in real-time, enabling the search-based methods that make these medical reasoning systems possible.
The Verifier Bootstrapping Problem
A critical challenge: how do you train a verifier when you don't have ground-truth reasoning traces? It's like asking "who reviews the reviewer?"
Solutions:
- Start with Strong Models: Use GPT-4 or medical experts for initial labels
- Self-Consistency Filtering: Keep only reasoning traces where multiple runs agree
- Iterative Refinement:
Loop:
1. Generate reasoning with current model
2. Verify with current verifier
3. Fine-tune model on verified traces
4. Improve verifier with new data- Ensemble Verification: Use multiple verifiers with different biases
These bootstrapping techniques create a highly effective cycle: better verifiers produce higher-quality reasoning data, which trains stronger reasoning models, which generate better data for the next iteration. This iterative approach is what enables systems like HuatuoGPT-o1 and MedS³ to achieve strong performance without requiring massive human-annotated reasoning datasets.
Ensuring Reasoning Diversity
Models can collapse into repetitive reasoning patterns. Here's how to maintain diversity:
Techniques:
- Temperature Sampling in MCTS:
*# Don't always pick best path*
def select_path(node, temperature=1.0):
scores = [child.score for child in node.children]
probs = softmax(scores / temperature)
return np.random.choice(node.children, p=probs)- Reasoning Style Prompts:
- "Think like a specialist"
- "Consider rare diseases"
- "Use differential diagnosis"
- Diversity Rewards: Explicitly reward novel reasoning patterns
By combining temperature-based exploration, prompted reasoning styles, and diversity rewards, these methods prevent mode collapse during training. The resulting models learn multiple valid approaches to medical problems—essential for handling the inherent uncertainty in clinical diagnosis where multiple reasoning paths can lead to correct conclusions.
From Data to Deployment: The Training Pipeline

Once you have reasoning data, the actual training follows a two-stage process:
Stage 1: Supervised Fine-Tuning (SFT)
*# Simplified SFT setup*
def format_for_sft(reasoning_data):
return [
{
"input": problem.question,
"output": f"<think>{problem.reasoning}</think>\n{problem.answer}"
}
for problem in reasoning_data
]Key Considerations:
- Balance reasoning length (too short = uninformative, too long = rambling)
- Maintain special tokens (<think>, <backtrack>)
- Mix reasoning data with standard Q&A to prevent forgetting
This carefully formatted, well-balanced data ensures models learn the structure of reasoning- when to think, when to backtrack, when to conclude, etc, all while retaining their base medical knowledge.
Stage 2: Reinforcement Learning with Reasoning Rewards
Reward Design:
def compute_reward(output, ground_truth, prm_model):
*# Extract reasoning and answer*
reasoning, answer = parse_output(output)
*# Composite reward*
correctness_reward = 1.0 if answer == ground_truth else 0.0
reasoning_quality = prm_model.score(reasoning)
*# Optional: Weighted combination*
return 0.3 * correctness_reward + 0.7 * reasoning_qualityWhy weight reasoning quality higher? Because we want models that show their work, even if they occasionally make mistakes. A well-reasoned wrong answer is more valuable than an unexplained correct one. Reward shaping like this is what transforms models from answer-generators into reasoning systems that can show their work- an essential requirement for clinical deployment where transparency is essential
Conclusion
Training models to reason represents a fundamental shift in how we build AI systems. The path from simple pattern matching to genuine reasoning requires:
- Sophisticated data generation pipelines
- Verifiers that understand process, not just outcomes
- Training methods that reward transparency
- Careful balance between exploration and exploitation
The techniques we've explored, verifier-guided generation, knowledge grounding, MCTS with PRMs, and synthetic data scaling each contribute pieces to the puzzle. The exciting part? We're just beginning to understand how to teach machines to think.
The medical domain has proven an excellent laboratory for these advances, but the principles generalize. Whether you're building legal reasoners, financial analysts, or scientific discovery systems, the same challenges apply: generating high-quality reasoning data is the foundation of reasoning AI.