Papers › Benchmarking and Improving Text-to-SQL Generation under Ambiguity

Benchmarking and Improving Text-to-SQL Generation under Ambiguity

20 Oct 2023arXiv:2310.13659archive 2025-07-28

Adithya Bhaskar, Tushar Tomar, Ashutosh Sathe, Sunita Sarawagi

Research in Text-to-SQL conversion has been largely benchmarked against datasets where each text query corresponds to one correct SQL. However, natural language queries over real-life databases frequently involve significant ambiguity about the intended SQL due to overlapping schema names and multiple confusing relationship paths. To bridge this gap, we develop a novel benchmark called AmbiQT with over 3000 examples where each text is interpretable as two plausible SQLs due to lexical and/or structural ambiguity. When faced with ambiguity, an ideal top-k decoder should generate all valid interpretations for possible disambiguation by the user. We evaluate several Text-to-SQL systems and decoding algorithms, including those employing state-of-the-art LLMs, and find them to be far from this ideal. The primary reason is that the prevalent beam search algorithm and its variants, treat SQL queries as a string and produce unhelpful token-level diversity in the top-k. We propose LogicalBeam, a new decoding algorithm that navigates the SQL logic space using a blend of plan-based template generation and constrained infilling. Counterfactually generated plans diversify templates while in-filling with a beam-search that branches solely on schema names provides value diversity. LogicalBeam is up to $2.5$ times more effective than state-of-the-art models at generating all candidate SQLs in the top-k ranked outputs. It also enhances the top-$5$ Exact and Execution Match Accuracies on SPIDER and Kaggle DBQA.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2310.13659")

Code

Syntology Ran 12 of 17 code samples harvested from 1 repository linked to this paper; 5 have no recorded run. Of those that ran: 12 ran with no contract checked.

By repository: official repository: 17 samples from 1 repository, 12 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

testzer0/ambiqt officialmentioned in paperMIT report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

17 samples harvested; 12 ran; 0 honoured the contract we drafted; 5 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

12ran
5unverified

Licence: 0 of the 17 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from testzer0/AmbiQT. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

disallowed testzer0/AmbiQT/src/logicalbeam/ablation_direct.py official repository ran MIT (permissive) · 0ca547f553ddb65d · report
extract_tables_and_columns testzer0/AmbiQT/src/logicalbeam/ablation_direct.py official repository ran MIT (permissive) · d3bdc5e617b7e466 · report
get_col_mappings testzer0/AmbiQT/src/utils/data.py official repository ran MIT (permissive) · 180f6cfb0b94cda6 · report
get_output_with_prefix testzer0/AmbiQT/src/logicalbeam/template_gen.py official repository ran MIT (permissive) · a29ff82a4708e5c7 · report
get_selections testzer0/AmbiQT/src/collate.py official repository ran MIT (permissive) · b0dc867bb550c2d7 · report
is_commonword testzer0/AmbiQT/src/utils/content.py official repository ran MIT (permissive) · b724cc2d4066a429 · report
is_number testzer0/AmbiQT/src/utils/content.py official repository ran MIT (permissive) · f39fdc1ce6cffe08 · report
is_stopword testzer0/AmbiQT/src/utils/content.py official repository ran MIT (permissive) · d56a1f9221823a48 · report
lower testzer0/AmbiQT/src/collate.py official repository ran fingerprinted MIT (permissive) · 83fb78ab0d26fa54 · report
normalize_spaces testzer0/AmbiQT/src/utils/sql.py official repository ran fingerprinted MIT (permissive) · 56def8190912ab3f · report
normalize_sql testzer0/AmbiQT/src/collate.py official repository ran fingerprinted MIT (permissive) · f146bec5afa35b8d · report
try_extract_json testzer0/AmbiQT/src/chatgpt/prompter.py official repository ran fingerprinted MIT (permissive) · 4ff91e232c45be1a · report
get_model_picard testzer0/AmbiQT/src/utils/model_utils.py official repository unverified MIT (permissive) · b90b6e1db0a2c350 · report
get_reply testzer0/AmbiQT/src/chatgpt/helper.py official repository unverified MIT (permissive) · f988bbea8a36c875 · report
get_reply_with_retries testzer0/AmbiQT/src/chatgpt/helper.py official repository unverified MIT (permissive) · 73bf0aed972d0f6c · report
load_spider testzer0/AmbiQT/src/utils/data.py official repository unverified MIT (permissive) · b2cd044e4edcf9d1 · report
to_device_multiple testzer0/AmbiQT/src/utils/model_utils.py official repository unverified MIT (permissive) · 7b30094e3a706d3f · report

Tasks

BenchmarkingDiversityNatural Language QueriesText to SQLText-To-SQL

1 archive task tag without a task page not shown.

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections