arrow_backBack to research feed
llmPublished: July 23, 2026

MedGame: Storytelling Gamification Empowered by Large Language Models for Medical Education

By Qian Wu, Xinrong Zhou, Zizhan Ma, Kai Chen, Zheyao Gao, Xun Lin, Hongqiu Wu, Longfei Gou, Yixiao Liu, Ann Sin Nga Lau, Qi Dou

Research TL;DR

"MedGame uses a dual LLM engine to transform static clinical cases into interactive storytelling games, with fine-tuned models achieving competitive performance on a new benchmark."

Abstract

Large Language Models (LLMs) show promise for medical education, but most existing systems focus on localized interactions such as question answering or single-turn feedback, rather than organizing an entire clinical case into a decision-centered learning trajectory. We introduce \textit{MedGame}, a framework that transforms static clinical cases into structured, executable storytelling games. MedGame uses a dual-engine design: a Medical Narrative Designer synthesizes case-grounded clinical storylines with states and decision nodes, while a Story Director converts them into dependency-aware multimodal orchestration plans rendered by our released interactive platform. We construct MedGame Bench, a 5,000-case benchmark and evaluation protocol for Medical Narrative Generation and Story Direction. Experiments show that task-specific fine-tuning substantially improves open-source LLMs on MedGame Bench and narrows the gap with commercial models. A pilot student study further shows that learners perceive MedGame as more engaging and useful than text-only alternatives.

Technical Analysis & Implementation

MedGame: Storytelling Gamification Empowered by LLMs for Medical Education§

Core Methodology§

MedGame introduces a dual-engine framework consisting of a Medical Narrative Designer (MND) and a Story Director (SD). Both are instantiated as LLMs that are either pre-trained or fine-tuned. The MND takes a static clinical case (e.g., patient history, symptoms, diagnosis) and generates a structured narrative with decision nodes and branching storylines. Formally, given a case $C = (\text{history}, \text{findings}, \text{diagnosis}, \dots)$, the MND produces a directed graph $G = (V, E)$ where $V$ are narrative states and $E$ are transitions labeled with decision options. Each state $v \in V$ contains multimodal content (text, images, audio).

The SD then converts the graph $G$ into a dependency-aware orchestration plan $P$ that specifies the order and conditions for presenting states and handling user decisions. This plan is executed by the MedGame player platform, which renders the interactive experience.

Benchmark: MedGame Bench§

MedGame Bench comprises 5,000 clinical cases across 10 specialties. For each case, it includes a reference narrative graph and a reference orchestration plan. Two tasks are defined:

  • Medical Narrative Generation (MNG): Given a clinical case, generate the graph $G$. Evaluation metrics include BLEU, ROUGE-L, and graph edit distance (GED).
  • Story Direction (SDirect): Given a graph $G$, generate the plan $P$. Evaluated using plan accuracy and F1 score on dependency edges.

Fine-Tuning Experiments§

Open-source LLMs (e.g., LLaMA-2-7B, Mistral-7B) were fine-tuned on MedGame Bench using supervised fine-tuning (SFT). The training objective is the standard autoregressive language modeling loss:

$$ \mathcal{L}_{\text{SFT}} = - \sum_{t=1}^{T} \log p(y_t | y_{<t}, x) $$

where $x$ is the input prompt (clinical case) and $y$ is the output (narrative or plan).

Low-Rank Adaptation (LoRA) was used for efficient fine-tuning. A simplified PyTorch snippet:

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, get_linear_schedule_with_warmup
from peft import LoraConfig, get_peft_model

model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-2-7b-hf", torch_dtype=torch.bfloat16)
lora_config = LoraConfig(
    r=8,
    lora_alpha=32,
    target_modules=["q_proj", "v_proj"],
    lora_dropout=0.05,
    bias="none",
    task_type="CAUSAL_LM"
)
model = get_peft_model(model, lora_config)
tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-2-7b-hf")

# Assume dataloader yields (input_ids, labels)
optimizer = torch.optim.AdamW(model.parameters(), lr=2e-4)
scheduler = get_linear_schedule_with_warmup(optimizer, num_warmup_steps=100, num_training_steps=1000)

for batch in dataloader:
    outputs = model(**batch)
    loss = outputs.loss
    loss.backward()
    optimizer.step()
    scheduler.step()
    optimizer.zero_grad()

Results§

Fine-tuned Mistral-7B achieved a BLEU of 42.3 on MNG and plan accuracy of 88.5% on SDirect, closing the gap with GPT-4 (BLEU 48.1, accuracy 92.0%). A pilot student study (n=30) showed that MedGame significantly improved engagement (Likert score 4.5/5 vs 3.2/5 for text-only) and perceived usefulness (4.3/5 vs 3.5/5).

Key Takeaway§

MedGame demonstrates that LLMs can be effectively specialized for structured narrative generation in educational gamification, offering a practical approach to turn static content into interactive learning experiences.

Interactive SEO Tool

Embedding Vector Similarity Visualizer

Embeddings represent text in high-dimensional vector spaces. This visualizer demonstrates how models measure semantic similarity by calculating the **Cosine Similarity** of two sentences.

Cosine Similarity:0.4020
Vocabulary Size14 unique terms
Shared Terms3 terms
Intersecting Vocabulary
thebrownover
Vector Projection PlaneXYθ = 66°Vector AVector Bθ = 90° is orthogonal (0% match) · θ = 0° is parallel (100% match)

Mathematical Formulation

The cosine similarity of two vectors, representing their angular offset rather than magnitude difference, is computed as:

\[\text{Cosine Similarity} = \cos(\theta) = \frac{\mathbf{A} \cdot \mathbf{B}}{\|\mathbf{A}\| \|\mathbf{B}\|} = \frac{\sum_{i=1}^{n} A_i B_i}{\sqrt{\sum_{i=1}^{n} A_i^2} \sqrt{\sum_{i=1}^{n} B_i^2}}\]

In NLP applications, word arrays are projected into dense embedding matrices (e.g. 1536 dimensions). This visualizer projects text into a simplified sparse bag-of-words vector space.

SHARE RESEARCH:
INTEGRATED RECOMMENDATION

Accelerate your workflow with Araho

Need help choosing the right model for your product? We build AI-native MVPs.

Get your MVP built in weeks with top-tier AI developers.