Automating Radiology Report Generation with Fine-tuned LLMs

heidelberg_university · Healthcare · 2024 · source Agentic: no · promotional bias: low · source-backed · extracted with prompt 0.5.4 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Radiology report generation

Heidelberg University researchers wanted to generate detailed radiology reports from radiologist impressions and medical imaging context while reducing radiologist workload and fitting training onto limited GPU resources.

Constraints:

Architecture

The research pipeline frames the radiologist impression as an instruction and the detailed report as the response using the Alpaca prompt format for Llama. The team fine-tuned Llama 3 with supervised fine-tuning, 4-bit quantization, LoRA-style parameter-efficient fine-tuning, a 5K-token sequence length, and Hugging Face tooling on a single RTX 5000 GPU. Evaluation used training/validation loss, BLEU scores, and human review by senior radiologists.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  radiologist-impression-input[Radiologist impression input] --> alpaca-prompt-formatter[Alpaca prompt formatter]
  alpaca-prompt-formatter --> fine-tuned-llama-3-model[Fine-tuned Llama 3 model]
  quantization-and-lora-stack[Quantization and LoRA stack] --> fine-tuned-llama-3-model
  fine-tuned-llama-3-model --> evaluation-harness[Evaluation harness]
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Radiologist impression input Supplies the concise clinical finding summary used as the instruction. Alpaca prompt formatter
Alpaca prompt formatter Transforms impression/report pairs into instruction-response training examples. Radiologist impression input, Fine-tuned Llama 3 model
Fine-tuned Llama 3 model Generates detailed radiology reports from formatted impressions. Alpaca prompt formatter, Quantization and LoRA stack, Evaluation harness
Quantization and LoRA stack Reduces model size and trainable parameters so training can run on limited hardware. Fine-tuned Llama 3 model
Evaluation harness Measures losses, BLEU scores, and supports radiologist review. Fine-tuned Llama 3 model

Data flow

Radiologist impressions are formatted as Alpaca instructions, paired with detailed reports as responses, and used for supervised fine-tuning. Quantization reduces model size, LoRA updates a small parameter subset, and the fine-tuned Llama 3 model generates detailed report text that is evaluated with loss, BLEU, and radiologist review.

4 supporting quotes
“in in our case the instruction is the radiologist impression and the response is the detailed report so Alpa format”transcript, stated
“is the detailed report so Alpa format efficient efficiently lets llm know to use the instruction as an input and learn the response uh the next step is is”transcript, stated
“methods we have fine-tuned Lama 3 uh I'd like to show you the capacity of of one of our machines to give you an idea of”transcript, stated
“5,000 tokens we trained the model using RTX 5000 GPU uh for 2,000 EPO we used supervised fine tuning trainer from”transcript, stated

Why this architecture

The team chose instruction fine-tuning from impressions to detailed reports because they wanted the model to expand a concise radiologist summary into a full report, not summarize a report. Quantization and LoRA were necessary to make Llama 3 fine-tuning practical on a single RTX 5000 GPU, with an explicit tradeoff between efficiency and possible accuracy loss.

3 supporting quotes
“we are try we have tried the other way around because we we wanted to make sure uh we don't want to load over Lo our whole architecture”transcript, stated
“4-bit quantized models as well we chose maximum sequence length as 5 5K tokens as on average our reports have less than 5,000 tokens we trained the model using”transcript, stated
“uh how these techniques could make an llm lighter that it can be trained on a single GPU with minimal to decent”transcript, stated

Models used: Llama 3 · 4-bit quantized Llama 3 · LoRA parameter-efficient fine-tuning

Scale

Alternatives considered (roads not taken)

Generate summary impressions from detailed reports

Rejected because: The researchers explicitly tried the opposite direction: detailed report from impression.

“researchers have tried to generate the summary of the report from the detailed report uh we are try we have tried the other way around”transcript, stated

Full-precision fine-tuning

Rejected because: Quantization reduced model size, inference time, training cost, and power consumption.

“numerical values we can significantly decrease the model size resulting to a faster inference times and lower training cost without a substantial loss”transcript, stated

Fine-tune all parameters

Rejected because: Parameter-efficient fine-tuning reduced compute burden while preserving model capacity.

“language models by updating only a minimal subset of model parameters this makes the process more efficient and”transcript, stated
“reducing the computer burden on fine tuning it reduces the number of trainable parameters while preserving the model”transcript, stated

Patterns

fine-tuning-adaptation (modeling)

The team fine-tuned Llama 3 on radiology impression-to-report examples.

“using all the discussed methods we have fine-tuned Lama 3”transcript, stated

structured-output-contract (prompting)

The Alpaca format structures each training example as instruction and response.

“the instruction is the radiologist impression and the response is the detailed report”transcript, stated

cost-aware-routing (operations)

Quantization and LoRA reduce compute, memory, and training cost.

“lower training cost without a substantial loss in the performance”transcript, stated

eval-driven-development (evaluation)

The team reported training/validation loss, BLEU scores, and human radiologist evaluation.

“we have achieved a training loss 072 and the validation loss of 1.36”transcript, stated

Tradeoffs

Use impressions as input

Chose generate detailed reports from radiologist impressions over generate impressions from full reports.

Rationale: The team wanted to avoid overloading the architecture and target detailed-report generation.

“we have tried the other way around because we we wanted to make sure uh we don't want to load over Lo our whole architecture”transcript, stated

Use PEFT/LoRA

Chose train low-rank matrices while freezing original weights over full model updates.

Rationale: LoRA reduced trainable parameters and compute burden while preserving capacity.

“only these decomposed low rank matrices are trained while the original model weights remain Frozen”transcript, stated

Gotchas (what bit them)

Quantization trades efficiency against accuracy.

Root cause: Reducing numerical precision can slightly reduce model accuracy.

Resolution: The team used 4-bit quantization while acknowledging the tradeoff.

“it is important to trade-off reducing reducing Precision may lead to slight decrease in accuracy”transcript, stated

BLEU is an incomplete radiology quality metric.

Root cause: BLEU only compares whether words appear in the generated text.

Resolution: The case also mentions human evaluation by senior radiologists.

“blue only Compares if the word appeared in the generation or not”transcript, stated
“radiologist at the hospital”transcript, stated

Evaluation

The research evaluates with training loss, validation loss, BLEU on training and validation data, and human senior-radiologist evaluation.

Metrics: training loss · validation loss · training BLEU · validation BLEU · human radiologist review

“training loss 072 and the validation loss of 1.36”transcript, stated
“average blue score training data was 0.69 and on the validation data it was it was 0.33”transcript, stated

Outcomes

Reports average up to 5,000 tokens, and the setup uses a 5K-token sequence length on a single GPU.

“it can be trained on a single GPU with minimal to decent configuration”transcript, stated
“which is not a bad metric as the blue only Compares if the word appeared in the generation or not”transcript, stated