VeriMinder: Mitigating Analytical Vulnerabilities in NL2SQL

Shubham Mohole, Sainyam Galhotra · DOI

Introduction

The democratization of data through Natural Language to SQL (NL2SQL) systems has significantly lowered the barrier for non-technical users to interact with complex databases. However, this accessibility introduces a critical "Wrong Question" vulnerability. While current research focuses heavily on technical translation accuracy—ensuring the SQL code matches the user's natural language—it often ignores the analytical quality of the original inquiry. If a user asks a fundamentally biased or flawed question, even a syntactically perfect SQL query will yield misleading results.

Comparison of analytical outcomes with and without VeriMinder, highlighting the mitigation of cognitive biases.

VeriMinder is an interactive system designed to detect and mitigate these cognitive biases. For instance, a financial analyst seeking "at-risk accounts" might ask for "clients with the largest loans," falling prey to Similarity Bias (equating size with risk) and Selection Bias (ignoring smaller, potentially higher-risk loans). VeriMinder acts as an analytical critic, challenging the user's logic before the query is executed.

The VeriMinder Framework

VeriMinder operates on a three-stage framework: Data Preparation, Analytical Validation, and Refinement Synthesis. This process is grounded in the "Hard-to-Vary" (HV) principle, a concept borrowed from epistemology suggesting that a robust explanation is one where changing any component weakens the logic. The system formalizes this using an HV score:

$$HV(S) = \frac{I(T; S)}{DL(S)}$$

Where $I(T; S)$ represents the mutual information (predictive insight) and $DL(S)$ is the description length (complexity). The goal is to maximize insight while minimizing unnecessary complexity.

Methodology Highlights

  1. Multi-Candidate Pipeline: The system employs an ensemble of 12 prompt templates to explore diverse analytical angles, including vulnerability detection and schema validation.
  2. Distributed Critic Evaluation: A panel of specialized Large Language Model (LLM) "critics" evaluates these candidates, followed by a self-reflection pass to synthesize the most robust suggestions.
  3. Analytical Grounding: The system leverages a library of 53 categorized cognitive biases and the Toulmin model for argument structure to challenge the user's underlying logic.

Evaluation and Results

The system was evaluated using the BIRD-DEV benchmark, supplemented by 164 manually crafted decision scenarios to provide realistic context. Evaluation metrics focused on Accuracy, Concreteness, and Comprehensiveness.

VeriMinder's performance improvement across key metrics compared to various baseline models.

VeriMinder demonstrated significant improvements over standard NL2SQL baselines and specialized methods like Question Perturbation (PerQS). Key findings include:

  • Superior Performance: VeriMinder outperformed the strongest baseline (PerQS) by 22.1% in Accuracy, 28.4% in Concreteness, and 21.2% in Comprehensiveness.
  • User Impact: 82.5% of participants reported a positive impact on their analysis quality. Against direct NL2SQL, VeriMinder achieved an 83.9% win rate for data accuracy and a 97.5% win rate for comprehensiveness.
  • Ranking: In automated assessments, VeriMinder consistently secured the top rank across all analytical dimensions, whereas direct NL2SQL frequently ranked last.

Conclusion and Future Work

VeriMinder shifts the paradigm of NL2SQL from simple translation to active analytical partnership. By treating LLMs as critics rather than just coders, the system helps users navigate the "Wrong Question" problem. While the current multi-stage pipeline introduces some computational latency and cost, it provides a necessary safeguard against data-driven misinterpretations. Future work will focus on expanding support to Python/Pandas workflows and integrating Self-Reflective Retrieval-Augmented Generation (Self-RAG) to better calibrate evidence sufficiency.

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