PleaSQLarify: Visual Pragmatic Repair for Natural Language Database Querying

Robin Shing Moon Chan, Rita Sevastjanova, Mennatallah El-AssadyarXiv 2026 · DOI

TL;DR

PleaSQLarify addresses the inherent ambiguity of natural language database queries by treating text-to-SQL translation as an interactive process of "pragmatic repair." By combining an information-gain algorithm that clusters queries based on their execution outputs with an intuitive visual interface, it allows users to rapidly narrow down a model's interpretation space through minimal, well-chosen clarifications.

What Problem Does This Paper Address?

Natural language interfaces to databases (NLIDBs) allow users to query data using everyday language instead of formal SQL syntax. However, human language is inherently underspecified, vague, and ambiguous. For instance, a query like "What was the review of the drama film?" leaves a system guessing: Which review metric? Exactly how should "drama" be filtered?

Standard text-to-SQL systems handle this ambiguity by collapsing uncertainty into a single, highly probable guess. If that guess doesn't match the user's true intent, the system fails opaquely, leaving the user with little recourse but to repeatedly rewrite their prompt.

The authors reframe this challenge through the lens of probabilistic pragmatics. In human conversation, speakers naturally economize their words, relying on the listener to ask for clarification when a statement is ambiguous—a process known as pragmatic repair. PleaSQLarify operationalizes this concept for human-computer interaction, turning ambiguity from a failure point into a collaborative problem-solving resource.

Methods

PleaSQLarify introduces a structured pipeline to map out, cluster, and navigate the "action space" of possible SQL interpretations:

  1. Candidate Generation: Given an ambiguous natural language prompt, the system samples a diverse set of $N=50$ candidate SQL queries from a Large Language Model (LLM) using a high temperature setting.
  2. Functional Clustering: Instead of grouping queries purely by code syntax, the system executes them against a test database and clusters them based on execution similarity (i.e., do they produce identical or highly similar output tables?). This ensures the system differentiates between distinct user intents rather than superficial code variations.
  3. Decision Variable Extraction: The system parses the candidate queries into Abstract Syntax Trees (ASTs) to isolate individual atomic features (like specific SELECT or WHERE clauses). It then groups these into higher-level, human-interpretable "decision variables" based on how well they characterize the functional clusters.
  4. Information Gain Ranking: Using Expected Information Gain (EIG), the algorithm ranks the decision variables to present the user with the single most informative question—essentially playing an optimized game of "20 Questions" to split the remaining hypothesis space as efficiently as possible.
Overview of the PleaSQLarify disambiguation pipeline

The Visual Interface

To make this algorithmic backend usable, the authors designed an interactive dashboard consisting of three core linked views:

  • Action Space: A UMAP projection visualizing the candidate queries as glyphs enclosed in Voronoi cells, colored to show which queries include or exclude the current decision variable.
  • Decision Space: The interactive panel where users are presented with the top-ranked decision variable alongside a concrete query example, allowing them to provide simple "Yes/No" feedback.
  • Predicted Query: A panel that tracks the provenance of user choices and displays the updated probabilities of remaining SQL clauses.
The visual interactive interface dashboard

Datasets

The authors evaluated their approach quantitatively using AMBROSIA, a specialized text-to-SQL benchmark designed to test diverse ambiguity types, including scope ambiguity, attachment ambiguity, and vagueness. They also utilize the CoSQL dataset to ground their motivation, noting that 31.9% of real-world conversational database interactions inherently require clarification.

Key Insights and Ideas

  • Prioritizing Intent over Syntax: Differentiating between syntactically diverse but functionally identical queries wastes user effort. Focusing on execution outputs ensures clarifications target meaningful differences in data results.
  • Heterogeneous Repair Strategies: A key takeaway from the user study was that users do not navigate ambiguity uniformly. The authors identified three distinct workflows:
  • Decision-Based: Relying strictly on the algorithmically prioritized questions.
  • Clause-Level: Manually filtering specific SQL components they knew they wanted.
  • Output-Driven: Selecting desired data tables visually from the Action Space.
  • Serendipitous Discovery: Surfacing the model's interpretation space actually helped users refine their own goals. Seeing alternative query outputs often made users realize they wanted to include extra columns or sorting logic they hadn't initially thought to ask for.

Key Results

  • Rapid Uncertainty Collapse: Quantitative evaluation on the AMBROSIA dataset demonstrated that the clustering + EIG approach consistently outperformed baseline methods, collapsing semantic uncertainty (entropy) and converging on the correct query within just 3 to 5 interaction turns.
Comparison of entropy reduction and functional similarity per turn across ambiguity types
  • High Usability & Success: In a study with 12 computer science graduate students and professionals, users achieved an 84.4% overall task completion rate across complex tasks. System Usability Scale (SUS) responses indicated that participants found the workflow smooth, well-integrated, and empowering.

Limitations and Future Work

  • Fixed Candidate Pool: The system relies entirely on the initial batch of 50 sampled queries. If the user's exact intended query isn't generated in that first step, the system cannot dynamically discover it. Regenerating queries on-the-fly at every turn is currently bottlenecked by LLM API latency and cost.
  • SQL Literacy Prerequisite: The decision variables are presented as raw SQL clauses (e.g., SELECT AudienceReviews). While effective for developers and data analysts, this interface remains inaccessible to non-technical users. The authors suggest integrating code-to-text translation layers in future iterations.
  • Scalability to Large Databases: Executing dozens of candidate queries to determine functional clustering is viable for small benchmark datasets, but could become computationally prohibitive on massive production databases. Future work must explore optimizing this via database indexing or informative data subsetting.

Summary updated

Abstract

Natural language database interfaces broaden data access, yet they remain brittle under input ambiguity. Standard approaches often collapse uncertainty into a single query, offering little support for mismatches between user intent and system interpretation. We reframe this challenge through pragmatic inference: while users economize expressions, systems operate on priors over the action space that may not align with the users'. In this view, pragmatic repair -- incremental clarification through minimal interaction -- is a natural strategy for resolving underspecification. We present \textsc{PleaSQLarify}, which operationalizes pragmatic repair by structuring interaction around interpretable decision variables that enable efficient clarification. A visual interface complements this by surfacing the action space for exploration, requesting user disambiguation, and making belief updates traceable across turns. In a study with twelve participants, \textsc{PleaSQLarify} helped users recognize alternative interpretations and efficiently resolve ambiguity. Our findings highlight pragmatic repair as a design principle that fosters effective user control in natural language interfaces.
BibTeX
@misc{chan2026pleasqlarify,
  author = {Robin Shing Moon Chan and Rita Sevastjanova and Mennatallah El-Assady},
  title = {{PleaSQLarify: Visual Pragmatic Repair for Natural Language Database Querying}},
  year = {2026},
  eprint = {2603.01795},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2603.01795},
}

Loading related content...

Figure