Single-Pass Decision Scores Enable Rapid Classification with Adjustable Thresholds in Medical Multimodal Large Language Models
Authors: Patrick Wienholt, Frederik Hauke, Christiane Kuhl, Jakob Nikolas Kather, Sven Nebelung, Daniel Truhn
Organizations: Lab for Artificial Intelligence in Medicine, Department of Diagnostic and Interventional Radiology, University Hospital RWTH Aachen, Aachen, Germany. · Department of Diagnostic and Interventional Radiology, University Hospital RWTH Aachen, Aachen, Germany. · Department of Medical Oncology, National Center for Tumor Diseases (NCT), Heidelberg University Hospital, Heidelberg, Germany. · Else Kroener Fresenius Center for Digital Health, Technical University Dresden, Dresden, Germany. · Department of Medicine I, Faculty of Medicine and University Hospital Carl Gustav Carus, TUD Dresden University of Technology, Dresden, Germany.
Multimodal large language models (MLLMs) answer binary clinical questions with a yes or no token, leaving the decision threshold implicit and fixed. We derive a continuous score from a single forward pass by renormalizing the probabilities of the yes and no tokens, allowing the threshold to be adapted to clinical needs without retraining. We evaluated this approach with MedGemma and Gemma-3 (4B and 27B) on six medical imaging datasets. The default threshold was frequently misaligned with the task: for identifying normal chest radiographs, MedGemma-27B labeled every image as abnormal, whereas a validation-selected threshold yielded a sensitivity of 0.945 and a specificity of 0.696. Normalization achieved the highest AUROC on four of six datasets (CheXpert: 0.819 vs. 0.777 for raw and 0.743 for text-elicited probabilities), and a single decision required 53-79 ms on one GPU. This simple post-hoc method turns medical MLLMs into fast classifiers with adjustable operating points. Code: https://github.com/TruhnLab/llm-threshold-calibration
Figures & tables
Figure 1: Workflow for threshold shifting in LLM-based binary classification. (a) An image-conditioned prompt is provided to the LLM. (b) From the first decoding step, the model assigns probabilities to all vocabulary tokens, including the verbalizers yes and no . (c) We normalize the probabilities over { yes , no } and vary the decision threshold, which has an implicit default of 0.5. (d) Sweeping the threshold yields different operating points on the ROC curve, trading true positive rate (TPR) against false positive rate (FPR). The optimal threshold was determined on a validation set disjoint from the test set.
Figure 2: Overview of the experimental setup. We evaluated the threshold-shifting method on six medical imaging datasets spanning chest radiography, dermatology, ophthalmology, and histopathology. Notably, CheXpert was explicitly excluded from the training data of the MedGemma models [ 18 ] , making it well suited for external validation. Each dataset was split into a validation set, used exclusively to select the decision threshold, and a test set, used only for the final performance evaluation. We compared four models, namely Gemma-3 and MedGemma each in a 4B and a 27B variant, using three scoring methods: the normalized yes / no token probability, the raw yes token probability, and a text-elicited probability generated directly as output. The threshold optimized on the validation set was compared against the model’s implicit default threshold of 0.5 on the test set.
Figure 3: Class-specific AUROC values for the CheXpert dataset using MedGemma-27B. The three bars for each class represent normalized token probabilities, raw token probabilities (“Unnormalized” in the legend), and text-elicited probability estimates (“Text”). Error bars indicate 95% confidence intervals. The “average” bars show the mean across classes.
Dataset
Normalized (95% CI)
Raw (95% CI)
Text-elicited (95% CI)
CheXpert
0.819 [0.794, 0.845]
0.777 [0.746, 0.807]
0.743 [0.714, 0.772]
DERM12345
0.701 [0.682, 0.719]
0.637 [0.613, 0.662]
0.547 [0.530, 0.566]
G1020
0.494 [0.437, 0.551]
0.489 [0.423, 0.555]
0.487 [0.455, 0.519]
HAM10000
0.654 [0.642, 0.666]
0.607 [0.592, 0.621]
0.542 [0.531, 0.554]
MIMIC
0.658 [0.647, 0.669]
0.666 [0.655, 0.676]
0.625 [0.616, 0.635]
NCT-CRC-HE
0.783 [0.777, 0.788]
0.796 [0.790, 0.801]
0.642 [0.638, 0.647]
Table 1: Average AUROC values computed over the test data with corresponding 95% confidence intervals for MedGemma-27B.
Raw
Text-elicited
Dataset
Normalized
Δ (95% CI)
p
Δ (95% CI)
p
CheXpert
0.819
-0.043
<.001
-0.077
<.001
[-0.057, -0.029]
[-0.095, -0.059]
DERM12345
0.701
-0.064
<.001
-0.154
<.001
[-0.086, -0.041]
[-0.175, -0.133]
G1020
0.494
-0.005
.873
-0.007
.783
Table 2: Pairwise comparison of average AUROC values computed over the test data using MedGemma-27B from Table 1 . The table shows the difference to the normalized approach. Statistically significant ( p<.0042 ) values are in bold .
Figure 4: ROC curves for selected datasets and classes using MedGemma-27B. The default threshold of 0.5, corresponding to greedy sampling, is compared to the “Optimal Threshold,” which maximizes the sum of sensitivity and specificity, computed over the validation set.
Dataset
MedGemma-27B
MedGemma-4B
Gemma-3-27B
Gemma-3-4B
CheXpert
0.819
0.790
0.535
0.519
[0.794, 0.845]
[0.750, 0.827]
[0.496, 0.573]
[0.483, 0.557]
DERM12345
0.701
0.636
0.749
0.680
[0.682, 0.719]
[0.610, 0.671]
[0.730, 0.777]
[0.660, 0.704]
G1020
0.494
0.541
0.507
0.480
[0.437, 0.551]
[0.480, 0.603]
[0.446, 0.567]
[0.422, 0.538]
Table 3: Average AUROC values with corresponding 95% confidence intervals for different models using the normalized probabilities
Figure 5: Distribution of optimal classification thresholds across CheXpert classes for MedGemma-27B. Optimal thresholds, defined as those maximizing sensitivity plus specificity, fall below 0.5 for 11 of 13 findings. Bars show the distance from the default 0.5 threshold, terminating at the optimal threshold value. The bar labeled “average” shows the mean across classes.