SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2601.10318 · 2026

Boundary-Aware NL2SQL: Integrating Reliability through Hybrid Reward and Data Synthesis

Zhendong Wang, Yong Wu, Shengtao Zhang, Songsong Tian, Kongsheng Zhuo, Rong Shen

arXiv · PDF · Open in the Atlas

Code that ran

12 of 14 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 2 violated it and 2 have no contract verdict; 8 failures of our instrument; 2 no recorded run), measured 2026-11-23; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2601.10318.json · badge: /api/ran/2601.10318.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
TianSongS/BAR-SQL canonical (classifier label)
classifier basis: census
12 ran · 2 no recorded run
FunctionStatusWhere it lives
add_constraint_to_prompt Ran
ran; our contract draft was wrong, not the code
TianSongS/BAR-SQL/data_synthesis/continue_ask_data_syn_constraints.py
pointer only (licence: NONE) · get_code("07408380fb2fe897")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, TianSongS/BAR-SQL when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

call_api Ran
ran on a synthesized input
TianSongS/BAR-SQL/model_test/trained_model_infer.py
pointer only (licence: NONE) · get_code("ef09c8678ddf2d2f")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, TianSongS/BAR-SQL when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

check_fuzzy_equivalence Ran
ran, violated the contract we drafted
TianSongS/BAR-SQL/model_test/utils.py
pointer only (licence: NONE) · get_code("0a186d54ddd74b40")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, TianSongS/BAR-SQL when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

extract_question_from_prompt Ran
ran; our contract draft was wrong, not the code
TianSongS/BAR-SQL/model_test/main_eval.py
pointer only (licence: NONE) · get_code("3ff33052833b13ec")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, TianSongS/BAR-SQL when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

extract_schema_from_prompt Ran
ran; our contract draft was wrong, not the code
TianSongS/BAR-SQL/model_test/main_eval.py
pointer only (licence: NONE) · get_code("216f812492c5616b")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, TianSongS/BAR-SQL when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

extract_sql_from_response Ran
ran; our contract draft was wrong, not the code
TianSongS/BAR-SQL/data_synthesis/reflection_data_sys.py
pointer only (licence: NONE) · get_code("d53d82c5b2528a8f")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, TianSongS/BAR-SQL when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

extract_think_answer_from_response Ran
ran; our contract draft was wrong, not the code
TianSongS/BAR-SQL/model_test/main_eval.py
pointer only (licence: NONE) · get_code("8fc57d9f278fa65f")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, TianSongS/BAR-SQL when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

generate_error_sql_prompt Ran
ran; our contract draft was wrong, not the code
TianSongS/BAR-SQL/data_synthesis/reflection_data_sys.py
pointer only (licence: NONE) · get_code("7eefae3a22c9cb0c")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, TianSongS/BAR-SQL when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_sim_query Ran
ran; our contract draft was wrong, not the code
TianSongS/BAR-SQL/data_synthesis/index_reject_data_syn.py
pointer only (licence: NONE) · get_code("124360e67fb4db17")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, TianSongS/BAR-SQL when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

is_number_approx_equal Ran
ran, violated the contract we drafted
TianSongS/BAR-SQL/model_test/utils.py
pointer only (licence: NONE) · get_code("244598b6df051b0a")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, TianSongS/BAR-SQL when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

parse_llm_clarification_output Ran
ran; our contract draft was wrong, not the code
TianSongS/BAR-SQL/data_synthesis/clarify_data_syn.py
pointer only (licence: NONE) · get_code("234e208d89a42191")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, TianSongS/BAR-SQL when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

process_all Ran
ran on a synthesized input
TianSongS/BAR-SQL/model_test/trained_model_infer.py
pointer only (licence: NONE) · get_code("7828e5d91b92bd82")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, TianSongS/BAR-SQL when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

chat_gpt4o Not yet run
unverified (harvested, no recorded run)
TianSongS/BAR-SQL/model_test/taming_sql.py
pointer only (licence: NONE) · get_code("0055a674c19470d3")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, TianSongS/BAR-SQL when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

row_approx_match Not yet run
unverified (harvested, no recorded run)
TianSongS/BAR-SQL/model_test/utils.py
pointer only (licence: NONE) · get_code("9463268e8a8ee0be")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, TianSongS/BAR-SQL when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 14 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Natural Language to SQL (NL2SQL) systems powered by Large Language Models (LLMs) have shown strong performance on academic benchmarks, yet their effectiveness degrades substantially in enterprise environments with large schemas and complex business logic. Empirical studies on real-world production databases indicate that state-of-the-art NL2SQL systems achieve limited execution accuracy on realistic business queries. More critically, when queries are ambiguous or unanswerable, models tend to force an answer, producing plausible but semantically incorrect SQL rather than abstaining or requesting clarification. These limitations in both accuracy and boundary-aware behavior hinder the reliable deployment of NL2SQL systems in enterprise settings. In this paper, we present BAR-SQL (Boundary-Aware Reliable NL2SQL), a unified training framework that embeds reliability and boundary awareness directly into the generation process. We introduce a Seed Mutation data synthesis paradigm that constructs a representative enterprise corpus, explicitly encompassing multistep analytical queries alongside boundary cases including ambiguity and schema limitations. To ensure interpretability, we employ Knowledge-Grounded Reasoning Synthesis, which produces Chainof-Thought traces explicitly anchored in schema metadata and business rules. The model is trained through a two-stage process: Supervised Fine-Tuning (SFT) followed by Reinforcement Learning via Group Relative Policy Optimization. We design a Task-Conditioned Hybrid Reward mechanism that simultaneously optimizes SQL execution accuracy-leveraging Abstract Syntax Tree analysis and dense result matching-and semantic precision in abstention responses. To evaluate reliability alongside generation accuracy, we construct and release Ent-SQL-Bench, which jointly assesses SQL precision and boundary-aware abstention across ambiguous and unanswerable queries. Experimental results on this benchmark demonstrate that BAR-SQL achieves 91.48% average accuracy, outperforming leading proprietary models, including Claude 4.5 Sonnet and GPT-5, in both SQL generation quality and boundary-aware abstention capability. The source code and benchmark are available anonymously at: https://github.com/TianSongS/BAR-SQL.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2601.10318")
get_code_for_paper("2601.10318")
have("2601.10318")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2601.10318.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2601.10318.svg)](https://syntology.ai/paper/2601.10318)

Connect an agent — have() is free.