
The problem
Given a clinical trial report and a short statement about it, decide whether the report entails or contradicts the statement. The reports span eligibility, intervention, results and adverse events in dense medical language, and a small detail can flip the answer. This was SemEval-2024 Task 2 (NLI4CT).
How I built it
What it had to handle.
Numerical reasoning, complex semantics, clinical acronyms, and specialized syntax.
Fine-tuning.
Llama 2 and PubMedBERT fine-tuned with PEFT and LoRA for biomedical text classification.
Retrieval.
Retrieval-augmented generation for evidence retrieval and model interpretation.
One GPU.
LoRA, bfloat16, 8-bit loading and gradient checkpointing fit the 7B model on a single RTX 4090, at about 20 GB with a batch size of 8.
Baselines.
BM25 evidence retrieval, TF-IDF similarity and GPT-3.5 Turbo, to see what fine-tuning actually bought.
Results
66.74%
peak F1 score.
How this was measured
- Metric
- F1 across the two labels, entailment and contradiction.
- Data
- The NLI4CT development set from SemEval-2024 Task 2: breast cancer trial reports paired with short statements.
- Compared with
- PubMedBERT similarity 0.639 F1, TF-IDF 0.502, BM25 retrieval 0.323, GPT-3.5 Turbo zero-shot 0.058. Top submissions reached about 0.85.
- Conditions
- Llama-2-7b-chat fine-tuned with LoRA, 8-bit, on one RTX 4090.
+12%
evidence-alignment accuracy over traditional models, with RAG.
Limits and next steps
Competitive, not leading: the top submissions reached about 0.85 F1. Mine missed subtle entailments where context mattered most.
