BayesPath: Reliability-Aware Bayesian Reasoning for Whole-Slide Pathology Agents
Authors: Bryan Wong, Xun Xu, Jongwoo Kim, Huazhu Fu, Nancy F. Chen, Mun Yong Yi
Organizations: Korea Advanced Institute of Science and Technology (KAIST) · Institute of Advanced Intelligence and Computing (IAIC), A*STAR · Centre for Frontier AI Research (CFAR), A*STAR
Diagnosing whole-slide images (WSIs) requires hypothesis-driven reasoning: pathologists form a differential diagnosis, seek discriminative evidence, weigh its reliability, and stop once it suffices. However, existing training-free WSI agents lack an explicit framework for such reasoning. They typically use a large language model (LLM) to aggregate the region descriptions of a multimodal LLM (MLLM), without a belief over the candidates or regard for the descriptions' reliability. Consequently, a repeated model error counts as independent evidence for an incorrect diagnosis. We introduce BayesPath, a training-free WSI agent that casts the pathologist's Scan-Look-Weigh-Decide process as reliability-aware Bayesian reasoning. An explicit belief over the candidates is updated with each observation through a reliability-aware likelihood and guides where to look next and when to stop. This likelihood corrects for the models' answer bias, discounts correlated observations, and captures diagnostic confusions estimated without labels. The updates form an interpretable evidence trail of how each observation shapes the belief. On five MultiPathQA tasks spanning slide classification and slide VQA, BayesPath achieves the highest average accuracy among training-free agents, 58.6% against 34.1% for the next best, with large gains on slide classification. On identical observations, Bayesian updating outperforms LLM aggregation on average, even with a larger LLM. BayesPath's belief is also better calibrated than naive Bayes, so uncertain cases can be deferred to pathologists. Code is available at https://github.com/bryanwong17/BayesPath
Figures & tables
Figure 2: Overview of BayesPath. (1) Scan forms the initial belief. (2) Look surveys while the belief is spread, else tests the top candidates. (3) Weigh corrects the Verifier’s answer bias and uses (a) bounded evidence for correlated views (VQA) or (b) confusion-aware evidence for systematic confusions (classification). (4) Decide answers once the top belief reaches τ or the budget ends, else reads the next view.
Slide classification (BACC)
Slide VQA (ACC)
Category
Method
Backbone
TCGA
GTEx
PANDA
ExpertVQA
SlideBench
Avg.
K=30
K=20
K=6
K=4
K=4
General MLLM Input: thumbnail
Pixtral-12B [ 1 ]
Mistral-NeMo-12B
5.1 ± 1.2
11.0 ± 3.7
15.0 ± 2.3
35.2 ± 2.1
45.5 ± 1.9
22.4 ± 2.0
Gemma-3-27B [ 39 ]
–
7.6 ± 0.4
16.8 ± 1.8
17.5 ± 0.8
37.2 ± 2.5
30.5 ± 3.2
21.9 ± 0.0
Qwen3.8-27B [ 31 ]
–
8.3 ± 3.6
29.0 ± 4.5
18.2 ± 1.7
41.7 ± 1.6
45.5 ± 0.6
28.5 ± 0.5
Medical MLLM Input: thumbnail
LLaVA-Med-7B [ 23 ]
Mistral-7B
2.9 ± 0.4
6.9 ± 1.9
10.2 ± 1.3
29.7 ± 1.4
31.8 ± 0.3
16.3 ± 0.6
Table 1: Zero-shot comparison on the five MultiPathQA tasks (%). BACC: balanced accuracy (mean per-class accuracy); ACC: accuracy. K : number of candidates. Best in bold , second underlined ; ∗ trained on in-domain (TCGA) data, for reference. Mean ± std of three runs.
Slide classification
Slide VQA
Combine
BC
BE
CE
BV
TCGA
GTEx
PANDA
Expert VQA
Slide Bench
Avg.
Qwen3-4B
✓
24.8
55.1
21.5
43.8
55.7
40.2
Qwen3.8-27B
✓
36.8
68.0
22.1
48.7
55.8
46.3
Bayes’ rule
✓
✓
36.0
65.9
21.9
44.3
54.7
44.6
Bayes’ rule
✓
✓
✓
73.0
79.8
26.2
47.7 †
58.4 †
57.0
Bayes’ rule
✓
✓
✓
74.2
83.1
27.3
43.5
57.9
57.2
Table 2: Ablation of BayesPath (%). Combine: rule that combines the Scan and observations. BC: bias correction (with BC alone, Bayes’ rule is naive Bayes). BE: bounded evidence. CE: confusion-aware evidence. BV: belief-guided views (else question-similarity views). † Same as BayesPath, which uses BE on slide VQA.
Figure 3: BayesPath versus LLM reasoning and naive Bayes. (a) BayesPath leads for every number of candidates. (b) PathAgent stops too early: its first-round answers (grey) are less accurate than BayesPath’s most confident ones on as many questions (blue). (c) Ranked by confidence, BayesPath’s top answers are the most accurate. (d) Naive Bayes grows overconfident; BayesPath stays calibrated.
Slide classification
Slide VQA
Metric
Rule
TCGA
GTEx
PANDA
ExpertVQA
SlideBench
ECE ↓
Naive Bayes
0.527
0.331
0.671
0.545
0.436
BayesPath
0.103
0.066
0.127
0.116
0.088
AURC ↓
LLM aggregation
0.488
0.179
0.756
0.399
0.268
Naive Bayes
0.329
0.186
0.772
0.463
0.367
BayesPath
0.110
0.084
0.728
0.376
0.267
Table 3: Trusting the belief on BayesPath’s evidence; ↓ : lower is better. LLM aggregation keeps no belief, so it has no ECE.
Figure 4: Evidence trails of BayesPath. PathAgent and PathNavigate trust every MLLM reading and answer with its misreading. Top, bounded evidence : views misread as adenocarcinoma barely lower squamous , while 20 squamous views raise it (0.25 → 0.75). Bottom, confusion-aware evidence : a label-free confusion lets views misread as lung adenocarcinoma raise ovarian serous (0.43 → 0.60).
Method
TCGA
GTEx
PANDA
ExpertVQA
SlideBench
PathAgent
15.7
43.4
22.1
41.9
54.5
PathNavigate
6.3
30.8
18.8
47.1
58.0
BayesPath
78.7
86.4
25.7
48.2
58.9
Table 4: A stronger encoder: CONCH-Z in all three agents. Mean of three seeds (%); standard deviations in Supp. Tab. S23 .
Appendix figures & tables27 assets
Supplementary material from the paper’s appendix.
Appendix
Pathologist
BayesPath
All steps
Holds a differential diagnosis
Belief bt over the candidates ( Eq. 1 )
Scan
Sweeps the slide at low power
Encoder scores every field ( Eq. 3 )
Look
Surveys while unsure [ 28 ]
Survey with probability H~(b) ( Eq. 4 )
Appendix
Table S1 : The pathologist’s process and BayesPath, step by step, with the equations of the main paper.
Notation
Definition
Inputs and belief
x , H={h1,…,hK}
Question and its K candidate answers
v0 , F , f
Thumbnail, 5 × fields of the tissue grid, one field
vt , ot
View t∈{0,…,T} and its observation
T
View budget after the thumbnail ( T+1 views in all)
bt(k)
Belief in hk after view t ( Eq. 1 )
Appendix
Table S2 : Notation by step, with the defining equation of the main paper.
Figure S1 : The Observer’s confusions on GTEx. (a) Learned by EM without labels ( Eq. 9 ). (b) True confusions of the same votes (evaluation only). Rows: true organ; columns: organ voted for. EM recovers the main misreadings, e.g . heart read as muscle.
Agent
Choose views
Describe views
Combine observations
Stop
GIANT [ 4 ]
Patho-R1-7B
Patho-R1-7B
Patho-R1-7B
MLLM decides
PathAgent [ 7 ]
CONCH
Patho-R1-7B
Qwen3-4B
LLM judges sufficiency
PathNavigate [ 49 ]
CONCH
Patho-R1-7B
Qwen3-4B
fixed budget of 15 views
BayesPath
CONCH + belief
Patho-R1-7B
Qwen3-Reranker-4B + belief
belief ≥τ
Appendix
Table S4 : Training-free WSI agents of Tab. 1 : frozen models and stopping rule. Belief: BayesPath’s belief over the candidates.
Task
Question
K
Questions
Slides
Metric
TCGA [ 42 ]
cancer type
30
221
221
BACC
GTEx [ 6 ]
organ of normal tissue
20
190
190
BACC
PANDA [ 5 ]
ISUP grade
6
196
196
BACC
ExpertVQA [ 4 ]
pathologist-written
4
128
76
ACC
SlideBench [ 10 ]
SlideBench-VQA (TCGA)
4
197
183
ACC
Appendix
Table S3 : Tasks : questions, slides, candidates K and metric.
Parameter
Value
View budget T (after the thumbnail)
25
Decide threshold τ
0.95
Minimum belief mass of the rivals D , m
0.95
Field (level 0) / image sent to the Observer
4096 / 1024 pixels
Sub-fields per field
4×4
Minimum tissue in a sub-field
50%
Appendix
Table S5 : Parameters of BayesPath, shared by all five tasks.
Combine
BC
BE
CE
Evidence
Views
Qwen3-4B
y^=LLM(x,H,b−1,o0:T)
belief
Qwen3.8-27B
belief
Bayes’ rule
✓
∏tλtk (naive Bayes)
belief
Bayes’ rule
✓
✓
LTkbound
belief
Bayes’ rule
✓
✓
✓
LTkconf ; LTkbound in slide VQA
similarity
BayesPath
✓
✓
✓
LTkconf ; LTkbound in slide VQA
belief
Appendix
Table S6 : Ablation of BayesPath as equations, rows as in Tab. 2 . Bayes’ rule computes bT(k)∝b−1(k)⋅Evidence , with Lbound and Lconf from Eqs. 8 and 10 ; LLM aggregation answers from the observations directly. BC: bias correction. BE: bounded evidence. CE: confusion-aware evidence. Views: belief-guided ( Eq. 5 ) or by similarity cos(e(v),e(x)) to the question.
Figure S2 : Accuracy on each class (three seeds pooled), sorted by the accuracy of BayesPath. BayesPath matches or exceeds both agents on 29 of 30 TCGA and 18 of 20 GTEx classes. TCGA classes are labelled by project code.
Comparison
Δ
95% CI
McNemar p
TCGA: BayesPath − LLM aggregation
+50.5
[46.7, 54.4]
1.3e-15
TCGA: BayesPath − naive Bayes
+39.3
[35.2, 43.7]
1.1e-10
GTEx: BayesPath − LLM aggregation
+28.3
[24.1, 32.7]
2.2e-10
GTEx: BayesPath − naive Bayes
+17.5
[13.6, 21.9]
2.2e-07
TCGA: BayesPath − PathAgent
+60.8
[56.7, 65.0]
5.7e-23
TCGA: BayesPath − PathNavigate
+69.1
[64.9, 73.2]
8.6e-35
Appendix
Table S7 : Paired comparisons on the same slides. Δ : gain of BayesPath in BACC (classification) or reduction in AURC (slide VQA, last two rows; lower is better, Tab. 3 ), computed before rounding, so it can differ by 0.1 from the difference of rounded entries. CI: patient-level bootstrap 95% interval (2,000 resamples). p : largest exact McNemar p of three seeds (classification only).
TCGA ( K=30 )
GTEx ( K=20 )
Method
Used
Top-3
Hit
Used
Top-3
Hit
PathAgent
22
69%
50%
19
45%
80%
PathNavigate
17
89%
30%
18
45%
80%
BayesPath
30
21%
97%
20
29%
100%
Appendix
Table S8 : Where the answers go (three seeds pooled). Used: candidates ever predicted. Top-3: answers on the three most frequent candidates. Hit: classes answered correctly at least once.
Aggregation
Acc ↑
BACC ↑
ECE ↓
Brier ↓
NLL ↓
Conf.
✓
✗ ↓
LLM aggregation
33.9
24.8
–
–
–
–
–
Raw product
30.9
20.9
0.687
1.38
9.30
99.6
99.6
Naive Bayes
41.6
36.0
0.527
1.09
7.09
98.0
91.7
BayesPath
69.8
75.3
0.103
0.44
1.16
68.5
41.9
Appendix
Table S9 : Same-evidence aggregation on TCGA, extending Tab. 2 . Mean of three seeds. Conf.: mean confidence on correct (✓) and wrong (✗) answers.
Aggregation
Acc ↑
BACC ↑
ECE ↓
Brier ↓
NLL ↓
Conf.
✓
✗ ↓
LLM aggregation
56.3
55.1
–
–
–
–
–
Raw product
56.0
54.6
0.429
0.86
5.82
99.3
97.7
Naive Bayes
65.8
65.9
0.331
0.67
4.23
99.4
97.5
BayesPath
81.2
83.4
0.066
0.28
0.85
90.3
60.6
Appendix
Table S10 : Same-evidence aggregation on GTEx, extending Tab. 2 . Mean of three seeds. Conf.: mean confidence on correct (✓) and wrong (✗) answers.
System prompt both prompts
You are an expert pathologist. You are given the reports written while examining one H&E whole-slide image, view by view, and a multiple-choice question about the slide. Keep an explicit probability over the options. Start from the low-power scan if one is given, otherwise from equal probabilities. Go through the views in order and, after each view, update the probabilities of the options it bears on, in one short line. Finish with exactly one line: FINAL: <option letter> <probability of that option, between 0 and 1>
Added to the system prompt reliability prompt only
The reports come from one imperfect model looking at one specimen. It tends to repeat the same mistake in view after view and to overuse some diagnoses, so the views are not independent: repeated mentions of a diagnosis must not be counted as separate evidence.
User message both prompts
[Low-power scan] † A pathology encoder (CONCH, zero-shot) scored all tissue fields of the slide. Probability of the most likely options: - { option } : { probability } [View 1] { observation o0 } [View 2] { observation o1 } … [View T+1 ] { observation oT } Question: { question } Options: A. { option 1 } B. { option 2 } … Answer:
Appendix
Figure S3 : Belief and reliability prompts for LLM aggregation ( Tab. S11 ). o0 : observation of the thumbnail; T : view budget. † Slide classification only; it lists the five most likely options.
Rule
TCGA
GTEx
PANDA
EVQA
SB
Avg.
Qwen3-4B aggregation
24.8
55.1
21.5
43.8
55.7
40.2
belief prompt
21.9
51.2
20.2
45.6
53.1
38.4
reliability prompt
22.6
53.3
24.0
44.8
54.1
39.8
Qwen3.8-27B aggregation
36.8
68.0
22.1
48.7
55.8
46.3
belief prompt
44.6
66.8
20.3
48.4
54.8
47.0
reliability prompt
47.7
68.7
21.7
47.7
55.3
48.2
Appendix
Table S11 : Keeping a belief inside the LLM (evidence of Tab. 2 ). Mean of three seeds (%). EVQA: ExpertVQA; SB: SlideBench.
TCGA
GTEx
Rule
K=4
10
20
30
K=4
10
20
LLM aggregation
65.3
47.6
33.2
24.8
77.1
62.9
55.1
Naive Bayes
68.5
50.0
41.6
36.0
88.0
73.6
65.9
BayesPath
92.6
83.5
77.8
75.3
94.4
85.8
83.4
Margin over LLM
+27.3
+35.9
+44.7
+50.5
+17.3
+22.9
+28.3
Appendix
Table S12 : Fewer candidates on the evidence of Tab. 2 : the true answer and K−1 random distractors; the last column of each task has all candidates. Mean of three seeds (BACC, %).
Rule
TCGA ↓
GTEx ↓
PANDA ↓
EVQA ↓
SB ↓
LLM aggr. (Qwen3-4B)
31.7
31.1
32.7
26.1
20.8
LLM aggr. (Qwen3.8-27B)
7.2
9.7
26.1
13.0
13.1
Naive Bayes
0.0
0.0
0.0
0.0
0.0
BayesPath
0.0
0.0
0.0
0.0
0.0
Appendix
Table S13 : Reversed view order. Answers that change when the observations are read in reverse; ↓ : lower is better. Mean of three seeds (%). EVQA: ExpertVQA; SB: SlideBench.
20 × views
TCGA
GTEx
ExpertVQA
SlideBench
chance ( 1/K )
3.3
5.0
25.0
25.0
similarity views
23.8
39.6
32.2
50.5
BayesPath (belief)
40.4
47.5
35.1
59.9
Appendix
Table S14 : Belief-guided views at 20 × (three seeds pooled, %): share of views whose observation points to the true answer. Similarity views rank the 20 × views by similarity to the question ( Tab. 2 ). Labels are used only for this analysis.
TCGA
GTEx
PANDA
EVQA
SB
Most confident
NB
BP
NB
BP
NB
BP
NB
BP
NB
BP
10%
93.3
100.0
87.1
89.5
23.3
30.0
59.3
82.1
68.1
91.7
20%
89.4
100.0
87.5
94.7
21.4
30.8
59.0
70.5
68.1
84.6
30%
80.8
96.5
87.5
94.7
23.2
28.8
59.2
67.5
68.1
81.4
Appendix
Table S15 : Accuracy of the most confident answers, ranked by maxkb(k) . Mean of three seeds (%). EVQA: ExpertVQA; SB: SlideBench; NB: naive Bayes; BP: BayesPath.
TCGA
GTEx
PANDA
ExpertVQA
SlideBench
Slides (%)
90.0
80.5
95.1
93.2
87.3
Views
11.7
7.6
9.6
10.4
9.1
Appendix
Table S16 : The Observer repeats its mistakes. Each view votes for the answer the Verifier scores highest. Slides: share of slides on which at least three views vote for the same wrong answer (%). Views: average number of views per slide that vote for the most frequent wrong answer. Mean of three seeds.
Likelihood
BC
BE
CM
TCGA
GTEx
PANDA
Raw product
20.9
54.6
21.8
Naive Bayes
✓
36.0
65.9
21.9
Bounded evidence (a)
✓
✓
73.0
79.8
26.2
BayesPath (b)
✓
✓
✓
75.3
83.4
28.2
Appendix
Table S17 : Parts of the likelihood on slide classification (BACC, %). BC: bias correction. BE: bounded evidence (a). CM: confusion matrix, i.e . confusion-aware evidence (b). Mean of three seeds.
Estimated from
TCGA
GTEx
Other half of the test slides (BayesPath)
75.3
83.4
253 slides of the slide VQA tasks
74.2
–
Appendix
Table S18 : Label-free statistics from other slides (BACC, %). The answer biases and B are estimated from the other half of the test slides (default) or only from TCGA slides of the slide VQA tasks, which do not overlap with the classification set. GTEx has no such slides. Mean of three seeds.
Figure S4 : More evidence trails of BayesPath. Top, bounded evidence : views read as a stellate scar, favouring focal nodular hyperplasia , barely lower hepatocellular carcinoma , while views of malignant features (trabeculae more than three cells thick, nuclear atypia) and a 20 × view without fibrous septa raise it (0.25 → 0.72). Bottom, confusion-aware evidence : most views are read as lung adenocarcinoma . The label-free confusions show that views of prostate adenocarcinoma slides vote lung adenocarcinoma more often (60%) than views of lung adenocarcinoma (54%) or uveal melanoma slides (25%), so these votes raise prostate adenocarcinoma (0.38 → 0.49).
Task
r↑
cos ↑
KL ↓
TCGA
0.78
0.83
0.27
GTEx
0.75
0.91
0.18
Appendix
Table S19 : Label-free against true confusions. B , estimated without labels on one half of the slides, against the true confusions of the votes on the other half (labels used for this check only). r : Pearson correlation of off-diagonal entries; cos: cosine and KL: KL divergence of the rows.
Rule
TCGA ↓
GTEx ↓
PANDA ↓
LLM aggregation
15.5
8.6
27.0
Naive Bayes
59.4
30.7
48.6
BayesPath
8.9
5.8
6.1
Appendix
Table S20 : Repeated views. Share of answers that change when one observation is copied 16 times (slide classification, %); ↓ : lower is better. Mean of three seeds.
TCGA
GTEx
PANDA
EVQA
SB
ECE ↓
Naive Bayes
0.527
0.331
0.671
0.545
0.436
BayesPath
0.103
0.066
0.127
0.116
0.088
Brier ↓
Naive Bayes
1.09
0.67
1.40
1.09
0.87
BayesPath
0.44
0.28
0.85
0.66
0.55
Appendix
Table S21 : Calibration of the final belief on the same evidence; ↓ : lower is better. ECE: ten bins of the confidence of the answer; Brier: squared error of the full belief. Mean of three seeds. EVQA: ExpertVQA; SB: SlideBench.
PathAgent
PathNavigate
BayesPath
Observer
TCGA
GTEx
TCGA
GTEx
TCGA
GTEx
Patho-R1-7B (default)
14.5
45.0
6.2
33.3
75.3
83.4
Quilt-LLaVA [ 34 ]
6.8
33.4
4.4
11.9
71.5
84.0
PathGen-LLaVA [ 38 ]
13.0
53.3
6.8
41.5
72.1
84.9
Appendix
Table S22 : Other Observers on slide classification (BACC, %): the Observer of all three agents is replaced, without training. Mean of three seeds.
Method
TCGA
GTEx
PANDA
EVQA
SB
PathAgent
15.7 ± 2.5
43.4 ± 5.5
22.1 ± 1.5
41.9 ± 2.1
54.5 ± 1.5
PathNavigate
6.3 ± 1.5
30.8 ± 3.0
18.8 ± 0.9
47.1 ± 0.5
58.0 ± 0.6
BayesPath
78.7 ± 1.0
86.4 ± 0.3
25.7 ± 0.6
48.2 ± 5.0
58.9 ± 2.0
Appendix
Table S23 : A stronger encoder: Tab. 4 with mean ± std of three seeds (%). EVQA: ExpertVQA; SB: SlideBench.
1Korea Advanced Institute of Science and Technology (KAIST) · Institute of Advanced Intelligence and Computing (IAIC), A*STAR · Centre for Frontier AI Research (CFAR), A*STAR