Grafy News
Try Grafy free

AskWise: Reducing Ambiguity in Text-to-SQL with Execution Guidance

Researchers have introduced AskWise, a system that uses query execution to decide when to ask users for clarification in text-to-SQL tasks.

Illustration for the news story: AskWise: Reducing Ambiguity in Text-to-SQL with Execution GuidanceSource: Grafy Research Lab

Natural language interfaces for databases often struggle with ambiguity, leading to incorrect SQL queries when a user's intent is unclear. Researchers Yuru Liang, Guangyinan Mei, and Miles Fan have introduced AskWise, a framework designed to intelligently manage these ambiguities by using query execution to guide the clarification process.

How does AskWise handle ambiguous database questions?

In many text-to-SQL scenarios, a single natural language question can be interpreted in multiple ways. According to the research paper, two different interpretations of a user's question might initially appear identical because they produce the same observed records in a database. However, these interpretations may diverge once a correction or a different data point is introduced.

AskWise addresses this by executing candidate queries across possible repairs of the user's intent. Instead of asking for clarification every time an ambiguity is detected, the system only prompts the user when a choice between interpretations will actually change the final answer. If all surviving combinations of interpretations result in the same known answer, the system proceeds with that answer, minimizing unnecessary interruptions for the user.

What is the role of execution-guided clarification?

Traditional clarification methods often rely on linguistic analysis to identify potential multiple meanings. AskWise shifts this focus toward execution-guided clarification. The core logic relies on the principle that a single record can act as a deciding factor. If executing a query against a specific piece of data reveals that different interpretations would yield different results, the system identifies that a clarification is necessary.

By testing candidate queries against the actual data, the framework can determine if an ambiguity is "semantic" (meaning the user's intent is truly unclear) or merely "structural" (where different SQL syntaxes happen to produce the same result). This distinction allows the system to be much more efficient, only bothering the user when the ambiguity has a direct impact on the correctness of the output.

What mathematical bounds does the research provide?

Beyond the practical implementation of the framework, the authors provide theoretical insights into the efficiency of this approach. For Boolean answers on a uniform binary cube, the researchers derived an exact bound on the difference in Expected Cost of Clarification (EC2) gain between two different questions based on partial execution results.

This mathematical foundation helps quantify how much information a single execution step provides and how much it reduces the uncertainty regarding the user's original intent. This theoretical work supports the claim that execution-guided methods can significantly optimize the interaction loop between a human and a database agent.

Why is this important for AI developers?

For developers building agentic workflows or data analysis tools, the "clarification bottleneck" is a common problem. If an AI agent asks too many questions, the user becomes frustrated; if it asks too few, the agent provides incorrect data.

AskWise suggests a middle ground where the agent uses the database itself as a tool to validate its own understanding. By treating clarification as a strategic decision informed by data execution, developers can create more robust and less intrusive natural language interfaces for complex structured data environments.

How can researchers apply this concept in Grafy?

While AskWise is a specific research framework for SQL, the underlying principle of using execution to resolve ambiguity is highly relevant to modern AI research. Researchers studying complex technical documents or large datasets can use Grafy Reader to explore these concepts. By using the AI to question and cross-reference information within uploaded PDFs and papers, researchers can simulate the process of iterative clarification and verify how different interpretations of a text lead to different analytical conclusions.

Frequently asked questions

What does AskWise do?

AskWise is a framework that improves text-to-SQL systems by using query execution to guide user clarification. It identifies when different interpretations of a question will lead to different answers and only asks the user for clarification in those specific instances, reducing unnecessary interruptions.

How does the system decide to ask a question?

The system executes candidate queries across possible repairs of the user's intent. It only asks for clarification when two different query executions result in different answers for the same question. If all possible interpretations yield the same answer, the system provides that answer without asking.

Does AskWise always require user input?

No, AskWise does not always require user input. It is designed to be efficient by only prompting the user when an ambiguity is found to be consequential. If the system can determine the correct answer through execution despite multiple possible interpretations, it returns the answer automatically.


Source: Grafy Research Lab — AskWise: Execution-Guided Clarification of Intent and Data in Text-to-SQL