Skip to main content
medRxiv
  • Home
  • About
  • Submit
  • ALERTS / RSS
Advanced Search

LLM-based reconstruction of longitudinal clinical trajectories in chronic liver disease

View ORCID ProfileHania Paverd, Zeyu Gao, Golnar Mahani, Margarete A. Fabre, Sarah Burge, View ORCID ProfileMatthew Hoare, Mireia Crispin-Ortuzar
doi: https://doi.org/10.64898/2026.02.10.26345124
Hania Paverd
1Early Cancer Institute, Department of Oncology, University of Cambridge, Adrian Way, CB2 0XZ, Cambridge, UK
2Centre for Genomics Research, Discovery Sciences, BioPharmaceuticals R&D, AstraZeneca, 1 Francis Crick Ave, CB2 0AA, Cambridge, UK
3Cambridge University Hospitals NHS Foundation Trust, Hills Road, Cambridge, CB2 0QQ, Cambridge, UK
4Cancer Research UK Cambridge Centre, University of Cambridge, Robinson Way, CB2 0RE, Cambridge, UK
  • Find this author on Google Scholar
  • Find this author on PubMed
  • Search for this author on this site
  • ORCID record for Hania Paverd
  • For correspondence: hmw56{at}cam.ac.uk
Zeyu Gao
1Early Cancer Institute, Department of Oncology, University of Cambridge, Adrian Way, CB2 0XZ, Cambridge, UK
4Cancer Research UK Cambridge Centre, University of Cambridge, Robinson Way, CB2 0RE, Cambridge, UK
  • Find this author on Google Scholar
  • Find this author on PubMed
  • Search for this author on this site
Golnar Mahani
1Early Cancer Institute, Department of Oncology, University of Cambridge, Adrian Way, CB2 0XZ, Cambridge, UK
4Cancer Research UK Cambridge Centre, University of Cambridge, Robinson Way, CB2 0RE, Cambridge, UK
  • Find this author on Google Scholar
  • Find this author on PubMed
  • Search for this author on this site
Margarete A. Fabre
2Centre for Genomics Research, Discovery Sciences, BioPharmaceuticals R&D, AstraZeneca, 1 Francis Crick Ave, CB2 0AA, Cambridge, UK
3Cambridge University Hospitals NHS Foundation Trust, Hills Road, Cambridge, CB2 0QQ, Cambridge, UK
5Department of Haematology, Wellcome-MRC Cambridge Stem Cell Institute, Jeffrey Cheah Biomedical Centre, University of Cambridge, Puddicombe Way, CB2 0AW, Cambridge, UK
  • Find this author on Google Scholar
  • Find this author on PubMed
  • Search for this author on this site
Sarah Burge
4Cancer Research UK Cambridge Centre, University of Cambridge, Robinson Way, CB2 0RE, Cambridge, UK
  • Find this author on Google Scholar
  • Find this author on PubMed
  • Search for this author on this site
Matthew Hoare
1Early Cancer Institute, Department of Oncology, University of Cambridge, Adrian Way, CB2 0XZ, Cambridge, UK
3Cambridge University Hospitals NHS Foundation Trust, Hills Road, Cambridge, CB2 0QQ, Cambridge, UK
4Cancer Research UK Cambridge Centre, University of Cambridge, Robinson Way, CB2 0RE, Cambridge, UK
  • Find this author on Google Scholar
  • Find this author on PubMed
  • Search for this author on this site
  • ORCID record for Matthew Hoare
Mireia Crispin-Ortuzar
1Early Cancer Institute, Department of Oncology, University of Cambridge, Adrian Way, CB2 0XZ, Cambridge, UK
4Cancer Research UK Cambridge Centre, University of Cambridge, Robinson Way, CB2 0RE, Cambridge, UK
  • Find this author on Google Scholar
  • Find this author on PubMed
  • Search for this author on this site
  • Abstract
  • Full Text
  • Info/History
  • Metrics
  • Data/Code
  • Preview PDF
Loading

Abstract

Liver cancer primarily develops in patients with chronic liver disease (CLD), yet most cases are diagnosed at advanced stages with poor prognosis. While CLD surveillance generates extensive longitudinal data, its free-text nature hinders large-scale research. To address this, we developed a scalable framework using open-source LLMs with constrained decoding to process unstructured text across radiology, pathology, and transplant assessment domains. A calibration set comprising 507 reports from 30 patients was manually annotated to benchmark four LLMs against a regular expression baseline across 70 tasks. Llama-3.3-70B performed best, exceeding 90% accuracy on 59/70 tasks, outperforming Llama-3.1-8B (a smaller variant), OpenBioLLM-70B (a medically fine-tuned model), and DeepSeek-R1-8B. Constrained decoding achieved >99.9% format adherence, far surpassing unconstrained prompting (87.4%). Applied to the full cohort, the pipeline analysed 22,493 reports to generate a patient-level database of 29,225 datapoints (35 variables, 835 patients) without manual annotation. Further analysis confirmed known liver cancer risk factors (male sex, viral hepatitis, smoking, diabetes), and allowed for reconstruction of individualised disease timelines. This work provides a scalable blueprint for transforming real-world clinical free-text into structured formats and personalised patient trajectories. Future applications have the potential to accelerate data-driven research into early cancer detection within complex pre-cancerous diseases like CLD.

Competing Interest Statement

H.P. has received research funding from AstraZeneca. Z.G. has received research funding from GE healthcare. M.A.F. is a current employee and stockholder of AstraZeneca. M.H. has received speakers fees from Sirtex medical, consultancy fees from Quotient Therapeutics, Ensocell, Boston Scientific and Spliceor, in addition to unrestricted grant support from AstraZeneca and Pfizer. M.C.O. is a co-founder and employee of 52 North Health Ltd, has received research funding from GE HealthCare, and speaking fees from GSK. The other authors declare no competing interests.

Funding Statement

This study was funded by AstraZeneca UK Limited and the NIHR BioResource (G127831).

Author Declarations

I confirm all relevant ethical guidelines have been followed, and any necessary IRB and/or ethics committee approvals have been obtained.

Yes

The details of the IRB/oversight body that provided approval or exemption for the research described are given below:

The Health and Social Care Research Ethics Committee A of the Health and Social Care Business Services Organisation gave ethical approval for this work (REC reference 20/NI/0109, IRAS 285521)

I confirm that all necessary patient/participant consent has been obtained and the appropriate institutional forms have been archived, and that any patient/participant/sample identifiers included were not known to anyone (e.g., hospital staff, patients or participants themselves) outside the research group so cannot be used to identify individuals.

Yes

I understand that all clinical trials and any other prospective interventional studies must be registered with an ICMJE-approved registry, such as ClinicalTrials.gov. I confirm that any such study reported in the manuscript has been registered and the trial registration ID is provided (note: if posting a prospective study registered retrospectively, please provide a statement in the trial ID field explaining why the study was not registered in advance).

Yes

I have followed all appropriate research reporting guidelines, such as any relevant EQUATOR Network research reporting checklist(s) and other pertinent material, if applicable.

Yes

Footnotes

  • Contributing authors: zg323{at}cam.ac.uk; gk503{at}cantab.ac.uk; margarete.fabre{at}astrazeneca.com; swb35{at}cam.ac.uk; mwh20{at}cam.ac.uk; mc973{at}cam.ac.uk;

  • We have implemented several key changes to the manuscript: - We expanded the performance metrics, adding sensitivity, specificity, precision, and F1 score metrics with bootstrapped confidence intervals for all tested models. We also included patient-level performance metrics for timeline reconstructions to provide a better real-world perspective. - We conducted a comprehensive qualitative analysis of extraction failures and model hallucinations for tasks scoring below 90%. We added supplementary tables with illustrative examples of these failure modes and expanded our discussion on mitigation strategies and acceptable error thresholds. - We introduced a quantitative comparison of the latency and computational costs associated with unconstrained prompting versus constrained decoding (Guidance and Ollama). Furthermore, we included unconstrained decoding performance in our benchmarking figures to explicitly illustrate the trade-offs and the necessity of constrained methods. - We established a public GitHub repository containing all code, prompts, processing pipelines, and regular expressions to guarantee full methodological transparency.

Data Availability

The data underlying this article cannot be published due to confidentiality considerations.

Funder Information Declared

NIHR BioResource, https://ror.org/04dmgak75, G127831
AstraZeneca UK Limited, G127831
Copyright 
The copyright holder for this preprint is the author/funder, who has granted medRxiv a license to display the preprint in perpetuity. It is made available under a CC-BY 4.0 International license.
Back to top
PreviousNext
Posted June 22, 2026.
Download PDF
Data/Code
Email

Thank you for your interest in spreading the word about medRxiv.

NOTE: Your email address is requested solely to identify you as the sender of this article.

Enter multiple addresses on separate lines or separate them with commas.
LLM-based reconstruction of longitudinal clinical trajectories in chronic liver disease
(Your Name) has forwarded a page to you from medRxiv
(Your Name) thought you would like to see this page from the medRxiv website.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
Share
LLM-based reconstruction of longitudinal clinical trajectories in chronic liver disease
Hania Paverd, Zeyu Gao, Golnar Mahani, Margarete A. Fabre, Sarah Burge, Matthew Hoare, Mireia Crispin-Ortuzar
medRxiv 2026.02.10.26345124; doi: https://doi.org/10.64898/2026.02.10.26345124
Twitter logo Facebook logo LinkedIn logo Mendeley logo
Citation Tools
LLM-based reconstruction of longitudinal clinical trajectories in chronic liver disease
Hania Paverd, Zeyu Gao, Golnar Mahani, Margarete A. Fabre, Sarah Burge, Matthew Hoare, Mireia Crispin-Ortuzar
medRxiv 2026.02.10.26345124; doi: https://doi.org/10.64898/2026.02.10.26345124

Citation Manager Formats

  • BibTeX
  • Bookends
  • EasyBib
  • EndNote (tagged)
  • EndNote 8 (xml)
  • Medlars
  • Mendeley
  • Papers
  • RefWorks Tagged
  • Ref Manager
  • RIS
  • Zotero
  • Tweet Widget
  • Facebook Like
  • Google Plus One

Subject Area

  • Transplantation
Subject Areas
All Articles
  • Addiction Medicine (617)
  • Allergy and Immunology (901)
  • Anesthesia (331)
  • Cardiovascular Medicine (4811)
  • Dentistry and Oral Medicine (479)
  • Dermatology (415)
  • Emergency Medicine (650)
  • Endocrinology (including Diabetes Mellitus and Metabolic Disease) (1627)
  • Epidemiology (15941)
  • Forensic Medicine (32)
  • Gastroenterology (1202)
  • Genetic and Genomic Medicine (7047)
  • Geriatric Medicine (733)
  • Health Economics (1065)
  • Health Informatics (5044)
  • Health Policy (1434)
  • Health Systems and Quality Improvement (1766)
  • Hematology (585)
  • HIV/AIDS (1344)
  • Infectious Diseases (except HIV/AIDS) (16291)
  • Intensive Care and Critical Care Medicine (1173)
  • Medical Education (668)
  • Medical Ethics (154)
  • Nephrology (723)
  • Neurology (7273)
  • Nursing (366)
  • Nutrition (1082)
  • Obstetrics and Gynecology (1241)
  • Occupational and Environmental Health (1005)
  • Oncology (3608)
  • Ophthalmology (1051)
  • Orthopedics (397)
  • Otolaryngology (455)
  • Pain Medicine (470)
  • Palliative Medicine (139)
  • Pathology (707)
  • Pediatrics (1798)
  • Pharmacology and Therapeutics (737)
  • Primary Care Research (767)
  • Psychiatry and Clinical Psychology (5896)
  • Public and Global Health (9752)
  • Radiology and Imaging (2421)
  • Rehabilitation Medicine and Physical Therapy (1451)
  • Respiratory Medicine (1248)
  • Rheumatology (640)
  • Sexual and Reproductive Health (771)
  • Sports Medicine (578)
  • Surgery (776)
  • Toxicology (107)
  • Transplantation (305)
  • Urology (291)