VeriMinder: Mitigating Analytical Vulnerabilities in NL2SQL

Shubham Mohole, Sainyam Galhotra

TL;DR

VeriMinder is an interactive system designed to catch cognitive biases and analytical flaws in Natural Language to SQL (NL2SQL) workflows. By operationalizing the "Hard-to-Vary" principle through a multi-stage LLM pipeline, it ensures that users don't just get technically correct SQL, but also ask the most robust, bias-free questions for their specific decision-making context.

What Problem Does This Paper Address?

The democratization of data through NL2SQL interfaces (like text-to-SQL tools) has a hidden danger: the "wrong question" vulnerability. While current research focuses heavily on the technical accuracy of translating English to SQL, it often ignores the analytical quality of the original question.

If a financial analyst asks for "clients with the largest loans" to identify "at-risk accounts," they are falling prey to similarity bias (assuming size equals risk) and selection bias (ignoring small loans that might have higher default rates). A standard NL2SQL system will faithfully generate the SQL for that flawed question, leading to misleading results. VeriMinder addresses this gap by detecting these analytical blind spots before the query is even run.

Methods

VeriMinder introduces a three-stage framework to refine user queries:

  1. Data Preparation: The system maps the user's question and decision context to relevant database schema elements and identifies potential vulnerabilities.
  2. Analytical Validation: It uses a panel of LLM "critics" to detect cognitive biases (drawing from a framework of 53 categorized biases) and performs structural analysis using argument components.
  3. Refinement Synthesis: The system generates targeted suggestions to help the user reformulate their question into a "Hard-to-Vary" explanation—one that is data-supported, falsifiable, and specifically addresses the decision at hand.

The core innovation is the Hard-to-Vary (HV) score, an information-theoretic metric inspired by David Deutsch. It rewards "explanatory density"—maximizing predictive insight while minimizing descriptive complexity. Because calculating this directly is computationally hard, VeriMinder uses an ensemble of 12 prompt templates and a multi-agent "critic" loop (using models like Claude 3.7 Sonnet and Gemini 2.0 Flash) to approximate this objective.

Datasets

The authors evaluated VeriMinder using:

  • BIRD-DEV: A popular benchmark for large-scale database queries.
  • Custom Decision Scenarios: The researchers manually crafted 164 decision-question pairs based on BIRD-DEV to simulate realistic professional contexts where analytical vulnerabilities might occur.
  • DS1 & DS2: Subsets of these scenarios used for human evaluation (64 pairs) and automated large-scale evaluation (100 pairs).

Key Insights and Ideas

  • The "Technically Perfect, Analytically Flawed" Trap: The paper highlights that a 100% accurate SQL translation is useless if the underlying question is biased. This shifts the focus of NL2SQL research from "translation" to "consultation."
  • Operationalizing Philosophy: By taking David Deutsch’s "Hard-to-Vary" principle from the philosophy of science and turning it into a prompt engineering objective, the authors provide a formal way to define what a "good" analytical question looks like.
  • LLMs as Critics, Not Just Creators: The system doesn't just generate a better question; it uses a "committee of weak learners" (LLM critics) to evaluate multiple candidates, mirroring the self-correction processes found in human peer review.

Key Results

VeriMinder significantly outperformed existing baselines (like Direct NL2SQL and Critic-Agent Feedback) across several metrics:

  • User Experience: 82.5% of participants in a user study reported that the system positively impacted the quality of their analysis.
  • Analytical Quality: In comparative evaluations, VeriMinder scored at least 20% better than alternative approaches in terms of concreteness, comprehensiveness, and accuracy.
  • Win Rates: In head-to-head comparisons against Direct NL2SQL, VeriMinder was preferred in 83.9% of accuracy comparisons and 97.5% of comprehensiveness comparisons.
  • Automated Ranking: In large-scale tests, VeriMinder achieved the #1 ranking in 67% of cases for data accuracy and 66% for overall usefulness.

Limitations and Future Work

The authors acknowledge several hurdles:

  • Domain Specificity: The system may require manual customization of analytical components when moving to highly specialized fields (e.g., medicine or law).
  • Engine Dependency: VeriMinder’s effectiveness is still partially tied to the quality of the underlying NL2SQL engine it integrates with.
  • UI Constraints: The current interface is desktop-optimized and lacks full accessibility features or mobile support.
  • Data Leakage: As with many LLM-based studies, there is a risk that the models were exposed to the BIRD-DEV benchmark during their initial training.

Future Directions: The team plans to expand VeriMinder to support Python/Pandas for more complex statistical exploration and integrate "Conformal Prediction" to provide bias-aware rejection thresholds, ensuring the system can say "I don't know" when a question is too flawed to fix.

Summary updated

BibTeX
@misc{mohole2025veriminder,
  author = {Shubham Mohole and Sainyam Galhotra},
  title = {{VeriMinder: Mitigating Analytical Vulnerabilities in NL2SQL}},
  year = {2025},
  eprint = {2507.17896},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2507.17896},
}
Figure