When to Trust the Answer: Question-Aligned Semantic Nearest Neighbor Entropy for Safer Surgical VQA

Luca Carlini, Dennis Pierantozzi, Mauro Orazio Drago, Chiara Lena, Cesare Hassan, Elena De Momi, Danail Stoyanov, Sophia Bano, Mobarak I. HoquearXiv 2025

This paper addresses a critical safety gap in surgical AI: how to know when a Visual Question Answering (VQA) system is hallucinating. The authors introduce QA-SNNE, a new uncertainty estimator that ensures answers are not just consistent with each other, but actually relevant to the surgeon's question.

TL;DR

Surgical VQA systems often fail silently by providing consistent but irrelevant answers, especially when questions are phrased naturally rather than following rigid templates. QA-SNNE solves this by incorporating question-answer alignment into semantic uncertainty estimation, significantly improving the detection of incorrect responses across various state-of-the-art vision-language models.

What Problem Does This Paper Address?

In a high-stakes environment like the operating room, a VQA system that provides a confident but wrong answer is more dangerous than one that simply admits it doesn't know.

Existing uncertainty methods, like Semantic Nearest Neighbor Entropy (SNNE), measure "meaning-level consistency." They sample multiple answers from a model; if the answers all mean roughly the same thing, the system is considered "confident." However, the authors identify a major flaw: consistency does not equal correctness. A model might be consistently wrong because it misunderstood the question or relied on linguistic shortcuts.

Furthermore, surgical AI is often evaluated on "in-template" questions (e.g., "Where is the tool?"). In reality, surgeons use fluid language (e.g., "Where is the clip applier currently positioned?"). This "linguistic drift" often causes models to hallucinate while remaining internally consistent, tricking standard uncertainty estimators into high-confidence errors.

Methods

The authors propose Question-Aligned Semantic Nearest Neighbor Entropy (QA-SNNE). It is a "black-box" method, meaning it only looks at the model's text output and doesn't require access to internal probabilities or gradients.

The core innovation is a Bilateral Gating mechanism. Instead of treating all sampled answers equally, QA-SNNE weights them based on how well they align with the original question.

Fig. 1: QA-SNNE Framework for Automatic Failure Detection.

The process works in three steps:

  1. Alignment Scoring: For every sampled answer, an alignment score ($\alpha_i$) is calculated to see how well it addresses the question.
  2. Relevance Weighting: These scores are normalized into weights ($w_i$).
  3. Gating: The similarity matrix (which tracks how much answers agree with each other) is "gated" by these weights. If an answer is irrelevant to the question, its contribution to the "confidence" score is slashed.

The authors tested three alignment strategies:

  • Embedding-based: Using domain-adapted (PubMed) sentence embeddings to measure cosine similarity.
  • Entailment-based: Using a Natural Language Inference (NLI) model to see if the answer logically follows from the question.
  • Cross-Encoder: Using a re-ranker model to jointly process the question-answer pair for fine-grained matching.

Datasets

The study utilized three main benchmarks:

  • EndoVis18-VQA (In-template): The standard dataset for surgical VQA based on nephrectomy videos.
  • EndoVis18-VQA (Out-of-template): A newly introduced variant where the authors rephrased the original 35 questions into more natural, complex language while keeping the images and ground-truth answers identical.
  • Open-ended PitVQA: An external validation dataset focused on pituitary surgery to test how well the method generalizes to different surgical domains.
Examples of original vs. rephrased questions in the new out-of-template dataset.

Key Insights and Ideas

  • The "Off-Topic" Safety Signal: Misalignment is itself a safety signal. If a model frequently goes off-topic, QA-SNNE naturally increases the uncertainty score, even if the off-topic answers are consistent with each other.
  • Zero-Shot vs. Fine-Tuning: The paper highlights a fundamental trade-off. Fine-tuned models (PEFT) are highly accurate on templates but brittle to rephrasing. Zero-shot models (like Llama 3.2 or Qwen 2.5) are less accurate overall but much more robust to natural language variations.
  • Regime-Dependent Strengths: In standard "in-template" settings, models rarely go off-topic, so the gains from QA-SNNE are modest. The method shines most under "rephrase drift," where models are more likely to misunderstand the prompt.

Key Results

QA-SNNE consistently outperformed standard baselines (like DSE and SNNE) in detecting hallucinations (measured by AUROC):

  • Zero-Shot Boost: On in-template data, it improved AUROC by +15% for Llama 3.2 and +21% for Qwen 2.5.
  • Robustness to Rephrasing: Under out-of-template stress, gains persisted, with MedGemma 3.0 seeing an improvement from 0.798 to 0.816 AUROC.
  • Hallucination Detection: In the rephrased split, the entailment-based variant achieved near-perfect accuracy (0.96-0.98) for zero-shot models, compared to much lower scores for question-agnostic methods.
Table 2: Utility and Safety Metrics Across Validation Sets. We report BLEU, ROUGE-L, METEOR and AUROC. Higher is better for all the metrics. Bold indicates the best within each column-block for utility and best method within the row-block for safety, underlined the second best for safety metric.

Limitations and Future Work

The authors acknowledge that their "out-of-template" dataset uses a single validated rephrasing per question. Real-world clinical conversation is even messier, involving ellipsis (omitting words), negation, and varying levels of specificity.

Additionally, for heavily fine-tuned models, the sampled answers can become so similar (low diversity) that the alignment weights become uniform, making QA-SNNE behave like standard SNNE. Future work could explore more diverse sampling strategies or richer multi-paraphrase benchmarks to further stress-test these safeguards.

Summary updated

BibTeX
@misc{carlini2025when,
  author = {Luca Carlini and Dennis Pierantozzi and Mauro Orazio Drago and Chiara Lena and Cesare Hassan and Elena De Momi and Danail Stoyanov and Sophia Bano and Mobarak I. Hoque},
  title = {{When to Trust the Answer: Question-Aligned Semantic Nearest Neighbor Entropy for Safer Surgical VQA}},
  year = {2025},
  eprint = {2511.01458},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2511.01458},
}
Figure