Skip to main navigation Skip to search Skip to main content

ALPaCA: Adapting Llama for Pathology Context Analysis to enable slide-level question answering

  • Zeyu Gao
  • , Kai He
  • , Weiheng Su
  • , Xiaobo Pang
  • , Ines P. Machado
  • , Mercedes Jimenez-Linan
  • , Brian Rous
  • , Chunbao Wang
  • , Chengzu Li
  • , William McGough
  • , Shangqi Gao
  • , Di Zhang
  • , Tieliang Gong
  • , Ming Y. Lu
  • , Faisal Mahmood
  • , Mengling Feng
  • , Chen Li
  • , Mireia Crispin-Ortuzar
  • University of Cambridge
  • National University of Singapore
  • Xi'an Jiaotong University
  • Department of Pathology
  • Cambridge University Hospitals NHS Foundation Trust
  • Department of Pathology
  • The First Affiliated Hospital of Xi’an Jiaotong University
  • Language Technology Lab
  • Harvard University

Research output: Contribution to journal › Article › peer-review

Abstract

Large Vision Language Models (LVLMs) are increasingly used in computational pathology for image classification, description generation, question answering and interactive diagnostics. However, most pathology LVLMs analyse small regions of interest rather than pyramidal, gigapixel-scale whole-slide images (WSIs), limiting their use for tasks requiring whole-slide assessment across sub-regions and magnification levels. Here, we present ALPaCA (Adapting Llama for Pathology Context Analysis), a slide-level LVLM framework for WSI question answering across diverse cancer types and tissue sites. ALPaCA is trained using 35,913 WSIs with curated descriptions and 341,051 question-answer pairs from TCGA and GTEx. It combines a LongFormer vision-text adaptor with a Gaussian mixture model-based prototyping adaptor and Llama3.1. ALPaCA exceeds 90% accuracy on internal close-ended benchmarks and maintains 77–82% accuracy on independent external cohorts. Expert pathologist evaluation of open-ended responses supports its slide-level reasoning capability. Additionally, ALPaCA can be fine-tuned on organ- or disease-specific datasets, supporting specialised pathology question answering.

Original languageEnglish
Article number9943
JournalNature Communications
Volume17
Issue number1
DOIs
StatePublished - Dec 2026
Externally publishedYes

UN SDGs

This output contributes to the following UN Sustainable Development Goals (SDGs)

  1. SDG 3 - Good Health and Well-being
    SDG 3 Good Health and Well-being

Fingerprint

Dive into the research topics of 'ALPaCA: Adapting Llama for Pathology Context Analysis to enable slide-level question answering'. Together they form a unique fingerprint.

Cite this