TraceSQL: Traceable Answerability Estimation for Reference-Free Text-to-SQL Verification
The paper proposes TraceSQL, a lightweight and traceable verification model that utilizes 67 explicit diagnostic features to estimate the answerability of generated SQL queries without ground-truth references, achieving competitive performance while providing interpretable evidence for its predictions.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
In the digital age, a vast amount of human knowledge is locked inside massive databases, waiting to be asked about. To unlock this information, people use a system called Text-to-SQL, which acts as a translator. When a person types a question in plain English, the system attempts to convert it into a precise set of instructions known as a query, allowing a computer to search the database and return an answer. This technology has advanced rapidly, powered by sophisticated artificial intelligence that can handle complex requests. However, a significant problem remains: once the system generates a query, how can anyone be sure it is correct? In a controlled test environment, experts can compare the computer's work against a known correct answer. But in the real world, where these systems are actually used, there is no reference key to check against. The system must decide for itself whether the query it just wrote is trustworthy, a task that is difficult because the computer might produce a query that looks perfect but answers the wrong question or uses the wrong data.
Researchers at Oracle Corporation have developed a new method to solve this problem of self-verification, creating a system they call TraceSQL. Instead of simply guessing whether a generated query is right or wrong, this new approach builds a detailed report card for every single attempt. The system examines the user's question, the database structure, and the generated query to look for specific signs of trouble. It checks if the question was vague, if the query matched the available data, if the mathematical logic was sound, and if the final result aligned with what the user actually wanted. By breaking down the verification process into sixty-seven distinct, understandable signals, the system can not only predict if a query is correct but also explain exactly why it made that decision.
The researchers tested this method using a large collection of questions and database scenarios. They compared their new system against a leading existing method that relies on a massive artificial intelligence model to judge correctness. The results showed that the new, lighter system was more accurate. It correctly identified valid queries and spotted errors more often than the heavier model, achieving a success rate of 66.47 percent compared to 61.87 percent for the other method. More importantly, the new system provided a clear trail of evidence. When it flagged a query as potentially incorrect, it could point to the specific reason, such as a missing filter, a wrong connection between data tables, or a misunderstanding of a business term. This transparency allows human users or other software to inspect the reasoning behind the decision, rather than just accepting a black-box score.
The study suggests that reliable verification does not require a massive, opaque artificial intelligence to look at the final result. Instead, it can be achieved by carefully measuring specific, logical properties of the question and the query. The system found that the most important clues came from a mix of two types of evidence: the structural details of the query itself, such as whether it included specific commands to limit results or group data, and the semantic alignment, which checks if the query truly matches the intent of the user's question. By combining these concrete structural checks with an understanding of the question's meaning, the system creates a robust way to verify answers without needing a reference key.
This work highlights a shift in how we might trust artificial intelligence in critical tasks. Rather than relying solely on the intuition of a large model, the researchers demonstrated that a system built on explicit, traceable rules can be both more accurate and more understandable. The ability to trace a decision back to its source evidence means that errors can be diagnosed and fixed more easily. In a world where automated systems are increasingly responsible for retrieving and analyzing data, the ability to see the work behind the answer is just as important as the answer itself. The researchers plan to expand their training data to see if these findings hold true across even wider ranges of questions and databases, but the current results show a clear path toward making text-to-query systems more reliable and transparent for everyday use.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.