Papers › Interleaving Pre-Trained Language Models and Large Language Models for Zero-Shot...

Interleaving Pre-Trained Language Models and Large Language Models for Zero-Shot NL2SQL Generation

15 Jun 2023arXiv:2306.08891archive 2025-07-28

Zihui Gu, Ju Fan, Nan Tang, Songyue Zhang, Yuxin Zhang, Zui Chen, Lei Cao, Guoliang Li, Sam Madden, Xiaoyong Du

Zero-shot NL2SQL is crucial in achieving natural language to SQL that is adaptive to new environments (e.g., new databases, new linguistic phenomena or SQL structures) with zero annotated NL2SQL samples from such environments. Existing approaches either fine-tune pre-trained language models (PLMs) based on annotated data or use prompts to guide fixed large language models (LLMs) such as ChatGPT. PLMs can perform well in schema alignment but struggle to achieve complex reasoning, while LLMs is superior in complex reasoning tasks but cannot achieve precise schema alignment. In this paper, we propose a ZeroNL2SQL framework that combines the complementary advantages of PLMs and LLMs for supporting zero-shot NL2SQL. ZeroNL2SQL first uses PLMs to generate an SQL sketch via schema alignment, then uses LLMs to fill the missing information via complex reasoning. Moreover, in order to better align the generated SQL queries with values in the given database instances, we design a predicate calibration method to guide the LLM in completing the SQL sketches based on the database instances and select the optimal SQL query via an execution-based strategy. Comprehensive experiments show that ZeroNL2SQL can achieve the best zero-shot NL2SQL performance on real-world benchmarks. Specifically, ZeroNL2SQL outperforms the state-of-the-art PLM-based methods by 3.2% to 13% and exceeds LLM-based methods by 10% to 20% on execution accuracy.

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="2306.08891")

Code

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

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

ruc-datalab/zeronl2sql officialmentioned in papermentioned on GitHubMIT 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

18 samples harvested; 7 ran; 0 honoured the contract we drafted; 11 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.

7ran
11unverified

Licence: 0 of the 18 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 ruc-datalab/zeronl2sql. “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.

convert_fk_index ruc-datalab/zeronl2sql/src/utils/get_tables.py official repository ran MIT (permissive) · 64dd3849a251a1bf · report
get_schema ruc-datalab/zeronl2sql/get_colval_map.py official repository ran fingerprinted MIT (permissive) · 0992d2a47ae733fa · report
get_schema_from_json ruc-datalab/zeronl2sql/get_colval_map.py official repository ran MIT (permissive) · c4dcaf29b663a364 · report
is_commonword ruc-datalab/zeronl2sql/src/utils/bridge_content_encoder.py official repository ran MIT (permissive) · b724cc2d4066a429 · report
is_number ruc-datalab/zeronl2sql/src/utils/bridge_content_encoder.py official repository ran MIT (permissive) · f39fdc1ce6cffe08 · report
is_stopword ruc-datalab/zeronl2sql/src/utils/bridge_content_encoder.py official repository ran MIT (permissive) · d56a1f9221823a48 · report
normalize ruc-datalab/zeronl2sql/src/utils/dataset.py official repository ran fingerprinted MIT (permissive) · 448eab4c7249a72c · report
dump_db_json_schema ruc-datalab/zeronl2sql/src/utils/get_tables.py official repository unverified MIT (permissive) · 427de7d5976d4ed4 · report
execute ruc-datalab/zeronl2sql/LLM_text2sql.py official repository unverified MIT (permissive) · c7c413b7001d6846 · report
find_invalid_functions ruc-datalab/zeronl2sql/LLM_text2sql.py official repository unverified MIT (permissive) · 776b03fe5995312f · report
gelu_new ruc-datalab/zeronl2sql/src/utils/aligner.py official repository unverified MIT (permissive) · 227f586d79c9675d · report
gelu_python ruc-datalab/zeronl2sql/src/utils/aligner.py official repository unverified MIT (permissive) · f41cf0378a1399d0 · report
get_structure ruc-datalab/zeronl2sql/src/utils/get_data.py official repository unverified MIT (permissive) · 8c9c208c466794b2 · report
linear_act ruc-datalab/zeronl2sql/src/utils/aligner.py official repository unverified MIT (permissive) · 3aff0fef02654e1a · report
normalize ruc-datalab/zeronl2sql/LLM_text2sql.py official repository unverified MIT (permissive) · 18ff3872881607ac · report
prepare_splits ruc-datalab/zeronl2sql/src/utils/dataset.py official repository unverified MIT (permissive) · 8f6f7abc62958716 · report
serialize_schema ruc-datalab/zeronl2sql/src/utils/dataset.py official repository unverified MIT (permissive) · 8687d376b1d5b594 · report
tokenize ruc-datalab/zeronl2sql/get_colval_map.py official repository unverified MIT (permissive) · 2d9b155996a531f8 · report

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

ALIGN

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