Back

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

Gao, Z.; He, K.; Su, W.; Machado, I. P.; McGough, W.; Jimenez-Linan, M.; Rous, B.; Wang, C.; Li, C.; Pang, X.; Gong, T.; Lu, M. Y.; Mahmood, F.; Feng, M.; Li, C.; Crispin-Ortuzar, M.

2025-04-22 pathology
10.1101/2025.04.22.25326190 medRxiv
Show abstract

Large Vision Language Models (LVLMs) have recently revolutionized computational pathology. LVLMs transform pathology image embeddings into tokens recognizable by large language models, facilitating zero-shot image classification, description generation, question answering, and interactive diagnostics. In clinical practice, pathological assessments often require the analysis of entire tissue slides, integrating information from multiple sub-regions and magnification levels. However, existing LVLM frameworks have been restricted to the analysis of small, predefined regions of interest, lacking the ability to analyze pyramidal, gigapixel-scale whole-slide images (WSIs). In this work, we introduce ALPaCA (Adapting Llama for Pathology Context Analysis), and train the first general-purpose slide-level LVLM, leveraging 35,913 WSIs with curated descriptions alongside 341,051 question and answer pairs encompassing diverse diagnoses, procedures, and tissue types. By developing LongFormer, a vision-text interactive slide-level adaptor, and integrating it with a Gaussian mixture model-based prototyping adaptor, followed by training with Llama3.1, ALPaCA achieves superior performance in slide-level question answering, achieving over 90% accuracy in close-ended tests and high accuracy in open-ended questions as evaluated by expert pathologists, highlighting its potential for slide-level computer-aided diagnosis systems. Additionally, we show that ALPaCA can be readily fine-tuned on in-depth, organ-specific, or disease-specific datasets, underscoring its adaptability and utility for specialized pathology tasks.

Matching journals

The top 4 journals account for 50% of the predicted probability mass.

1
Modern Pathology
21 papers in training set
Top 0.1%
29.0%
2
Nature Communications
4913 papers in training set
Top 20%
9.6%
3
npj Digital Medicine
97 papers in training set
Top 0.5%
9.6%
4
Journal of Pathology Informatics
13 papers in training set
Top 0.1%
8.8%
50% of probability mass above
5
Nature Methods
336 papers in training set
Top 2%
4.2%
6
The Lancet Digital Health
25 papers in training set
Top 0.2%
2.7%
7
Medical Image Analysis
33 papers in training set
Top 0.5%
2.0%
8
Nature Medicine
117 papers in training set
Top 2%
2.0%
9
Scientific Reports
3102 papers in training set
Top 54%
1.9%
10
Nature Machine Intelligence
61 papers in training set
Top 2%
1.8%
11
Science Translational Medicine
111 papers in training set
Top 2%
1.7%
12
Cell Reports Medicine
140 papers in training set
Top 5%
1.4%
13
eBioMedicine
130 papers in training set
Top 2%
1.3%
14
npj Precision Oncology
48 papers in training set
Top 0.9%
1.0%
15
iScience
1063 papers in training set
Top 24%
1.0%
16
Advanced Science
249 papers in training set
Top 15%
1.0%
17
Cancer Research
116 papers in training set
Top 3%
1.0%
18
PLOS ONE
4510 papers in training set
Top 63%
0.9%
19
Clinical Cancer Research
58 papers in training set
Top 2%
0.8%
20
Communications Biology
886 papers in training set
Top 22%
0.8%
21
Proceedings of the National Academy of Sciences
2130 papers in training set
Top 43%
0.8%
22
eLife
5422 papers in training set
Top 56%
0.8%
23
IEEE Journal of Biomedical and Health Informatics
34 papers in training set
Top 2%
0.8%
24
Nature
575 papers in training set
Top 17%
0.7%
25
The Lancet Infectious Diseases
71 papers in training set
Top 3%
0.7%
26
Breast Cancer Research
32 papers in training set
Top 0.6%
0.5%
27
BMC Medicine
163 papers in training set
Top 8%
0.5%
28
Laboratory Investigation
13 papers in training set
Top 0.4%
0.5%
29
Frontiers in Bioinformatics
45 papers in training set
Top 1%
0.5%