LearNAT: Learning NL2SQL with AST-guided Task Decomposition  for Large Language Models
Authors: Weibin Liao
Xin Gao
Tianyu Jia
Rihong Qiu
Yifan Zhu
Yang Lin
Xinyu Ma
Junfeng Zhao
Yasha Wang
Venue: ICLR 2026 Poster (2026)
Keywords: Large Language Model
Text-to-SQL
Primary area: applications to computer vision, audio, language, and other modalities

Abstract: Natural Language to SQL (NL2SQL) aims to translate natural language queries into executable SQL statements, offering non-expert users intuitive access to databases. While recent approaches leveraging large-scale private LLMs such as GPT-4 have achieved state-of-the-art results, they face two critical challenges: the lack of openness and reproducibility, and the prohibitive computational cost of test-time scaling. To address these issues, we explore improving the model-level performance of small-scale public LLMs in NL2SQL under resource-constrained settings. Our exploratory experiments reveal the potential of task decomposition for enhancing NL2SQL performance, but also highlight the difficulty of enabling LLMs to decompose queries effectively. Motivated by these findings, we propose LearNAT, a novel framework designed to enhance LLMs’ decomposition capabilities. LearNAT introduces (1) a Decomposition Synthesis Procedure, which leverages AST-guided search with pruning strategies to generate verifiable and efficient decompositions, and (2) Margin-Aware Reinforcement Learning, which provides fine-grained preference optimization for multi-step reasoning beyond standard DPO. Extensive experiments on benchmark datasets demonstrate that LearNAT significantly improves the performance of small-scale LLMs, achieving results comparable to GPT-4 with only a 7B parameter model. These results validate the effectiveness of verifiable decomposition and fine-grained preference learning in advancing NL2SQL towards openness, transparency, and efficiency.
Our code is publicly available at https://github.com/MrBlankness/LearNAT.

Published as a conference paper at ICLR 2026
LEARNAT: LEARNING NL2SQL WITH AST-GUIDED TASK DECOMPOSITION FOR LARGE LANGUAGE MOD- ELS
Weibin Liao?-2, Xin Gaol.2, Tianyu Jia Rihong Qiu--2, Yifan Zhu
Yang Lin?, Xinyu Ma², Junfeng Zhao1.2.3 Yasha Wang2.15x
School of Computer Science, Peking University
2 Key Laboratory of High Confidence Software Technologies, Ministry Education
Big Data Technology Research Center, Nanhu Laboratory
Naatioal Engineering Research Center For Software Engineering, Peking University
PPeking University Information Technology Institute (Tianjin Binhai)
School of Computer Sciences, Beijing University of Posts and Telecommunications
Huaawi Technologies Co., Ltd
Seed, ByteDance Inc.
X 1 liaoweibe bi nēstu. pku. edu. cn, wangyasha@pku. .dd.. cn com
https://giee
ABSTRACT
Natural Language to SQL (NL2SQL) aims to translate natural language queries into executable SQL statements, offering non-expert users intuitive access databases. While recent approaches leveraging large-scale private LLMs such as GPT-4 have achieved state-of-the-art results, they face two critical challenges: the lack of openness and reproducibility, and the prohibitive computational cost of test-time scaling. To address these issues, we explore improving the model-level performance of small-scale public LLMs in NL2SQL under resource-constrained settings. Our exploratory experiments reveal the potential task decomposition for enhancing NL2SQL performance, but also highlight the difficulty of enabling LLMs to decompose queries effectively. Motivated by these findings, we propose LearNAT, a novel framework designed enhance LLMs' decomposition capa- bilities. LearNAT introduces (1) a Decomposition Synthesis Procedure, which leverages AST-guided search with pruning strategies generate verifiable and ef- ficient decompositions, and (2) Margin-Aware Reinforcement Learning, which provides fine-grained preference optimization for multi-step reasoning beyond standard DPO. Extensive experiments on benchmark datasets demonstrate that LearNAT significantly improves the performance of small-scale LLMs, achiev- ing results comparable to GPT-4 with only 7B parameter model. These results validate the effectiveness of verifiable decomposition and fine- ime-grained preference learning in advancing NL2SQL towards openness, transparency, and efficiency.
INTRODUCTION
Natural Language SQL (NL2SQL) (Kim et al., 2020) is fundamental task that seeks to automat- ically translate natural language queries into executable SQL statements (Zhang et al., 2024; Huang al., 2025). This task has garnered substantial research interest owing to potential to democratize database access, thereby enabling users without SQL expertise query and interact with databases through natural language. In recent years, large language models (LLMs) (Lin et al., 2025), such as widely adopted NL2SQL bench- marks, including Spider (Yu et al., 2018) and BIRD (Li et al., 2023b). These approaches predom- inantly rely on large-scale proprietary LLMs, such as GPT-4 (Talaci et al., 2024; Lee et al., 2025;
OpenAl's GPT-4, have achieved tfate-of-the-ar performance
"Corresponding Author.

---

Published as a conference paper at ICLR 2026
Decomposition Data Synthesis
Challenge in Decomposition
AST-based Verifiable Decomposition
D. S d&L
Single compliex NL2SQL tack
Search
Mulkipla simple
Decompactton
Subtask Reward Estimation
Subtree--usee
Simularity Reward Estimation
NLZSQL tosks
Correctness Evaluation
Correctness Evaluation
Model Training
Dilemia in DPO
Margin- aaaire DPO
How does His compare Co
is better then
better than
How tuuch better than
Rei.forcemant
Learning
don't
Bkolihoo
Figure 1: Overview of LearNAT. To address the challenges in decomposition data synthesis, LearNAT introduces a Decomposition Synthesis Procedure that enables AST-based verifiable de- composition. Furthermore, to overcome the limitation of DPO in capturing differences among subtask preferences during training, LearNAT proposes a Margin-Aware Reinforcement Learning, which leverages subtask-leve rewards generated during the decomposition process to facilitate fine- grained and dynamic preference learning.
Wang et al., 2025) and Gemini (Pourreza et al., 2024), and often employ sophisticated prompt en- gineering techniques (Wei et al., 2022). Moreover, they leverage the test-time scaling law of LLMs to generate system-level outputs (as defined in Appendix G.I). Despite their effectiveness, this line of research encounters two critical challenges. First, the dependence on proprietary L.LMS raises pressing concerns regarding openness, reproducibility, and data privacy. Second, the application of the test-time scaling law substantially increases computational overhead, which is particularly prohibitive in the context of large-scale LLMs. Consequently, this study emphasizes enhancing the model-level performance (as defined in Appendix G.I) of small-scale public LLMs, with the overar- ching goal of fostering greater openness, transparency, and efficiency in NL2SQL under resource- constrained deployment scenarios.
To improve the performance of small-scale public LLMs, prior research has explored strategies such as pre-training (I.i et al., 2024b) and post-training (Yang et al., 2024b) to equip L.MSs with domain- specific knowledge. However, NL2SQL tasks pose unique challenges. Natural language queries frequently encompass multiple objectives, which may be explicit (directly corresponding to query results) or implicit (e.g., conditions for filtering results), and these objectives are not always directly aligned with the underlying database schema. Such characteristics render it particularly difficult for LLMs to effectively address complex NL2SQL tasks in single step. A promising direction, therefore, lies in decomposing complex NL2SQL problems into sequence of simpler subproblems, thereby alleviating overall solution complexity.
To preliminarily validate this hypothesis, we conducted extensive exploratory experiments. These experiments yielded two key observations: (1) When subtasks are manually provided to the LLM, performance improves substantially (30.4%1), underscoring the potential of task decomposition in enhancing NL2SQL performance. In contrast, when the LLM responsible for decomposing complex queries its own, the performance gains are marginal (3.4%t). highlighting the need to strengthen the task decomposition capabilities LLMs for NL2SQL. (2) We further investigated two feasible decomposition strategies: (i) AST-based decomposition with semantic verification and (ii) search-based decomposition with AST verification. Experimental results reveal that while the AST-based approach computationally more efficient, it frequently introduces errors in the gen- crated subtasks and fails to achieve precise semantic validation. Conversely, the search-base proach, though more complex, leverages AST-baasdd verification to yield more stable and accurate task decomposition and translation. Collectively, these findings highlight the critical importance of verifiable decomposition.
ap-
Motivated by the above insights, we propose TeT (Learning NL22QL with AST-guided Task Decomposition), framework designed to enhance the decomposition capability of L.MSs for com- plex NL.2QQL tasks. It introduces two core components:
Decomposition Synthesis Procedure: This verifiable decomposition component employs search- based strategy, such as Monte Carlo Tree Search (MCTS), to generate subtasks for NL2SQL de- composition. Existing LLM-MCTS hybrid methods typically rely on heuristic evaluation, where
2

---

Published as a conference paper at ICLR 2026
the LLM itself estimates node rewards guide the search. However, advanced models such as GPT-4 achieve only 46.35% accuracy on benchmarks like BIRD, limiting the reliability of such self-evaluation strategies. Moreover, the vast search space inherent in text-based MCTS introduces inefficiencies and computational overhead. To mitigate these challenges, we leverage abstract syntax trees (ASTs) guide the search and implement pruning strategies, thereby sub- stantially improving both efficiency and the success rate of generating valid decompositions.
Margin-Aware Reinforcement Learning: This component enhances LLMs' decomposition ca- pabilities through reinforcement learning techniques, such as Direct Preference Optimization (DPO) (Rafailov al., 2023). Standard DPO algorithms struggle with fine-grainee supervision in multi-step reasoning tasks, as they treat all positive and negative steps equally. To overcome this limitation, we propose an AST-based margin- awwre DPO framework that differentiates between varying levels of step correctness, enabling more precise optimization.
Our main contributions can be summarized as follows:
1. Conceptually, tackle the critical challenge of enabling LLMs comprehend users' high- level semantics and map them to database schemas for complex N1.2QQL. queries. To this end, we propose LearNAT, the first framework improve LLM performance on NL2SQL tasks by explicitly leveraging task decomposition.
Methodologically, we introduce the Decomposition Synthesis Procedure, which provides a ver- ifiable and efficient decomposition mechanism that assesses both subtask correctness and overall task progress via AST', and Margin-Awal Reinforcement Learning, which enables fine-grained preference learning tailored to multi-step reasoning.
Empirically, through extensive experiments on two NL.2QQ benchmark datasets, we demon- strate that Lea NNAT substantially outperforms existing approaches, achieving performance on par with GPT-4 while using a 7B-parameter model. These results underscore the effectiveness of task decomposition strategies in addressing the inherent challenges of complex NL2SQL tasks.
MOTIVATION FROM PRELIMINARY EXPERIMENTS
Motivation for Task Decomposition. In this empirical study, we conduct a detailed investigation examine whether task decomposition benefits LLMs in the NL2SQL task and further explore the bottlenecks of decomposition-base. NI.2SQL. approaches. Specifically, we randomly selected 500 examples from the BIRD-train (L.i et al., 2023b) set and evaluated Qwen2.5-coder-322 (Yang et al., 2024a) under three experimental settings: (1) directly prompting Qwen2.5-coder-23 to solve the NL2SQL tasks without decomposition; (2) manually decomposing complex NL2SQL tasks into simpler subtasks and then prompting based method to guide 1wwe2.55-coder-33 to first decompose complex NL2SQL tasks into simpler subtasks and then solve these subtasks sequentially. The experimental results provided in Ap- pendix Fig. 6. The results reveal a striking contrast: when LLMs are guided with manually crafted subtask decompositions, their performance improves significantl--for instance, by 30.4%1. How- ever, when relying on LLMs to autonomously decompose tasks, the improvement is modest, with gains of only around 3.4%?
to solve them; (3) using prompting-
We posit the following: complex NL2SQL tasks can be effectively decoupled into two distinct sub- problems: high-level task decomposition and low-level NL2SQL translation. The former involves breaking down complex user query into a sequence of simpler, manageable subtasks, a process that often demands substantial reasoning capabilities. The latter focuses on directly translating these simplified natural language inputs into their corresponding SQL queries. Owing to extensive pre- training, L.LMs generally excel at low-level NI.2QQI. translation. However, they are far less profi- cient at complex task decomposition, they often lack the deep reasoning and planning abilities required to deconstruct intricate problems into logical steps. Based on these findings, we derive our first key observation:
Observation Task decomposition holds substantial promise for enhancing the NL2SQL capabil- ities of LLMs. Nevertheless, the limited ability of LLMs perform effective task decomposition autonomously constitutes a major bottleneck to the practical deployment of decomposition based NL22QQ techniques.
3

---

Published as a conference paper at ICLR 2026
Clause Nodes
Quary
Progressive Nodes
Operator Nodes
Redundant Nodes
Operand Nocies
Sublask#1: L..]
Subtaek#1: L..]
Subtask#1: [..]
Invalld Nodes
SubSQL [..]]
SubSQLK1: [..]
SubSQLIK1 [...
Suocersful Traectories
Subtaeke2 L...
Subtaeki2 [..]
SubSQLK2: [..]
SubSQLK2: [...]
Contrastivn Node Pairs
Subleske3 [... SubSQLAK: I..]
Subtaskitt [..]
Sublaskd3: [..]
SubSOLK3:
SubSOLi3:
AST of Gold SQL
(b) AST of SubSQL
(c) Subtask Search via MCTS
(d) Dats Collection
Figure 2: Framework of the Decomposition Synthesis Procedure. (c) illustrates how the LLM, combined with MCTS, performs next-step prediction to synthesize subtasks of complex NL.2QQI. tasks. (b) presents the AST of the SQL statements corresponding to each synthesized subtask in (c). (a) shows the AST of the Gold SQL for the complex NL2SQL task, which guides the MCTS in (c) to perform more efficient search, including pruning and node reward estimation. (d) depicts the data collected by LearNAT during the Decomposition Synthesis Procedure, comprising successful trajectories data for supervised fine-tuning and step- wise contrastive node pairs data for preference learning. Under the default settings of LearNAT, GLM-4-Plus used synthesize decomposition data, and the Qwen2.5-Codd model is fine-tuned.
Motivation for Verifiable Decomposition. A critical challenge in leveraging task decomposition to enhance NL22QL performance in LLMS lies in how to derive a sequence of simpler subtasks from complex NL2SQL query. To address this issue, we explored straightforward hypothetical solution in our preliminary experiments. Specifically, as illustrated in Appendix Fig. 7 (a), we decomposed the ground-truth SQL. corresponding to complex natural language query into several simpler sub-SQL. queries based on its abstract syntax tree (AST). We then employed an LLM to translate these sub-SQLs into natural language subtasks, treating them as the subtask sequence for the original query. However, this approach introduces a new challenge: owing to the hallucination tendencies of LLMs, the translation process from sub-SQLs to subtasks may introduce latent errors. This raises crucial question how can we verify the correctness of the generated subtasks?
We attempted to directly use language models, such as termine whether the generated subtasks were correct based semantic similarity. However, these approaches achieved only 46.8% and 36.0% accuracy, respectively (see Appendix Table 5), indicat- ing that verifying the correctness of subtasks is far from straightforward. The language models fre- quently misjudged cases involving subtle semantic differences. For example, if the gold SQL query targeted user's name while the generated subtask query instead targeted the user's ID, GLM-4 often incorrectly deemed the subtask to be correct. This motivates our second key observation:
and GLM-4, to de-
Observation II: Subtasks generated by large language models are often unreliable, thereby necessi- tating verifiable task decomposition procedure.
Summary. Building on the above observations, our objective is develop a verifiable task de- composition framework and leverage reinforcement learning to strengthen the decomposition ca- pabilities of LLMs in NL2SQL. To this end, we propose LearNAT, which consists of two key components: (1) Decomposition Synthesis Procedure that generates candidate subtask sequences via based decomposition and evaluates their correctness using AST-based validation (see Appendix Fig. 7 (b), addressing Observation If); and (2) a Margin-Aware Reinforcement Learning framework that enhances LLMs' task decomposition ability by incorporating step-level task aware- ness, thereby improving overall NL2SQL performance (addressing Observation I).
METHODOLOGY
In this section, we present the methodology of LearNAT, First, LearNAT employs the Decom- position Synthesis Procedure for generating training data in offline reinforcement learning. Then,
4

---

Published as a conference paper at ICLR 2026
it utilizes Margin-aware Reinforcement Learning for model fine-tuning. For friendly reading, provide preliminary knowledge and relevant notation tables for NL2SQL, AST, MCTS, and DPO in the Appendix. B.
3.1 DECOMPOSITION SYNTHESIS PROCEDURE
Problem Formulation. Let {41 92.-.. 9n denote a sequence of subtask queries, where n rep- resents the number of subtasks and each qi represents a natural language query that captures component of the original query Q. For each subtask query qi. Decomposition Synthesis Procedure generates a corresponding query y/, The objective is to find a sequence of subtask queries such that their corresponding SQL queries collectively construct the target SQL. query Y.
MCTS- based Decomposition. Decomposition Synthesis Procedure formulates the decomposition process tree search problem, and performs next-step prediction as action in each state s. In the Monte Carlo Tree, the root node represents the original query Q, each non-root node represents the state of executing the next subtask, and each path from root node to leaf node represents decomposition sequence.
At each state in MCTS, the Decomposition Synthesis Procedure employs LLM to generate the next subtask Qi and sub-SQL y/- Formally, each state 8; {qi, yi. (y))) sum (yi). R(s;)) } AT where AT is the AST of Y/i, AT sum (y)) is the merged AST summarizing all nodes from root
to node in MCTS, and R(s;) is the reward estimation of 8;. The AT sum (3:) is mathematically defined as follows:
AT sum (y:) = (Nsums Esum);
N U (NT(A( &sum j=1
U E(AT()))), j=1
Node Classification. Decomposition Synthesis Procedure classify nodes into three categories based on their AST properties for subsequent prune strategy:
Nodes where AT( is subtree of AT( and AT(y:) not a subtree of AT sum ()rremt(() ). These nodes contribute new information toward the target SQL. For two ASTs AT1 = (N1, E1) and AT, (N2, &2), We define the subtree relationship as follows:
Progressive Nodes:
[1, 0. otherwise
if N2 and & &
isSubtree(AT) AT
Nodes where AT())) a subtree AT(Y) but also a subtree of AT sum sum (Uparen((s) These nodes provide no additional reward to the decomposition.
Redundant Nodes:
( is not a subtree of AT(Y). These nodes represent incorrect Invalid Nodes: Nodes where AT(y)) decompositions.
Prune Strategy. In traditional MCTS, since the typical scenario involves robotic task execution, A(s) is generally defined as a finite action set, such as pick up, put. down, etc. However, in the application of LLMs, A(s) is usually an infinite action set. This because LLMs generate ac- tions in the form of text, meaning that even the same subSQL can be expressed as multiple different subtask (action) variations. To reduce the search space of MCTS and improve search efficiency, De- composition Synthesis Procedure adopts pruning strategy. Specifically, since the subtask sequence collected by the Decomposition Synthesis Procedure corresponds the action sequence along the path from the root node to leaf node in MCTS, redundant actions and invalid actions along the path not need to included in the subtask list. Therefore, states containing redundant valid actions, the Decomposition Synthesis Procedure terminates further action searches to perform pruning.
Reward Estimation. In MCTS, it is necessary to estimate Q(s, a) for each state to provide state rewards, thereby guiding the direction of subsequent searches. In general mathematical domains, existing works typically employ either LLM-based based self-evaluation or additional reward model trained for state reward estimation. In this work, the Decomposition Synthesis Procedure further leverages information from the AST and designs rule-based approach to evaluate the state reward.
5

---

Published as a conference paper at ICLR 2026
Since states with redundant actions and invalid actions are pruned, to improve efficiency, reward estimation is only performed for states with progressive actions. Specifically, Decomposition Syn- thesis Procedure estimates the reward of the current state based on the similarity between AT(Y) and AT sum (yi) at the current state.
((s,) (AT sum sum) (Vi). AT(Y),
(4)
where sim(-.-) denotes the AST similarity measure.
Decomposition Synthesis Procedure defines two types of AST similarity, including node-level simi- larity simaode and structural similarity simatruct.
(5) where a are adjustment factors for the two types of AST similarity. Node-level similarity is defined by the degree of node overlap, while structural similarity is measured using the tree edit distance, a detailed description provided in Appendix. C.
R(s,) simMgode (AT sum (Ut), (T()) + (1-a) simamaa sum (V))
Sell-improvement Demonstration. To improve the success rate of decomposition, Decomposition Synthesis Procedure employs few-shot learning and adopts adaptive demonstrations from the pre- vious round. Specifically, it constructs a demonstration pool, which consists of samples that were successfully decomposed in the previous procedure computes the AST similarity between the query and each query in the demonstration pool. then selects the top-3 most similar queries as demonstrations be included the prompt.
rounds. Given a new task decomposition query, the
Data Collection. During the search process, Decomposition Synthesis Procedure collect two types of data for subsequent offline reinforcement learning:
Successful Trajectories: Sequences of {(1,, u1), (gns yn)} that successfully decompose the target SQL, used for supervised fine-tuning.
Contrastive Node Pairs: Pairs of incorrect node (4. and their corresponding correct node (q"", ",",, used for preference learning.
3.2
MARGIN-AWARE REINFORCEMEN LEARNING
LearNAT propose a Margin-aware Reinforcement Learning framework to train the LLM for de- composing complex NL2SQL tasks into simpler subtasks. The framework consists of two phases. First, Margin-aware Reinforcement Learning fine-tunes the LLM in a supervised manner based on correct decomposition trajectories, enhancing the model's ability to perform task decomposition and generate the correct output format. Then, Margin -awaee Reinforcement Learning conducts di- rect preference optimization (DPO) with AST margin on the LLM using contrastive node pairs, suppressing incorrect subtask outputs and achieving finer-grained preference alignment.
Warm-up Strategy for Foundational Skill Acquisition. Given the training data from Decomposition Synthesis Procedure, Margin-aware Reinforcement Learning first performs supervised fine-tuning on successful decomposition trajectories. In a training instance (Q, DB, KC, ((1, 1/),, ; prompt æ and {91, 81), (4n. } as the target response t, so the supervised fine-tuning objec- tive is to minimize the log- eiglliellhood loss:
vn))), Decomposition Synthesis Procedure treats [Q, DB, K,, as the
Esrt E(r,t)
Σ log po (t, t1)-1,z)
(6)
where 8 represents the fine-tuned LLM parameters, and po (t x) conditional probability distribution of target subtask subSQL sequence t given prompt x. I the sequence length of f, and is the aggressgeee decoding step.
IT'm Po (t, teg, x) is the
DPO with AST Margin. A phenomenon of pessimism suggests that the positive feedback pro- vided by SFT alone cannot prevent L.LMs from generating erroneous reasoning pathways. Existing

---

Published as a conference paper at ICLR 2026
Table 1: Results of Decomposition Synthesis Procedure. The de- composition success rate and token consumption on BIRD-train are reported.
Linking
25
Float Computation
Methods
Success Rate
Token Cost
CoT
59.07%
16,735K
Unknow Rules
MCTS
71.55%
334,694K
Error Answer
AST Guide
78.01
133,877K
Self-improvement Demonstration
Figure 3: Error distributions of Decomposition Synthesis Proce- dure on randomly selected 50 er- cases from the BIRD-train.
round)
79.33%
137,456K
(2 round)
79.73%
142,017K
(3 round)
80.00%
145,977K
works Rafailov et al. (2023) indicates that, during the SFT phase, as the probability of preferred outputs (correct responses) increases, the probability of dispreferred outputs (incorrect responses) rises well. Margin-aware Reinforcement Learning employs DPO to suppress incorrect subtask outputs. Specifically, a training instance takes the form of (Q. DB, K., (qq.)))..
(9b-1.81-1)} (gl", .y,"" ",",,, (g's ){)), Margin-aware Reinforcement Learning treats [Q, DB, K, (91 v.).... (9i-1: 91-1) the prompt T, (q.", "²")) the prefer response, (g/ y as the disprefer response, and optimizes using DPO loss (see Eq. 13).
To enable finer-grained preference learning, Margin-aware Reinforcement Learning incorporates an offset into the DPO loss to measure the reward margin between positive and negative samples. The margin is directly computed using reward estimation based AST similarity, eliminating the need for training an additional reward model. Specifically, Margin-aware Reinforcement Learning estimates the reward margin between samples as follows:
margin((g.,, "(") (g. vt)) = R(s,) R(s)).
(7)
Finally, the loss of DPO with AST Margin is formulated as follows:
LADPO Fret) -E( [log (fo(2, fo(a, v1) A,)],
where A, margin( (q,", ","",, (g's v/)) is the offset, measuring the reward margin between positive
and negative samples. The AST margin effectively guides the model to learn not only which de- composition steps are preferred, but also how much they are preferred, leading to more nuanced and effective multi-step reasoning capabilities.
EXPERIMENTS
4.1 EXPERIMENTAL SETUP
Datasets. We the BIRD-train dataset (Li al., 2023b) synthesize decomposition data for complex NL2SQL tasks within the Decomposition Synthesis Procedure, which is subsequently em- ployed for Margin-Aware Reinforcement Learning. Then, utilize BIRD-dev (Li et al., 2023b) (In-Domain) and Spider-dev (Yu et al., 2018) (fut-of-Domain) to evaluate the effectiveness and ro- bustness of LearNAT. Notably, the databases and user questions in the training and sets differ completely. A detailed introduction to the datasets and their statistical information is provided in Appendix. D.
Evaluation Metrics. Since the SQL expression styles generated by LLMs may differ from the ground truth in NL2SQL benchmarks (Shin et al., 2021), traditional string- evaluation metrics, such Exact Match Accuracy (Yu et al., 2018), are not suitable for our study. Therefore, following prior works (Liu et al., 2023; Rajkumar et al., 2022; Fan et al., 2024a), we adopt the Execution Accuracy (EX) metric. which evaluates the correctness of generated SQL queries by comparing their execution results with those of the corresponding ground-truth queries retrieved from the database. For additional experimental details, please refer to Appendix. F.I.

---

Published as a conference paper at ICLR 2026
Table Performance comparison on Spider-dev and Bird-dev benchmarks. All baseline results are taken directly from the performance reported on Leaderboard. Bold indicates the best result, while underline denotes the second- boot results achieved by LearNAT.
BIRD-dev (la-Domain)
Spider-der (Out-af-Dumain))
Simple
Muderate Challenging
Total
Easy
Mediam
Hard
Extra Hard
Total
System-Level
C3-SQL
GPT-4
58.9
38,5
31.9
50.2
92.7
85.2
77.6
62.0
82.0
DIN-SQL
NerulPS
50.7
91.1
79.8
64.9
43.4
MeraQQI
ICD::
(PIT44
91.1
74.7
64.1
36.1
69.6
MAG-SQL
GPT-4
65.9
46.2
41.0
57.6
85.3
SuperSQL.
VLDB'24
MAC-SQL
COLING
GPT-1
65.7
52.7
10.3
59.4
86.7
Modet-LLevel
ACT-SQI
E'2
GPT-4
79.4
67.8
44.0
74.5
CaiQQL
VLDB
95.8
88.3
74.7
62.7
83.7
DAIL-SQU
VLDE
GPT-4
62.5
43.2
37.5
54.3
90.3
81.8
66.1
50.6
76.2
SENSE
ACL/24
CodeLLaMA-133
55.5
95.2
58.6
75.9
60.3
83.5
CodeS.7B 77B
40.3
57.0
91.0
CodeS-15B
65.8
48.8
42.4
58.5
95.6
90.4
78.2
61.4
84.9
Oure
QwenZ S-Cader-78
48.4
42.4
5X.1
92.4
76.4
67.5
LearNA1
Qwen2: 1-Coder-14BB
68.5
51.1
15.8
61.2
95.6
91.5
80.5
68.7
86.9
Qwen2. C-Cdder-332
70.7
55.5
59.0
65.0
96.4
92.4
85.1
69.3
88.4
Baselines. this experiment, we compare two types baselines, including 8 system-level ap- proaches and model-level approaches. A detailed introduction the baseline models and their statistical information provided in Appendix. E. We consider two complementary evaluation Prrrggees-Compeittee the Public Leaderboard and Comparison under Identical Evaluation Protocol comprehensively assess the superior performance of LearNAT.
4.2 EXPERIMENTAL. RESULTS
Results of Decomposition Synthesis Procedure. We evaluated the decomposition performance of the Decomposition Synthesis Procedure on BIRD-train and compared it with several baseline de- composition algorithms, including CoT and naive MCTS. The experimental results are shown in Ta- ble. 1. The results indicate that the Decomposition Synthesis Procedure achieved an 80.00% decom- position success rate, outperforming CoT and naive MCTS by 20.93% and 8, 8.45% respectively. Additionally, it is noteworthy that MCTS generated large number of invalid searches, leading to excessive token consumption. In contrast, our proposed Decompoxition Synthesis Proceduue uti- lizes AST-guided pruning, enabling high-performance and low-cost (56.38%. decomposition syn- thesis. We further tested the performance of self- self-improving demonstrations over multiple rounds. The results show that adaptive demonstrations significantly improve model performance (1.99%1), However, this strategy also has inherent limitations. Table. reveals that self- tuff-improving demon- strations achieved notable performance gains in the first round (1.32%1), f), but in the subsequent two rounds, the decomposition performance began to diminish (only 0.4% and 0.27%*). Therefore, to minimize token consumption, did not proceed with fourth round of decomposition.
To further investigate the reasons for the failure of the Decomposition Synthesis Procedure in certain cases, we randomly selected 50 unsuccessful cases for error analysis. The error distribution is shown in Fig. 3. We analyze these errors one by one by presenting typical cases for each of the four error attributions in Appendix. F.2.
Competition on the Public Leaderboard. We evaluate LearNAT on Spider-dev' and BIRD-dev² benchmarks. To further assess LearNAT's robustness, fine-tune Qwen2.5-Coder models with 7B, 14B, and 32B parameters. Additionally, we compare LearNAT against recent competitive baselines from the past two years on leaderboard. The results are presented in Table. 2.
Compared with system-level methods, LearNAT-vver with only 7B model-already outper- forms most approaches, although these approaches leverage larger-scale models such as GPT-3.5 or GPT-4 as backbone LLMs. For example, the Spider-dev dataset, LearNAT (7B) achieves an overall accuracy of 86.4%, outperforming eight baseline methods and ranking just behind MAC-
wtt.hth........c.ooooee.oo io/spider Phttps: htdb///erdddbbecc thub. io/
8

---

Published as a conference paper at ICLR 2026
Table Performance comparison of L LearNAT and competitive literature under identical evaluation protocol. Bold indicates the better result.
Medkods
Evaluation Protocal
L.Mss
det (In- (n-DDomaln)
Spidor-dev (Ont-aff (Ont-ef-Donaie)
Total
Simple
Maderott
Challeaging
Tasal
Fasy
Mediam
Hord
Extrr
SynCuT
SynCuT
Qwen2.5-11 5-7-nnmmmtt
59.2
78.9
67.1
Loardis
SynCol'
Qwen2. 5 Codec 7B
67.6
48.0
45.8
59.6
91.9
91.0
71,3
63.9
83.6
69.2
OmniSQr.
OmeiSQL
Qwen2.5:11 5:m-imett
63.9
81.2
70.9
Learshi
OmniSQL
Qwes2.5 7B Instuct
68.2
50.3
50.7
61.1
96.0
91.3
77.6
65.1
86.0
71.1
SVL-ol
SQL-ol
Llama3-S8 33 Qwen2 5-Crle-776
71,8
52.3
45.2
63.4
94.4
93.0
81.0
05.7
87.4
73.1
TearNAT
sQl-ol
72.5
54.2
49.1
64.8
96.4
94.8
78.2
74.1
89.1
74.6
Alpha-SQL
SQLL
(wenZ 5 Codeze 7B
72.6
59.3
53.1
66.8
94.0
59.2
76.4
63.3
84.0
73.7
TearNAT
Alpha-SQI.
Qwen2.5-Crdeze 5-Crda--866
74.4
61.5
52.8
68.4
97.2
96.0
80.5
77.1
90.6
77.4
SQL and SuperSQL. The larger variant, LearNAT (32B), reaches 88.4% overall accuracy, surpass- ing all listed system-level approaches and outperforming the second- best method, SuperSQL, by 1.4%f. Similar trends are observed on the BIRD-De Dev dataset. It is worth noting that although Lea NNAT (7B) performs slightly worse than MAC-SQL and SuperSQL., both of these belong to the system-level category. They involve more complex NI.2QQL pipelines, including generating multi- ple candidates, SQL refinement, and consistency checks, which typically incur high token overhead. In contrast, LearNAT (7B), model-level method, generates the final SQL in a single forward pass without requiring additional token consumption. While maintaining the efficiency of model- level generation, it not only outperforms all other model-level baselines but also exceeds several system-level methods. This highlights LearNAT's superior trade-off between performance and to- ken cost.
Compared to model-level methods, Lea TNAT demonstrates, more significant performance advan- tage. Among the fine-tuning-
approaches mentioned, the most competitive is CodeS, therefore evaluate both the 7B and 15B versions of CodeS. Experimental results show that LearNAT (7B) achieves a 1.0%f on Spider-dev and a f on BIRD-dev over CodeS (7B). Similarly, LearNAT (14B) outperforms CodeS (15B) by f.0%f on Spider-dev and 2.7%1 on Spider-dev. This indi- cates that LearNAT maintains a performance advantage across different model sizes.
Comparison under Identical Evaluation Protocol. We further compare the performance of LearNAy with a wider range of competitive prior works, including SynCoTT (Liu et al., 2025), SQL-o1 (Lyu et al., 2025), Alpha-SQL. (Li et al., 2025a), and OmniSQL. (Li et al., 2025b). Because these baselines employ different evaluation protocols. For example, SynCoT triggers multi-step rea- soning during inference, while SQL-ol and Alpha-SQL perform MCTS-based search at inference time to generate additional candidate SQLs. We adopt the checkpoints of LearNA: and evaluate it under the same protocols as these baselines ensure fairer comparison. The experimental results are presented in Table. 3. The results show that LearNAT consistently surpasses SynCoT, SQL-ol, and AIpha-SQL., and although its performance on the BIRD dataset is slightly lower than OmniSQL, Lea rNAT achieves superior overall performance across both Spider and BIRD.
Notably, the overall performance of Lear NAT can be further improved if additional search is intro- duced during inference. For example, when applying the inference-time search strategy of Alpha- SQL, LearNAT's performance on the BIRD dataset increases from 58. 1% to 68 68.4%. However, we also note a significant concern: the token consumption during inference rises sharply, from 1.8K tokens per query to 204.5k² tokens per query.
Both LearNAT and OmniSQL optimize NL2SQL performance by constructing synthetic datasets. However, OmniSQL focuses on synthesizing a much larger training dataset with 2.5M queries, whereas Lea rNAT emphasizes constructing training data with verifiable intermediate subtasks, improving data quality without increasing data quantity. Specifically, since LearNAT generates subtask data based on BIRD-Train, the resulting training set contains only 7.2k queries.
Ablation Study. We evaluate the necessity of each component in LearNAT by systematically removing individual components and assessing the model's performance. We use Qwen2.5-Coder- 7B as the backbone LLM and conduct evaluations on Spider-dev and BIRD-dev. The results are summarized in Table. Experimental results show that removing or replacing any single component
"httpss///peereevieew formmmirmmmmmm k-k Ind.tm)

---

Published as a conference paper at ICLR 2026
Table 4: Ablation study analysis of LearNAT using Qwen2.5-Coder-7B as backbone LLM. The green font indicates the performance loss incurred after the removal of the respective module.
deR (In-Domain)
Spider-dev (Out-ef-Dumain)
Methods
Simple
Moderate
Challenging
Easy
Medium
Hurd
LearNAT
65.4
48,4
42.4
58.1
95.2
92.4
76.4
67.5
86.4
LeazNar
w/o Tea YNA
56.1 (9:1))
34.5 (1991)
33,8 (L
47.5 (1oa))
82.7 (355
84.1
71.8
54.8
77.0
LearNAT-
61.7 pou
34.7 (.0
$2.8 (5:3))
84.7 005g
86.1 (63
74.1 (25)
56.6 (10RL)
79.0 (AA)))
LesrbAT-Coff
57.3
37.6
36.1
49,3
87.1
85,2
75.3
56.6
79.4 (904
Decompositio Syntheris Procedure
w/o AST Guide
62.6 (::
41.5 (s)
29.2 0330
53.1 (s0
85.9 (0
87.9
69.5
60.2 (170)
79.9 (8.5))
Margl Reinforcement Learning
63.4 (2:1)
(5:2))
34.0 (53u
(:3
88.8 (1.3))
(9.0))
62.7 (1:3)
81.0 (333)
w/o MDPO
62.8 1260)
42.4 15m)
31.9 (042)
53.7 (443)
87.1 (831)
88.6 (1.3))
70.1 (6.3)
62.7 (431)
80.9 (5.A))
MDPO-+DPO
64.6
46.7
37.5 (40L)
(6.6(144))
93.5 (16
91.7
74.1
66.3
85.1
MDPO-KTO
63.1 (231)
43.9 1S5
34.7 0.0
64.6
89. (601)
90.6 (183)
(8.4
63.9 (342)
82.2 (471)
MDPO -PO
62.5
42.6
32.6 e:7
53.7
86.3
91.0
65.5
64.5
81,3
leads to a decline in model performance. A detailed analysis of these experiments can be found in Appendix. F.3.
5 LIMITATIONS, FUTURE WORK, AND CONCLUSION
Rooted in Model-Lever Research. Frankly speaking, LearNAT does not achieve the best perfor- mance on BIRD. For instance, CHASE-SQL. (Pourreza et al., 2024), which leverages Gemini (But- terly, 2017), attains 74.9% accuracy on BIRD-dev, outperforming LearNAT (30B), which achieves 65.0% (9.9%L). Nonetheless, it is important to clarify that CHASE-SQU SQL reflects a system-level solution, whereas the reported performance of LearNAT is evaluated strictly under model-level setting. Although most studies do not disclose their token costs, useful comparisons can still be drawn from the limited information available. For example, CHASE-SQL reports average token consumption of 160K* tokens per query, whereas LearNAT requires only 1.8K tokens per query. This stark contrast demonstrates that LearNAT is more aligned with the objectives of this study, which emphasize openness, democratization, and low-resource deployment.
Toward Seveem-Level Exploration. At present, LearNAT has primarily focused on model-level development. In future work, we aim to further investigate the test-time scaling law of LearNAT to improve its performance. Appendix Fig. 10 provides a preliminary exploration of this direction, showcasing the potential of LearNAT at the system level. Moving forward, we plan to integrate more advanced techniques to enhance performance while minimizing token overhead, thereby sys- tematically exploring the trade-off between accuracy and computational cost.
Conclusion. In this work, we propose LearNAT, a novel framework designed to improve the per- formance of LLMs on NL22QQI. tasks by leveraging task decomposition and reinforcement learning. Our design is motivated by extensive preliminary experiments, through which we propose a verifi- able task decomposition procedure and introduce margin-aware DPO algorithm to optimize LLMs. The effectiveness of our approach is validated on two public NL2SQL benchmarks. Although the present study is limited to model-level improvements, potential of LearNAT at the system level. We contend that LearNAT represents an important step toward achieving openness, transparency, and efficiency in NL,2QQ
preliminary explorations demonstrate the
ETHICS STATEMENT
All datasets used for training and evaluation in this study publicly available versions. The datasets have been curated, cleaned, and de-identified by their respective data providers prior to release. No patient personal information identifiable medical data is present. Consequently, the research does not involve human subjects, and there are no related concerns regarding privacy, con- fidentiality, or legal liability.
"https://openrewiiee /f/ forum? Cocommgoooxxxx
10

---

Published as a conference paper at ICLR 2026
We strictly adhered the usage and redistribution licenses provided by the original dataset authors and hosting platforms. Our research poses no risk of harm to individuals or groups and does not contain any potentially harmful insights, models, or applications. Additionally, there are no conflicts of interest or sponsorship concerns associated with this work. We are committed to research integrity and ethical standards consistent with the ICLR Code of Ethics.
REPRODUCIBILITY STATEMENT
We actively support the spirit of openness and reproducibility advocated by ICLR, To ensure the reproducibility of our research, we have taken the following measures:
Disclosure of Base Models: All base models used in our experiments are explicitly identified and described in the main manuscript. This allows readers to directly reference and obtain these models.
Datasets and Experimental Details: All experiments are conducted on publicly available datasets. In Appendix. D, provide comprehensive description of our experimental datasets. We also detail the experimental setup Appendix. F.1. These details facilitate transparent verification and replication of our results.
Open-Source Code Release: To further support reproducibility, we release all training and evalu- ation code in public repository (https: : / / witthub..... com/MrBI @ftrBlanknn ankness LLa rNAT). The repository contains clear instructions on installation, data downloading, preprocessing, and ex- perimentation, allowing interested researchers to replicate our results with minimal effort.
We believe that these actions align with the open science principles championed by the ICLR com- munity, and we are committed to supporting the reproducibility and transparency of our work.
8 USE OF LLM
In the preparation of this manuscript, we utilized large language models (LLM) solely for writing assistance purposes. Specifically, we employed the GPT-4. 1-0414 model to polish language expres- sions, condense sentences, and improve the overall clarity and readability of the text. The model was used exclusively for editing and refining manuscript language and did not participate in any conceptual technical aspects of this work.
All research ideas, theoretical proof methods, experimental designs, and visualizations were con- ceived, executed, and finalized by the authors without the involvement of any LLM tools. The development of new concepts, formulation and validation of proofs, experimental setups, analysis of results, and the creation of figures were performed independently by the research team. At no point was the LLM model used to generate, modify, validate the scientific content, methodology, or results presented this article.
We emphasize that the role of WPT--.1-0414. in this research was strictly limited to linguistic en- hancement the writing stage, and that all substantive intellectual and scientific contributions orig- inate solely from the authors.
ACKNOWLEDGMENTS
This work supported by the National Natural Science Foundation of China under Grant 62576013, 62406036, and the Beijing Municipal Natural Science Foundation under Grant L251042..
REFERENCES
Dario Amodei, Chris Olah, Jacob Steinhardt, Paul Christiano, John Schulman, and Dan Mané, Con- crete problems in ai safety. arXiv preprint 16l.:66660066655 2016.
Ralph Allan Bradley and Milton E Terry. Rank analysis of incomplete block designs: I. the method of paired comparisons. Biometrika, 39(3/4):324-344 1952....

---

Published as a conference paper at ICLR 2026
Adam Butterly. Gemini: Technical Report. PhD thesis, Dublin, National College of Ireland, 2017.
Guoxin Chen, Minpeng Liao, Chengxi Li, and Kai Fan. Alphamath almost zero: process supervi- sion without process. CoRR, abs/2405.03555 2024, doi: 1048500ARXW.22400055555 URL https:///oi.... wtwpioooggoooooo 48550/ 2wt.xi....4......
Paul F Christiano, Jan Leike, Tom Brown, Miljan Martic, Shane Legg, and Dario Amodei. Deep reinforcement learning from human preferences. Advances in Neural Information Processing Systems, 30, 2017.
Xuemei Dong, Chao Zhang, Yuhang Ge. Yuren Mao, Yunjun Gao, Chen, Jinshu Lin, and Dong- fang Lou. C3: zero-shot text-to-sql with chatgpt. CoRR, abs/2307.07306, 2023. doi: 10.48550/ ARXIV URL https:://// /tt///di.i./ ooooi.oogg1000 2tl...448850/aa...333.....
Sabit Ekin. Prompt engineering for chatgpt: quick guide to techniques, tips, and best practices. Authorea Preprints, 2023.
Ju Fan, Zihui Gu, Songyue Zhang, Yuxin Zhang. Zui Chen, Lei Cao, Guoliang Li, Samuel Madden, Xiaoyong Du, and Nan Tang. Combining small language models and large language models for zero-shot NL2SQL. Proc. VLDB Endow., (7(1))2755027663 2024a. doi: 10. 10.14778/368194 3681960. URL https::///// / /www. vldb. wwtppptgglaeoooo..o /vo11/ /ttp/////11////////0020 fan. paf.
Yuankai Fan, Zhenying He, Tonghui Ren, Can Huang, Yinan Jing, Kai Zhang, and X Sean Wang- Metasql: A generate-then-ruce framework for natural language to sql translation. In 2024 IEEE 40th International Conference on Data Engineering (ICDE), pp. 1765-1778. IEEE, 2024b.
Xidong Feng, Ziyu Wan, Muning Wen, Ying Wen, Weinan Zhang, and Jun Wang. Alphazero- like tree-search guide large language model decoding and training. arXiv preprint arXiv:2309.17179 2023.
Han Fu, Chang Liu, Bin Wu, Feifei Li, Jian Tan, and Jianling Sun. Catsql: Towards real world natural language to sql applications. Proceedings of the VLDB Endowment, 1636):153,-1447, 2023.
Dawei Gao, Haibin Wang, Yaliang Li, Xiuyu Sun, Yichen Qian, Bolin Ding, and Jingren Zhou. Text-to-sql empowered by large language models: A benehmark evaluation. Proc. VLDB Endow. 132--1133 2024. doi: 10. 011778/3641244.366 pvldb/vol17/pp 111111//1112-gaaee pdf.
URL https: /www. v vldb. org/
Xu Huang, Jianxun Lian, Yuxuan Lei, Jing Yao, Defu Lian, and Xing Xie. Recommender agent: Integrating large language models for interactive recommendations, ACM Transactions Infor- mation Systems, 43(4):1-33, 2025.
Hyeonbin Hwang, Doyoung Kim, Seungone Kim, Seonghyeon Ye, and Minjoon Seo. Self-explore to avoid the pit: Improving the reasoning capabilities of language models with fine- tieeggraieed re- wards, 2024. URL https: /awx/vivvvvv/////// www.ii.ogg/aaaa..aoooooooe abs /00bs//2244 24044 10346.
Hyeonji Kim, Byeong-Hooe Hoon So, Wook-Shin Han, and Hongrae Lee. Natural language to sql: Where today? Proceedings of the VLDB Endowment, 13(10): 2020.
Xin Lai, Zhuotao Tian, Yukang Chen, Senqiao Yang, Xiangru Peng, and Jiaya Jia. Step-dpo: Step- wise preference optimization for long-chain reasoning of llms. (oXi::2406.18699 2024.
Dongjun Lee, Choongwon Park, Jachyuk Kim, and Heesoo Park. MCS-SQL: leveraging multiple prompts and multiple-choice selection for text-to-sqi generation. In Owen Rambow, Leo Wan- ner, Marianna Apidianaki, Hend Al-Khalifa, Barbara Di Eugenio, and Steven Schockaent (eds.), Proceedings of the s1 International Conference on Computational Linguistics, COLING 2025, Abu Dhabi, UAE, January 19-24, 2025, pp. 337-353. Association for Computational Linguistics, 2025. URL htw.s:ttp////
ho logy. , orgg 2225. col nnnmmain .24/.
Boyan Li, Yuyu Luo, Chengliang Chai, Guoliang Li, and Nan Tang. The dawn of natural language to sql: Are we fully ready? Proceedings of the VLDB Endowment, 17(1 13311)3318-333, 2024a.
12

---

Published as a conference paper at ICLR 2026
Boyan Li, Jiayi Zhang. Ju Fan, Yanwei Xu, Chong Chen, Nan Tang, and Yuyu Luo. Alpha-sql: Zero-shot text-to-sql using monte carlo tree search. In forty-second International Conference on Machine Learning. 2025a.
Haoyang Li, Jing Zhang, Cuiping Li, and Hong Chen. RESDSQL: decoupling schema linking and skeleton parsing for text-to-sql. In Brian Williams, Yiling Chen, and Jennifer Neville (eds.), Thirty-Seventh AAAI Conference on Artificial Intelligence, AAAI 2023, Thirty-Fifth Conference Innovative Applications of Artificial Intelligence, IAAI 2023, Thirteenth Symposium on Ed- ucational Advances in Artificial Intelligence, EAAI 2023, Washington, DC, USA, February 7- URL
14, 2023, pp. 13067-13075. AAAI Press, 2023a. doi: 10.1609/AAALV3371...00 https: /oi.oo..... www.oogggo....... 609 10009//aa.vv300 v37111 26535.
Haoyang Li, Jing Zhang, Hanbing Liu, Ju Fan, Xiaokang Zhang, Jun Zhu, Renjie Wei, Hongyan Pan, Cuiping Li, and Hong Chen. Codes: Towards building open-source language models for text-to-sql. Proc. ACM Manag, Data, 2(3):127, 2024b. doi: 10.1145/3654900. URL https:
//doi. oroii.org/100 11111/1.114/335599900
Haoyang Li. Shang Wu, Xiaokang Zhang, Xinmei Huang, Jing Zhang, Fuxin Jiang, Shuai Wang, Tieying Zhang, Jianjun Chen, Rui Shi, al. Omnisql: Synthesizing high-quality text-to-sql data at scale. arXiv preprint 250::2250000224::: 2025b.
Jinyang Li, Binyuan Hui, Ge Qu, Jiaxi Yang, Binhua Li, Bowen Li, Bailin Wang. Bowen Qin, Ruiying Geng, Nan Huo, Xuanhe Zhou, Chenhao Ma, Guoliang Li, Kevin Chen- Chuan Chang, Fei Huang, Reynold Cheng, and Yongbin Li. Can LLM already serve A database interface? A big bench for large-scale database grounded text-to-sqls. In Alice Oh, Tristan Naumann, Amir Globerson, Kate Saenko, Moritz Hardt, and Sergey Levine (eds.), Advances in Neural Information Processing Systems 36: Anmual Conference on Neural In- formation Processing Systems 2023, NeurIPS 2023, New Orleans, LA, USA, December 10 16, 2023, 2023b. URL http: //atper/ nips. cc/ wacp/pape__aee leeiee//peee welee/pappr//2222 hash/83fcc8 2tos:/ASfoeaaa177333335obbbbbo 0110033300000011144c0oo000000000 Ben.cmarks. html.
Weibin Liao, Xu Chu, and Yasha Wang. Tpo: Aligning large language models with multi-branch & multi-step preference trees. arXiv preprint 241.::2410.1285., 2024.
Hunter Lightman, Vincet Kosaraju, Yuri Burda, Harrison Edwards, Bowen Baker, Teddy Lee, Jan Leike, John Schulman, Ilya Sutskever, and Karl Cobbe. Let's verify step by step. In The Twelfth International Conference Learning Representations, 2024.
Jianghao Lin, Xinyi Dai, Yunjia Xi. Weiwen Liu, Bo Chen, Hao Zhang, Yong Liu, Chuhan Wu, Xiangyang Li, Chenxu Zhu, et al. How can recommender systems benefit from large language models: A survey. ACM Transactions on Information Systems, 43(2):1-47, 2025.
Aiwei Liu, Xuming Hu, Lijie Wen, and Philip S Yu. A comprehensive evaluation of chatgpt's zero-shot text-to-sql capability. arXiv preprint arXhv:2303.1354/ 2023.
Hanbing Liu, Haoyang Li, Xiaokang Zhang, Ruotong Chen, Haiyong Xu, Tian Tian, Qi Qi, and Jing Zhang. Uncovering the impact of chain-of-thoughh reasoning for direct preference optimization: Lessons from text-to-sql. arXiv preprint 1rXiv:2502.11656 2025.
Shuai Lyu, Haoran Luo, Ripeng Li, Zhonghong Ou, Jiangfeng Sun, Yang Qin, Xiaoran Shang, Meina Song, and Yifan Zhu. Sql-ol: self-reward heuristic dynamic search method for text-to- sql. arXiv preprint arXiv:2502.1 1741, 2025.
Wenxin Mao, Ruiqi Wang, Jiyu Guo, Jichuan Zeng. Cuiyun Gao, Peiyi Han, and Chuanyi Liu. Enhancing text-to-sql parsing through question rewriting and execution-guided refinement. In Findings of the Association for Computational Linguistics ACL 2024, pp. 2009-2024, 2024.
Long Ouyang, Jeffrey Wu, Xu Jiang. Diogo Almeida, Carroll Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama. Alex Ray, al. Training language models to follow instructions with human feedback. Advances in Neural Information Processing Systems, 35: 27730-27744 2022.
13

---

Published as a conference paper at ICLR 2026
Mohammadreza Pourreza and Davood Rafiei. DIN-SQL: decomposed in-context learn- ing of text-to-sql with self-correction.
Alice Oh, Tristan Naumann, Amir Glober- son, Kate Saenko, Moritz Hardt, and Sergey Levine (eds.), Advances in Neural In- formation Processing Systems 36: Annual Conference on Neural Information Pro- cessing Systems 2023, NeurlPS 2023, New Orleans, IA, USA, December 10 16, 2023, 2023, URL (e222c66fffaaaaaaaacceeccccceee
wwwpiiippp.pppe.....eppppp http://appp.iillepppppeeeeeeeeee Abstract wwwf-renneeeeeeeeeeeeeeeeeeeeeee html.
Mohammadreza Pourreza, Hailong Li, Ruoxi Sun, Yeounoh Chung, Shayan Talaei, Gaurav Tarlok Kakkar, Yu Gan, Amin Saberi, Fatma Ozcan, and Sercan Ô. Arik. CHASE-SQL: multi-path reasoning and preference optimized candidate selection in text-to-sql. CoRR, abs/2410.01943, 2024. doi: 10445550/ARXI.2241000022 URL https: //to:.///oo..ee/ /ttpe///oo//0..50//211111 2410. 01943.
Mohammadreza Pourreza, Shayan Talaci, Ruoxi Sun, Xingchen Wan, Hailong Li, Azalia Mirho- seini, Amin Saberi, Sercan Arik, et al. Reasoning-sql: Reinforcement learning with sql tailored partial rewards for reasoning-enhanced -ehannce text-to-sql. arXiv preprint arXiv:2503.2311 2025.
Rafael Rafailov, Archit Sharma, Eric Mitchell, Christopher D Manning, Stefano Ermon, and Chelsea Finn. Direct preference optimization: Your language model is secretly a reward model. Advances in Neural Information Processing Systems, 36, 2023.
Nitarshan Rajkumar, Raymond Li, and Dzmitry Bahdanau. Evaluating the text-to-sql capabilities of large language models. arXiv preprint arXiv:2204.00499, 2022.
Amrith Setlur, Saurabh Garg, Xinyang Geng, Naman Garg, Virginia Smith, and Aviral Kumar. RI on incorrect synthetic data scales the efficiency of Ilm math reasoning by eight-fold, 2024. URL hittps://arxiie org/ alss / 220 6 14532.
Yongliang Shen, Kaitao Song, Xu Tan, Dongsheng Li, Weiming Lu, and Yueting Zhuang. Hug- ginggpt: Solving Al tasks with chatgpt and its friends in hugging face. In Alice Oh, Tris- tan Naumann, Amir Globerson, Kate Saenko, Moritz Hardt, and Sergey Levine (eds.), Ad- vances in Neural Information Processing Systems 36: Annual Conference
Neural Infor- mation Processing Systems 2023, NeurIPS 2023, New Orleans, LA, USA, December 10 16, 2023, 2023. URL http: /tatt::/pappessssse hwwppsappppspppapppeepeaaaaeeeap cttpppssccpppppppepppep /ttp:///ee/pppp///////e///p html.
Richard Shin, Christopher Lin, Sam Thomson, Charles Chen Jr, Subhro Roy, Emmanouil Antonios Platanios, Adam Pauls, Dan Klein, Jason Eisner, and Benjamin Van Durme. Constrained language models yield few-shot semantic parsers. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pp. 7699-7715, 2021
Josefa Lia Stoisser, Mare Boubnovski Martell, Lawrence Phillips, Casper Hansen, and Julien Fauqueur. Struct-llm: Unifying tabular and graph reasoning with reinforcement learning for mantic parsing, arXiv preprint ar arXiv:2506.21575 2025.
Ruoxi Sun, Sercan Ö. Arik, Hootan Nakhost, Hanjun Dai, Rajarishi Sinha, Pengcheng Yin, and Tomas Pfister. Sql-palm: Improved large language model adaptation for text-to-sql. CORR, abs/2306.00739, 2023. doi: 1044550ARRXI.2206.00777
URL https: http:/oi.oorggg/
48550/arXiv. 2306 00739.
Shayan Talaei, Mohammadreza Pourreza, Yu-Chen Chang, Azalia Mirhoseini, and Amin Saberi. CHESS: contextual harnessing for efficient SQL synthesis. CoRR, abs/2405. 16755, 2024. doi: 10. 48550/ARXIV.2405..66
URL https: doi. org/10...//ooo 1..00.88850 48550/
Bing Wang, Changyu Ren, Jian Yang, Xinnian Liang. Jiaqi Bai, Linzheng Chai, Zhao Yan, Qian- Wen Zhang, Di Yin, Xing Sun, and Zhoujun Li. MAC-SQL: A multi-agent collaborative framework for text-to-sql. In Owen Rambow, Leo Wanner, Marianna Apidianaki, Hend Al- Khalifa, Barbara Di Eugenio, and Steven Schockaert (eds.), Proceedings of the 31st Interna- tional Conference Computational Linguistics. COLING 2025, Abu Dhabi, UAE, January 19-24, 2025, pp. 540-557. Association for Computational Linguistics, 2025. URL https: //aclantho ogy org/ 2025. coling-ma 36/.
14

---

Published as a conference paper at ICLR 2026
Peiyi Wang, Lei Li, Zhihong Shao, Runxin Xu, Damai Dai, Yifei Li, Deli Chen, Yu Wu, and Zhifang Sui. Math-shepherd: Verify and reinforce Iims step-by-step without human annotations. In Pro- ceedings of the 62nd Anmual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 9426-9439, 2024.
Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Fei Xia, Ed Chi, Quoe V Le, Denny Zhou, et al. Chain-of Chain-offthouuhtt prompting elicits reasoning in large language models. Advances in neural information processing systems, 35:24824-2433 24837, 2022.
Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Rémi Louf, Morgan Funtowicz, al. Huggingface's transformers: State-of-the natural language processing. arXiv preprint arXiv:1910.03771, 2019.
Lixia Wu, Peng Li, Junhong Lou, and Lei Fu. Datagpt-sql-7hh An open-source language model for text-to-sql. CoRR, abs/2409. 2024. doi: 0044550/ARXIV.24091555 URL https:
///ooi.org/1/ 48540/555//// /arovv.ravv.v...a 2409. 15985.
Wenxuan Xie, Gaochen Wu, and Bowen Zhou. Mag-sql: Multi-agent generative approach with soft schema linking and iterative sub-sql refinement for text-to-sql. arXiv preprint arXiv:2408.0799 2024a.
Yuxi Xie, Anirudh Goyal, Wenyue Zheng, Min- Yen Kan, Timothy P Lillicrap, Kenji Kawaguchi, and Michael Shieh. Monte carlo tree search boosts reasoning via iterative preference learning. arXiv preprint arXiv:2405.0045: 2024b.
An Yang. Baosong Yang. Binyuan Hui, Bo Zheng, Bowen Yu, Chang Zhou, Chengpeng Li, Chengyuan Li. Dayiheng Liu, Fei Huang, Guanting Dong, Haoran Wei, Huan Lin, Jialong Tang, Jialin Wang. Jian Yang. Jianhong Tu, Jianwei Zhang, Jianxin Ma, Jianxin Yang, Jin Xu, Jingren Zhou, Jinze Bai, Jinzheng He, Junyang Lin, Kai Dang, Keming Lu, Keqin Chen, Kexin Yang, Mei Li, Mingfeng Xue, Na Ni, Pei Zhang, Peng Wang, Ru Peng. Rui Men, Ruize Gao, Runji Lin, Shijie Wang. Shuai Bai, Sinan Tan, Tianhang Zhu, Tianhao Li, Tianyu Liu, Wenbin Ge, Xiaodong Deng, Xiaohuan Zhou, Xingzhang Ren, Xinyu Zhang, Xipin Wei, Xuancheng Ren, Xuejing Liu, Yang Fan, Yang Yao, Yichang Zhang, Yu Wan, Yunfei Chu, Yugiong Liu, Zeyu Cui, Zhenru Zhang, Zhifang Guo, and Zhihao Fan. Qwen2 technical report. CoRR, abs/2407. 10671, 2024a. doi: 10.48550//RXII.240.... 10677. URL https: htap:p:://dd/ doi orgg10...00.. 48550 /t55//////iivv/// 2407. 10671.
Jiaxi Yang, Binyuan Hui, Min Yang, Jian Yang. Junyang Lin, and Chang Zhou. Synthesizing text- to-sql data from weak and strong 1lms. In Lun-Wei Ku, Andre Martins, and Vivek Srikumar (eds.), Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume I: Long Papers), ACL 2024, Bangkok, Thailand, August 11-16, 2024, pp. 7875- Association for Computational Linguistics, 2024b. doi: 10. URL https:tt//// /tt//ooo.orgggoo /00. 1t/.//1.11111 118653/v12200 acl- .25.
Tao Yu, Rui Zhang, Kai Yang. Michihiro Yasunaga, Dongxu Wang, Zifan Li. James Ma, Irene Li, Qingning Yao, Shanelle Roman, Zilin Zhang, and Dragomir R. Radev. Spider: A large-scale human-labeled dataset for complex and cross-domain semantic parsing and text-to-sql task. In Ellen Riloff, David Chiang, Julia Hockenmaier, and Jun ichi Tsujii (eds.), Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, Brussels, Belgium, October 31- November 4. 2018, pp. 3911-3921. Association for Computational Linguistics, 2018. doi: 10.18653/V1/D18... 1425. URL https: doi wwt.ooggg/oooo 10. 11t..//11////11./..
Hanchong Zhang, Ruisheng Cao, Lu Chen, Hongshen Xu, and Kai Yu. Act-sql: In-context learning for text-to-sql with automaticalll--eeeraaee chain-of-thought. In Findings of the Association for Computational Linguistics: EMNLP 2023, pp. 3501-3532, 2023a.
Shengyu Zhang, Linfeng Dong, Xiaoya Li, Sen Zhang, Xiaofei Sun, Shuhe Wang, Jiwei Li, Runyi Hu, Tianwei Zhang, Fei Wu, et al. Instruction tuning for large language models: A survey. arXiv preprint 2308 10792, 2023b.
Zeyu Zhang, Quanyu Dai. Xiaohe Bo, Chen Ma, Rui Li, Xu Chen, Jieming Zhu, Zhenhua Dong, and Ji-Rong Wen. A survey on the memory mechanism of large language model based agents. ACM Transactions on Information Systems, 2024.
15

---

Published as a conference paper at ICLR 2026
Yaowei Zheng, Richong Zhang, Junhao Zhang, Yanhan Ye, Zheyan Luo, Zhanghhi Feng, and Yongqiang Ma. Llamafactory: Unified efficient fine-tuning 100+ language models. arXiv preprint arXhv:2403.13372 2024.
16

---

Published as a conference paper at ICLR 2026
A PRELIMINARY EXPERIMENTS
Find average salary employees older 30 in al departments and return the name of the depertment with the highest salary.
SELECT
FROM depariments d
JOIN employees ON diid = e.department_je ji WHERE >30
GROUP BY
ORDER BY AVG(e.salary) DESC
LIMIT
(a) LLM on complex NL2SQL task.
Subtacke11 Find employess older than
Subtaski22 Callcuatte the aneragee salery for each depertie department..
Subtaski3:
department highest average salory
SubSQL#1:
SELECT id, name, depertment jd. salery
FROM employees
WHERE >00
SubSQLI2:
SELECT depariment jactieeetiiiiieee http:n/tddd.////aaaaa AVG(Salaar)) AS avg. salaryy
FROM
(SubSQLØ1)
JAS subquery
GROUP BY department id;
SELECT diname
FROM departments
JOIN
(SubSQL#2)
AS avg, sasasaalaabbll lable
ON dild = avg. avg_salley__tte..eeeeee wtt___llry_tbblle.oooe dabbl.dtpattmettt _d
ORDER BY reg_salory_labe lable lwwp:aaaae_eeeeeee.eo avgasalary DESC
LIMIT 1;
(b) LLM on multiple simple NL2SQL subtasks.
Figure 4: (a) illustrates the LLM directly solving a complex NL2SQL task, resulting in an incorrect output. (b) shows the LLM solving multiple decomposed simple NL2SQL subtasks from the same task in (a), resulting in a correct output. This motivates our approach to enhancing the LLM's s ability decompose complex tasks, thereby improving its performance challenging N1.2SQL queries.
SELECT
Subtesk#1
Subteski2
FROM
ORDDER BY
LIMIT
Sublask#3
DESC
departmmnts
SELECT
XV9_5olory
decw mene_ii Jil
ORDER
Arta
departionn
satory
SELECT
dostrrment_
capartnentc.
selaly
Clause Nodes
ergpioyeee
Operatar Nodes
RgR
30
Operand Nodes
Figure 5: The abstract syntax tree (AST) of the given case in Fig. 4. Each simple NL2SQL subtask in Fig. corresponds to subtree within the AST. Clause nodes, operator nodes and operand nodes were defined in Sec. B.
17

---

Published as a conference paper at ICLR 2026
Score of
Owen2.5 Coder 32B
Methods
hp
SQL
54.0%
84.4%
Query
Subtaska
SubSQL
57.4%
Subtasks
SubSOLs
Figure preliminary experiment was conducted. We randomly selected 500 cases from the BIRD Train dataset and employed QWen-2.5-Codee to perform the NL2SQL task. The experimental results indicate that enhuncing the LLM's task decomposition ability crucial for improving its performance on NI NLISQI tasks.
Gold SQL
Query
SubSQLs
Sublasks
Subtask Generation
Subtask Evaluation
(a) AST-based Decomposition with Semantic Verification
Query
Subtasks
SubSQLs
Gold SQL
Subtask Generation
Subtask Evaluation (
(b) Search-based Decomposition with AST-based Verification
Figure 7: AST-based Decomposition vs. Search- Decomposition
Table 5: Experimental results on evaluating subtask correctness using language models.
Accuracy
Models
Correct (227)
Error (273)
Total (500)
sentence-transformer
92.1
9.2
46.8
GLM-4
45.4
20.5
36.0
B TECHNICAL FOUNDATIONS
Natural Language SQL (NL2SQL). The goal of the NL2SQL task is translate natural language (NL) question Q into corresponding SQL query Y. based on database schema DB. In more complex scenarios, such as those presented by BIRD (Li al., 2023b), interpreting NI. questions or understanding database values may require incorporating external knowledge, denoted by K. The prevailing approach to the NL2SQL task adopts cross-domain framework to assess model's generalization ability by keeping the training, development, and test sets distinct.
Abstract Syntax Trees (AST). An Abstract Syntax Tree (AST) a structured, hierarchical rep- resentation of an SQL query, where each element of the query is captured as a node and the relation- ships between these elements are encoded as edges. This tree-based structure abstracts away from the linear textual representation of SQL, focusing instead on its grammatical structure and logical organization. Formally, the AST an SQL query Y can be defined as directed acyclic graph (DAG) AT(Y) (N,E), where N is the set of nodes, each representing syntactic component of the SQL query. Specifically, every node n A corresponds to a clause, operator, or operand. We categorize the nodes follows:
18

---

Published as a conference paper at ICLR 2026
Table 6: Notations of Basic Symbols and Their Descriptions Used in This Manuscripts.
Symbol
Description
Natural Language to SQL (NL2SQL)
Q
Natural language (NL) question
Y
Corresponding SQL query
DB
Database schema
I.
External knowledge
Abstract Syntax Trees (AST)
Abstract Syntax Tree, a directed acyclic graph of SQL query Y
AT(Y) (W.8)
N & E N X ne N
Set of nodes in AST Set of edges in AST Clause Nodes
no E.
Operator Nodes
Ry E No
Operand Nodes
Monte Carlo Tree Search (MCTS)
T = (S, M) S A(s) M MCSxS X (8saa) ((s)
MCTS search tree
Set of states or nodes in the search space Set of actions available state
Set of edges
Estimated reward for taking action from state Visit count of node
Constant that controls the exploration-eeploittaion
trade-off
Direct Preference Optimization (DPO)
x
Prompt
Yo
Preferred response
y1
Dispreferred response
PD
Probability of preference
TT
Policy model
Tref
Reference model
B
Parameter that regulates KL divergence
Clause Nodes (n, E Ny): Represent core SQL clauses, such as SELECT, FROM, WHERE, GROUP
BY, and ORDER BY.
Operator Nodes (n, E N.): Represent logical or arithmetic operations, such as AND, OR, =, >, and <.
Operand Nodes (n, E N₁): Represent terminal elements like table names, column names, liter- als, values from the database schema.
C N' A is the set of edges, where each directed edge myy) & captures syntactic dependency from parent node to child node nj. These edges reflect the hierarchical structure of the query, where high-level clauses dominate subcomponents or conditions.
The root node of AT corresponds to the main clause of the query, typically the SELECT clause. From the root, child nodes represent subsequent clauses or expressions, forming hierarchical de- composition of the SQL query. For example, a WHERE clause node may have child nodes corre- sponding to individual conditions, which in turn may contain operators and operands as descen- dants. This formal representation enables structured understanding of SQL queries, facilitating decomposition, syntactic validation, and step-wise reasoning. In text-to-SQL. tasks, leveraging the AST structure allows efficient navigation of complex queries by guiding models through the logical and hicrarchical relationships in SQL syntax.
Monte Carlo Tree Search (MCTS). Monte Carlo Tree Search (MCTS) is heuristic search algo- rithm used for decision-makee in large and complex search spaces. It combines rreebased search with stochastic sampling to balance exploration and exploitation, making particularly effective for problems with vast unknown state spaces. In the context of reasoning and sequential decision-
19

---

Published as a conference paper at ICLR 2026
making, MCTS provides efficient framework for discovering optimal strategies by incrementally building search tree guided by simulation-basl basedd evaluations. Formally, MCTS operates on a search tree T AS),. where:
S the of states nodes in the search space. Each node S represents a specific con- figuration of the environment, such as a partially completed plan or subproblem in a reasoning task.
A(s) denotes the set of actions available at state Each action leads to a child state s', expanding the search tree.
.M S S x S represents the set of edges, where each edge corresponds to transition between states through an action.
The MCTS algorithm proceeds iteratively through four phases:
1. Selection: Starting from the root node so. the algorithm recursively selects child nodes based on selection policy, typically using the Upper Confidence Bound for Trees (UCT) criterion:
a" = arg max aEA(x)) (Q(s.a)+c.
log N()) N(s.a)
(9)
where Q(s, a.) is the estimated reward for taking action a from state 8, Nss) is the visit count of node s. (ss, a) is the visit count of action from and c is a constant that controls the exploration-expiootation trade-off.
2. Expansion: If the selected node is not terminal and has unvisited child nodes, the algorithm expands the tree by adding a new child node corresponding valid action from the current state.
From the newly expanded node, a simulation conducted by selecting actions-often at random or based on a heuristic policy-und until reaching terminal state. The outcome of this simulation provides reward signal, used to estimate the reward of the node.
Simulation (Rollout):
4. Backpropagation: The reward obtained from the simulation is propagated back through the visited nodes, updating the reward estimations Q(s, a) and visit counts N(s,, a) along the path from the expanded node to the root.
The output of MCTS policy that selects the action with the highest visit count from the root node.
T( (()) arg max ((so, a). aεA((00)
(10)
Direct Preference Optimization (DPO). Reinforcement Learning from Human Feedback (RLHF) (Christiano et al., 2017) is an effective strategy for aligning LLMs with human prefer- ence (Ouyang et al., 2022). It relies on the Bradley-Terry (BT) model (Bradley & Terry, 1952) to define preference probability based on some reward function. Given a prompt æ and two responses-34 Yw (preferred) and yt (dispreferred)-the the probability of preference can be expressed
as:
PD (yw > yi x) = a (r (I, (I, yw) - r" (x,y1))
(11)
where a(x) [+e is the sigmoid function and r* represents latent reward model. RLHF optimizes the policy model my with Kullback-Leebllr (KI.) constraint to limit deviation from reference model Tref:
max Egw E..-...ytrtalllll (r v)] (DDIL ()][ x)]-
(12)
Here, regulates the KL divergence to prevent reward hacking (Amodei al., 2016). While ef- fective, RLHF requires careful hyperparameter tuning and involves complex reward modeling and policy training.
To simplify this process, Direct Preference Optimization (DPO) (Rafailov et al., 2023) was intro- duced, eliminating the need for explicit reward model. Instead, DPO directly optimizes the policy
20

---

Published as a conference paper at ICLR 2026
using paired preference data. Given a prompt with responses (Y Mt), the DPO objective maxi- mizes the likelihood of the preferred response while minimizing that of the dispreferred one:
(TPo Tref) = [x Shw Me MD) [log a (fo Uw) - 7o(2,81))
aT ( x)
fz y) = 3lg
(13)
(y x)
This formulation treats (2, y) as an "implicit reward" (Rafailov al., 2023), allowing for di- rect alignment with human preference while bypassing the need for complex reward modeling and simplifying the overall training process.
C AST SIMILARITY
Node-level Similarity (simnode)) arately:
The node-level similarity considers different types of nodes sep-
simpante 1
Σ BE (E(0,,0)
(ATT,
(14)
where wy are weights for each node type with Ee we = and E fc, v) represents clause nodes, operator nodes, and operand nodes, respectively.
For each node type:
sim, (AT (ULATT))NG(AA) (UN((AT))))))
(15)
where (i(T)) is the set of nodes of type & in AST AT.
Structural Similarity (simarmet) Decomposition Synthesis Procedure define structural similarity using the Tree Edit Distance (TED):
TED(AT1, AT2) simatrue (AT AT2) mnax(IA77]] (AT
(16)
where (AD0(AT,.ATT) is the minimum number of node operations (insertion, deletion, modifica- tion) required to transform AT, into 2T and [AT, is the number of nodes AST AT;
D DATASET STATISTICS
The BIRD and Spider datasets are introduced as follows.
BIRD: BIRD (Li al., 2023b) (Big Bench for Large-scale Database Grounded Text-to-SQL Eval- uation) is pioneering cross-domain dataset designed assess the impact of large-scale database contents on text-to-SQL parsing. It comprises over 12,751 unique question-SQU pairs and 95 large databases with total size of 33.4 GB, covering more than 37 professional domains, includ- ing blockchain, hockey, healthcare, and education.
Spider: Spider (Yu et al., 2018) is large-scale, cross-domain dataset for complex semantic pars- ing and text-to-SQL. tasks, annotated by 11 Yale students. The Spider challenge aims to develop natural language interfaces for querying cross-domain databases. The dataset includes 10,181 questions paired with 5,693 unique complex SQL. queries across 200 databases, spanning 138 diverse domains.
The statistics of BIRD-train, BIRD-dev, and Spider-dev used in this study are shown in Table. 7. Notably, BIRD-train does not categorize queries based difficulty levels. Additionally, although
21

---

Published as a conference paper at ICLR 2026
BIRD-train provides 9,428 data samples, the gold SQL statements for 425 of them cannot be cuted by the SQL exccutor. Therefore, we filter out these samples considering BIRD-train to contain only 9,003 data samples in our subsequent analysis.
Table 7: Statistics for N1.2SQI. benchmarks.
Benchmarks
# #Queries
BIRD-train
9,428 9,003
Simple 925
Moderate 465
Challenging 144
Total 1,534
BIRD-dev
Easy 248
Medium 446
Hard 174
Extra Hard 166
Total 1,034
Spider-dev
E BASELINE SOLUTIONS
We briefly describe these competitive literature used in this manuscript as follows.
System-level solutions. We compare LearNAT with system-level methods:
C3-SQL (Dong et al., 2023) introduces a ChatGPT-based zero-shot Text-to-SQL. framework that enhances model input, mitigates model bias, and ensures output consistency through Clear Prompting, Calibration with Hints, and Consistent Output, respectively.
DIN-SQL (Pourreza & Rafiei, 2023) introduces task decomposition approach that improves LLMs' text-to-SQL performance by breaking query generation into sub-problems and iteratively incorporating their solutions.
MetaSQL (Fan et al., 2024b) introduces a unified generate-then-rrak framework for NLIDBs that incorporates query metadata to guide SQL generation and uses learning-to-rank algorithms to select the most accurate SQL query, improving translation accuracy across multiple benchmarks.
MAG-SQL (Xie et al., 2024a) introduces multi-agent generative approach with soft schema linking and iterative Sub-SQL refinement, incorporating external oversight at each generation step.
MAC-SQL (Wang et al., 2025) introduces multi aggnt collaborative framework that combines core decomposer agent with auxiliary agents utilizing external tools for sub-database acquisition and SQL refinement.
SuperSQL (Li et al., 2024a) combines schema linking from RESDSQL (Li al., 2023a), few- shot prompting and self-consistency post-processing from DAIL-SQL (Gao et al., 2024), greedy- decoding strategy from OpenAl SQL generation, with GPT-4 as the backbone model en- hanced performance.
SynCoT (Liu et al., 2025) is novel framework that enhances DPO for NL2SQL by automatically generating synthetic CoT reasoning traces to bridge the gap between preference-batt learning and structured query generation, thereby unlocking DPO's full potential in this domain.
OmniSQL (Li et al., 2025b) is trained SynSQL-2.5M, novel million-scale synthetic dataset featuring diverse database schemas, natural language questions, SQL queries, and chain-of- thought annotations, and it achieves state-of-the-art performance across multiple benchmarks.
Model-level solutions. We compare LearNAT with model-level methods:
ACT-SQL. (Zhang et al., 2023a) proposes an automatic chain-of-thought prompting method that enhances LLMs' reasoning ability in text-to-SQL tasks by leveraging Mieema-linking-ime exemplars without requiring manual labeling.
DAIL-SQL (Gao al., 2024) proposes integrated solution that optimizes prompt engineering methods and enhances open-source LLMs with supervised fine-tuning.
CatSQL (Fu al., 2023) integrates a template-based sketch with deep learning model to improve both accuracy and runtime for NL2SQL tasks, while also proposing a Semantics Correction tech- nique that leverages database domain knowledge to enhance the accuracy of generated queries.
22

---

Published as a conference paper at ICLR 2026
SENSE (Yang al., 2024b) introduces synthetic data approach that combines strong and weak model outputs for instruction tuning on open-source LLMs.
CodeS (Li et al., 2024b) introduces series of open-source pre-trained models, ranging from 1B to 15B parameters, specifically optimized for text-to-SQL tasks through incremental pre- treiniiin strategic prompt construction, and bi-directional data augmentation.
SQL-o1 (Lyu et al., 2025) is seff-reward-drivent agent-based heuristic search framework for NL2SQL that employs MCTS with dynamic pruning to enable structured multi-step reasoning. significantly improving execution accuracy.
Alpha-SQL (Li al., 2025a) is a NL2SQL framework that leverages MCTS with an LLM-as- Action-Model to iteratively generate and refine SQL construction actions based on partial reason- ing states, guided by a supe-suue reward function.
MCTS-based Evaluation Protocol Explanation. Here, we provide detailed description of the MCTS-based evaluation protocols used in our comparative experiments.
Evaluation protocols of SQL-o1: SQL-ol employs MCTS during inference. Specifically, at each node of the MCTS tree, SQL-ol generates a subtask along with its corresponding SQL statement, a mechanism closely resembling that of LearNAT. The complete task chain relevant to the user query is defined by the trajectory from the root node to leaf node, based on which the final SQL query is constructed. Furthermore, SQL-ol defines a reward for each node by evaluating the model's confidence-i.e. the probability assigned by the L.LM to the output at that node-and selects the node with the highest confidence. Nodes whose confidence falls below a predefined threshold are pruned and not further expanded.
Evaluation protocols of Alpha-SQL: Alpha-SQL also integrates MCTS during inference. How- ever, unlike SQL-ol, Alpha-SQUI does not decompose the problem into explicit subtasks; instead, each node directly corresponds to the query and an associated SQL statement. Consequently, while SQL-ol defines its action space as the generation of the next planning step and its corre- sponding SQL, Alpha-SQL adopts richer set of atomic actions: Rephrase Question, Schema Selection, Column Value Identification, Column Function Identification, SQL Generation, SQL Revision, and Termination. Through sequential selection of these actions, Alpha-SQL iteratively refines both the natural language query representation and the corresponding SQL.Alpha-SQU also defines node rewards based on the consistency frequency of paths obtained via high-temperature sampling over action sequences. Upon completion of the MCTS search, Alpha-SQL. aggregates all SQL. queries generated across trajectories and selects the final output based on coff-consit,ncy, i.c., agreement among execution results of candidate SQL queries.
F ADDITIONAL EXPERIMENTS
F.1 IMPLEMENTATION DETAILS.
We employ GLM-4-Plus as the primary model for synthesizing decomposition data and fine-tune the model on Qwen2.5-Coder (Yang al., 2024a), including its 7B, 14B, and 32B versions. We used the PyTorch library to implement all the algorithms based on the open-source HuggingFace transformers (Wolf et al., 2019) and ILLMA--Facton conducted on 8x A 110 GPUs During the SET stage, we utilize the AdamW optimizer with a learn- ing rate of 2e-5 and cosine warmup scheduler over three epochs. For DPO training, the Adam optimizer is used with a learning rate of 2e-6, and the /3 parameter is set to 0.2, in accordance with the original DPO configuration. In Eq. 14, we assign equal weights to all three nodes, i.c., We Wo = we = 0.33. Based on our experimental observations F.12, we set a = 0.75 in Eq. 5. During inference, we strictly follow the evaluation protocol provided by DAIL-SQL. (Gao et al., 2024) (the Without Voting setting). The protocol provides complete set of prompts to better struc- ture the instructions, user queries, and database schema information, enabling the LLM to generate single response from which the SQL statement is extracted as the final answer.
(Zheng et al., 2024). The experiments
We adopt the following strategy to adapt Lea LearNAT NAT to MCTS- evaluation protocols.
'https://ee gmodel .tt////ccc/cc/////////////// /nerma -mode1 /g1mm//
23

---

Published as a conference paper at ICLR 2026
Adapt LearNAT to SQL-o1: When adapting LearNAT to the SQL-ol framework, leverage LearNAT to generate both subtasks and subSQLs at each MCTS node. The tree traversal and pruning decisions are guided by the same reward mechanism used in SQL-o1, and the path with the highest cumulative confidence is ultimately selected as the final SQL. query.
Adapt LearNAT to Alpha-SQL: In migrating LearNAT the Alpha-SQL setting, we adopt straightforward strategy: every LLM invocation within Alpha-SQL is replaced with LearNAT's model parameters. Notably, for the *SQL Generation* * action, we retain LearNAT's original prompting scheme to ensure that SQL is still produced in subtask-b--subtass manner. For all other actions, we follow Alpha-SQL's original prompting design.
F.2 ERROR CASE ANALYSIS
To further investigate the reasons for the failure of the Decomposition Synthesis Procedure in certain cases, we randomly selected 50 unsuccessful cases for error analysis. The error distribution is shown in Fig. 3. The results indicate that the decomposition failures can be attributed to four distinct types of errors, including schema linking, float computation, unknown rules, and error answer.
We analyze these errors by one by presenting typical cases for each of the four enror attributions.
Case for Schema Linking.
[#Question:] What is the user avatar url for user 41579158? What is the latest movie rated by him / her?
[#Evidence:] user avatar url refers user.avatar. latest movie rated refers to latest rat rating.date;
[#Gold SQL]
SELECT T3.
image url, 13.rating date utc
FROM movies AS Tl
INNER JOIN ratings AS T2 ON TI. movie_id = T2. movie INNER JOIN ratings-users AS T3 ON T3. user-id user.id
WHERE T3. user_id 41579158
ORDER BY T3. ratiing--atteeu DESC
LIMIT
[#Predict SQL]
SELECT user avatar image url mevie id FROM (
SELECT T3. user-avatar_image.uu
T3. rating-date -ate--aae _ute FROM SELECT T2. user-id. T2. movieiii FROM ratings T2
WHERE T2. user_id = 41579158 AS Subl
INNER JOIN ratings users AS T3 ON Subl. user_id T3. user_id
WHERE T3. user_id = 41579158 AS Sub2
ORDER BY rating date_ute ute DESC LIMIT 1;
In this case, the LLM misidentified the column, mapping "the latest movie rated by him/her" the movie.is id column instead of the rating www..uteeccc.omc.c column. However, the evidence provided relevant information (although did not explicitly specify the corresponding column).
Case for Float Computation.
[#Question:] What the percentage of the ratings were rated by user who was subcriber?
[#Evidence:] user is a subscriber refers to user.subscriber 1: percentage of ratingg DIVIDE (SUM (user.subscriil subscriber 1), SUM SUM (raaiing..sco ) as percent;
[#Gold SQL.
SELECT (SUS
CASE WHEN subseriber
THEN
ELSE END
24

---

Published as a conference paper at ICLR 2026
AS REAL) 100 / COUNT (+)
FROM ratings
[#Predict SQL]
SELECT (CAST(SUM(
CASE WHEN user-subseriber THEN ELSE END ) AS REAL) (+) 100
FROM ratings
In this case, the LLM did strictly follow the Gold SQL in executing multiplication before divi- sion but instead generated SQL that performed the operations in the reverse order. Although mathe- matically equivalent, floating- point arithmetic in SQL can introduce numerical precision variations. Since our evaluation metric is Execution Accuracy, this discrepancy led to an inconsistency in the results. Specifically, the Gold SQL produced an execution result of 1.644420733814255, whereas the Predicted SQL yielded 21. 0.644447738442255
Case for Unknown Rules.
[#Question:] List all movies with the best rating score. State the movie title and number of Mubi user who loves the movie.
[#Evidence:] best rating score refers to rating score = 5; number of Mubi user who loves the movie refers to movie.populart
[#Gold SQL]
SELECT DISTINCT T2. movic T2. movic movie-popplaritg
FROM ratings AS TI INNER JOIN movies AS T2 ON TI. movie_id T2. movie_id WHERE TI. rating- 5
[#Predict SQL.]
SELECT T2. movic _tille T2. movic. FROM ratings AS TI INNER JOIN movies AS T2 ON T1. movie id T2. movie id WHERE TI. rat.in--scoos
5
In this case, the Gold SQL performed an additional deduplication step (DISTINCT) on the query results, whereas the Predicted SQL did not. This deduplication is default user-friendly operation, but it was not explicitly stated in the query. As result, the execution results of the Predicted SQL and Gold SQL differed.
Case for Error Answer.
[#Question:] What the name of the longest movie title? When was it released?
[#Evidence:] longest movie title refers to MAX (LENGTH (movie.title) ); when it was released refers to wovie.releeee year
[#Gold SQL.
SELECT movie_title _tilee movie.release_.ee. FROM movies
ORDER LANGTH (movie popularity) DSSC
LIMIT
[#Predict SQL]
SELECT movic -itlee
FROM movies
WHERE LENGTH (movie.title) =
SELECT MAX (LENGTH (movie.title) FROM movies
Some cases in BIRD-train contain incorrect Gold SQL. For example, in this case, the query requires computing the longest movie, and the evidence explicitly states that the correct computation should
25

---

Published as a conference paper at ICLR 2026
be MAX (LENGTH (movie.title) However, the Gold SQL incorreetly calculates this by using LENGTH mmovi--popularity.. which clearly incorrect. In contrast, the Predicted SQL cor- rectly implements the intended computation. Therefore, the decomposition failure in this case is false negative, caused by an error in the Gold SQL..
F.3 ABLATION STUDIES
Effectiveness of LearNAT. First, we present the most naive baseline (w/o LearNAT), which repre- sents the basic performance of Owen2.5-Coder-775 This experiment demonstrates the strong perfor- mance of Lea NAT, which significantly boosts a vanilla Qwen2.5-Codert yields remarkable 9 9.4%1 on the Spider-dev set and 10.6%f on the BIRD dataset. To validate the effectiveness of task decomposition, we replace LearNAT with a naive DPO algorithm-i.c. apply- ing a simple reinforcement learning strategy without incorporating any decomposition mechanisms. Experimental results show that this baseline performs significantly worse than LearNAT, achieving only 79.0% (7.4.) accuracy on Spider-dev and 52.8% (5.3.) on BIRD-dev. This substantial per- formance gap highlights the critical role of task decomposition in solving complex NI.2SQI. tasks. In addition, we conduct simple experiment using naive Qwen2.5-Coom 5-Coodr-- with CoT-hbased de- composition, where the LLM directly decomposes the NL2SQL task and generates SQL. While this setup improves performance (e.g.. 1.8%f on BIRD-dev), is far less effective than LearNAT, high- lighting the importance of AgT-e decomposition, reinforcement learning and adaptive demon- strations.
model. For instance,
Effectiveness of Decomposition Synthesis Procedure. We remove the AST-guide, replacing with naive MCTS for decomposition and using vanilla DPO reinforcement learning. The results show improvement over w/o LearNAT (e.g., 5.6%f BIRD-dev), indicating that decomposition-basse RI. enhances LLM performance in complex NL,2QQL. tasks. However, com- pared to LearNAT, the model's performance drops significantly (e.g., 5.0% on BIRD-dev), sug- gesting that without an appropriate reward evaluation, performance improvements are limited. LearNAT tightly integrates reward modeling with AST, designing a rule-based reward model that significantly enhances LLM performance.
Effectiveness of Margin-Aware Reinforcement Learning. We remove the SFT stage, leading to performance drop (e.g., 3.6% on BIRD-dev), indicating that SFT is necessary for initializing the L.LM before applying MDPO, aligning with findings from prior work (Yang et al., 2024b). Similarly, removing MDPO results in performance decline (e.g.. 4.4%) BIRD-dev), showing that SFT alone teaches the LLM to generate correct outputs but fails to suppress incorrect ones (Liao et al., 2024), which degrades overall model performance. Replacing MDPO with naive DPO further reduces performance, as the lack of margin awareness prevents the LLM from distinguishing critical steps during preference learning, leading to coarse-grained reward estimation and thus suboptimal performance.
F.4 INFERENCE TIME COMPARISON BETWEEN LEARNAT AND SYSTEM-LEVEL METHODS
We summarize the inference time overhead of LearNAT and System- Methods in the Table, 8. The experimental results demonstrate that, while achieving comparable performance, Lear TNT achieves a substantially lower inference-time cost.
Table 8: Inference Time Comparison Between LearNA and System-Level Methods. The inference time of Lea rNAT is normalized
Methods
C3-SQL 11.8
DIN-SQL
MetaSLL 5.6
Mag-SQL. 6.3
SuperSQL 5.1
MAC-SQL
SQL-ol 5.3
Alpha-SQL 111.2
LearNAT 1.0
Inference Time
5.4
3.6
F.5 ANALYSIS OF SQL DIVERSITY
We note that, during the MCTS-based subtask search process, some potentially correct subtasks indeed generated. However, because the ASTs of these subtasks do not exist subtrees in the AST of the ground-trus truth SQL, they are mistakenly judged as incorrect trajectories. To address this, designed the following experiment: specifically,
GLM---Pllu rewrite the SQL for
26

---

Published as a conference paper at ICLR 2026
each query in the training data. The rewriting is constrained such that the AST structures of the original and rewritten SQL are different, but their execution results are identical, thereby enhancing the diversity of the synthesized data. We denote this method LearNAT*. Our experimental results, as shown Table. 9, indicate that increasing data diversity in this way can further improve the performance of Lea rNT..
Table 9: Performance comparison of LearNAT and LearNAT* with enhanced SQL diversity, Bold indicates the better result.
BIRD-dev (In-Domain)
Spider-dev (Out-of-Domenn
Methods
Simple
Moderate
Challenging
Total
Easy
Medium
Hard
Extra Hard
Total
Qween.55CCoer-77
LearNAT 65.4
48.4
42.4
58.1
95.2
92.4
76.4
67.5
86.4
LearNAT*
66.6
49.5
46.5
59.5
96.8
93.3
83.3
68.7
88.5
We think that the strict AST-based evaluation LearNAT does indeed reduce the diversity of the model's outputs. However, while enhancing the diversity of model outputs is certainly desirable goal, we believe it not the most critical one. Our primary motivation behind LearNAT to teach the model to reason correctly subtask by subtask in this work. The strict AST-based supervision guarantees that the synthesized decompositions form a valid sequence of subtasks. This guarantee of correctness is the key driver of LearNAT's performance gains.
F.6 ANALYSIS OF LEARNAT IN SEMI-SCPERVISED SETTINGS
We believe LearNAT is also suitable for semi-supervised scenarios. As a concrete example, we assume the following semi-supervised scenario: we have a labeled dataset BIRD-train-partt and an unlabeled dataset BIRID-train-part each comprising half of the full BIRD-train dataset. We perform the following semi-supervised learning procedure:
We use LearNAT to construct cesspeccomooitiinn data on BIRD-train-partl, where the correct- ness of each subtask is verified using the ground-truth AST.
Using the synthesized data from Step 1, we fine-tune the Qwen2.5-Coder-7B model (denoted as LearNAT').
We then apply the fine-tuned model from Step 2 construct task sisk-dccompssition data on BIRD- train train-part2, without verifying subtask correctness using a ground-truth AST.
We combine the synthetic data from Steps and 3, and use this merged dataset to fine-tune the original @wen2.5-Coder- model, yielding Lear LearNAT².
The performance of these models is shown in Table. 10:
Table 10: Performance of LearNAT in semi-supervised settings.
BIRD
Spider Hard
Methods
Simple
Moderate
Challenging
Total
Easy
Medium
Extra Hard
Total
Qwen2.5-Coder-7B
56.1
34.5
33.8
47.5
82.7
84.1
71.8
54.8
77.0
LearNATi
61.4
42.2
38.9
53.5
90.3
88.8
73.6
62.0
82.3
LearNAT
62.1
45.2
38.9
54.8
92.3
89.9
74.1
62.0
83.4
The above experiment demonstrates the effectiveness of LearNAT in a semi-supervised setting. LeAT can rely entirely on a small labeled dataset with ground-truth SQL to initialize the model, and then use the capabilities acquired from this small dataset to annotate the unlabeled portion, thereby reducing dependence on labeled data. However, it is important to note that LearNAr" achieves only 54.8% the BIRD dataset, whereas LearNAT trained with the fully labeled dataset reaches 58.1% Thus, although LearNAT proves its feasibility in semi- cemi-supervised scenarios, the supervised setting remains the more suitable and effective regime for Lea NAT.
27

---

Published as a conference paper at ICLR 2026
F.7 COMPARISON OF TOKEN COST
We follow SuperSQL (Li et al., 2024a) and report the Avg. Tokens (k) Query and EX / Avg. Tokens (k) metrics for LearNAT and baseline methods. The experimental results are presented in Table. 11.
Table 11: Toke Cost Comparison of Lea NNAT and baseline methods. Bold indicates the best result, while underline denotes the second-best results.
Methods
LLMs
BIRD
Spider
Total
Arg. Tokens (k) Query
EX / Arg. Tokens (k)
System-L
C3-SQL
GPT-4
50.2
82.0
63.0
21.2
3.0
DIN-SQL
GPT-4
50.7
74.2
60.2
9.7
6.2
MctaSQI
GPT-
47.6
69.6
56.5
10.1
5.6
MAG-SQL
GPT-4
57.6
85.3
68.8
11.4
6.0
SuperSQL
GPT4
58.5
87.0
70.0
9.1
7.7
MAC-SQL
GPT4
59.4
86.7
70.4
6.5
10.8
Model-1 evel
ACT-SQL DAIL-SQL
GPT-4
52.4
74.5
61.3
1.6
GPT-4
54.3
76.2
CodeS-7B
57.0
85.4
68.4
1.1
62.2
CodeS
CodeS-
58.5
84.9
69.1
1.1
62.8
Ours
@wen2.5-Coder:
58,1
86.4
69.5
1.8
38.6
LearNAT
Sonn2.--Code-111
61.2
86.9
71.6
1.7
42.1
Qwen2.5-Coder-3228
65.0
88.4
74.4
1.8
41.3
The experimental results show that, compared with system-level methods, LearNAT achieves sub- stantial advantages in terms of performance, token consumption, and performance per token. When compared with model-level methods, although LearNAT attains higher performance, it consumes more tokens. This is because LearNAT output both the intermediate subtasks and their correspond- ing SQL statements, which leads to increased token usage.
F.8 ROBUSTNESS ANALYSIS OF LEARNAT
In Table. 12, we provide the mean and standard deviation of three versions of the LearNAT model over five experimental runs, ensure the reliability and robustness of LearNAT's performance.
Table 12: Robustness analysis of LearNAT, the mean and standard deviation are reported.
deRD=dev (In-Domain)
Spider-dev (Out-of-Domuin))
LLMs
Simple
Moderate
Challenging
Total
Easy
Medium
Hard
Extra Hard
Total
wwen2.5 Codder/
65.1:112
47.9114
41.4131
$7.610.7
94.542.1
92.6099
76.61:22
66.61:10
86.210.4
Qwen2.5. C-dde-r 14B
51.410.9
44.611.0
95.8112.
91.611.2
680114
86.910.3
Qwen2. 3-Cooer-328
70.620.77
55.42100
58.3214
64.820.3
96.0:2.11
92,54110
84.6222
69.311.5
88.320.2
F.9 CASE ANALYSIS BETWEEN DPO AND MARGIN-AWARE DPO
In this subsection, we further discuss the insights behind our margin-aware DPO design and believe that clarifying the idea will strengthen the manuscript. Concretely, consider the following case:
[#Question:] Consider the average difference between K-12 enrollment and 15-17 enrollment of schools that locally funded, list the names and DOC type of schools which has difference above this average.
[#Gold SQL]
SELECT T2. School DOC
FROM frpm AS TI INNER JOIN schools AS T2 ON T1 CDSCode = CDSCode
WHERE T2. FundingType 'Locally fundedd
AND (T1. Enrollment (K-12) T1. Enrollment (Ages 5-17) (
28

---

Published as a conference paper at ICLR 2026
SELECT AVG(T3. 'Enrollment (K-12)* T3. EErollleent (Ages 5 5-17) FROM frpm T3 INNER JOIN schools AS T4 ON T3. CDSCode CDSCode WHERE T4. FundingType = "Locally_funded
In the NL2SQL task decomposition for this example, we obtain the following correct subtask and Lub-SQL (denoted Response #1):
[#Subtask:] Compute the average difference between K-12 enrollment and 15-17 enrollment for funded schools.
[#SubSQL]
SELECT AVG(TI. EErollment (K-12)* T1. EErollment (Ages 5-17) AS diff FROM frpm AS T1
INNER JOIN schools ON TI. CDSCode = T2. CDSCode
WHERE T2. FundingType = "Locally_fundedd"
We also collected two erroneous responses. The first erroneous response (Response #2) is: [#Subtask:] Compute the average difference between K-12 enrollment and 15-17 enrollment.
[#SubSQL]
SELECT AVG(TI. Enrollment (K-12)* T1. Enrollment (Ages 5-17) AS av avg.diff FROM frpm AS TI INNER JOIN schools AS T2 ON CD.CCCe T2. CDSCode;
The second erroneous response (Response #3) is:
[#Subtask:] Compute the average difference between K-12 enrollment and 15-17 enroliment for locally funded schools.
[#SubSQL]
SELECT AVG(T1. EErolllment (K-12)* T1. EErollmment (Ages 5-17) AS av wifd
FROM frpm AS T1
INNER JOIN schools AS T2 CDSCode
T1. CDSCode
WHERE T2. FundingType = 'Locally';
We observe that Response #2 is a more severe error than Response #3: Response #3 only uses an incorrect Funding'lype value string-level mistake), whereas Response #2 omits the funding filter entirely and thus computes the average across all funding types, yielding a fundamentally incorrect statistic.
However, in standard DPO optimization, Response #2 and Response #3 are treated as equivalent rejected samples, despite exhibiting clearly different degrees of error. We argue that such differences should be explicitly distinguished. Therefore, we introduce Margin-aware DPO, which incorporates an AST-based metric as an offset to their error severity.
the DPO loss differentiate rejected samples according
Under this offset mechanism, the reward margin between Response #1 and Response becomes larger than that between Response #1 and Response #3. We believe that dynamically adjusting the reward margin between the chosen sample and rejected samples of varying error levels enables model to better distinguish among incorrect responses, thereby allowing it to perform more fine- grained preference optimization.
F.10 TRAINING ANALYSIS OF MDPO
In Fig. 8, present the training loss curves of both DPO and MDPO. Based the comparison of training losses, we observe that MDPO exhibits a faster and more pronounced training loss reduc- tion compared with DPO. This observation indicates that the reward margin introduced in MDPO
29

---

Published as a conference paper at ICLR 2026
Table 13: Performance of LearNAT on various Backbone LLMs. The red font indicates the perfor- mance improvement caused by using LearNAT.
BIRD-dev (In-Domain)
Spider-dev (Out-of-Domain)
Methods
Simple
Moderate
Challenging
Total
Easy
Medium
Hard
Extra Hard
Total
Qwen2.55- 5-Coder-7B
34.5
33.8
82.7
84.1
54.8
77.0
Lea:NAT
65.4 9030
48.4 (399))
42.4 a.b
58.1 (1061)
95.2 (1,50)
92.4
0030
76.4
(.00
67.5 (1271)
86.4 (4
Qwen2.5 Conde.--ooder14BB
59.5
42.6
38.4
52.4
86.6
86.4
72.9
55.6
79.2
NNT
68.5
51.4
45.8 0.41
61.2
95.6
91.5
80..
68.7
86.9
Twen2.5-Coder-B33
64.8
47.8
41.4
57.4
93.5
87.7
75.9
58.4
82.4
(5.0))
(7711
(176))
65.0 (161))
(477)
m1
GLM4-9B
55,5
36.3
25.0
46.8
82.3
85,9
62.6
59.6
76.9
Lea-KAT
64.0 (650)
41.9 (561)
31.3 (6)1)
54.2 0-41)
89.1 m881)
90.1 (422))
71.8 (9.3))
65.1 (5.51)
82.8 (591)
Meto Llama 3 Instruct
56.5
37,0
25.0
47.7
83.9
85,4
64.4
56.6
76.9
LearNAT
64.9 18.473
42.6
(5,11)
40.3
(15.7)
55.8 (8.11)
90.7 (6.m
91.7
(631)
71.3 (6.9))
63.9 (7.11)
83.6
(6.71)
provides larger and more meaningful gradients for model optimization, which can be attributed to MDPO's ability to exploit the reward differences among negative samples.
0.29
DPO
Training Loss
0.26
0.23
0.20
0
20
40
60
80
100
Steps (%)
Figure 8: Comparison of the trend of training loss between DPO and MDPO.
F.11 ANALYSIS ON VARIOUS BACKBONE LLMs
Table. 13 presents the performance of LearNAT across backbone L.Mss of varying sizes. The results reveal several key observations: (1) LearNAT consistently improves performance across different model sizes. (2) As the number of parameters in the backbone LLM increases-for in- stance, from 7B 14B to 32B-the inherent NL2SQL capability of the model improves accord- ingly, and this trend is also reflected in the performance gains achieved by LearNAT. (3) Notably, LearNAT enables smaller models outperform significantly larger ones, effectively mitigating the limitations imposed by model scale. For example, after training with Lea rNAT, Qwen2.5-Codle 7B achieves 4% on Spider-dev, surpassing the naive Siren2.5-Coder-33 which achieves only 82.4% (4.0% 1). A similar trend is observed on the BIRD-dev dataset.
To further demonstrate the generality and robustness of LearNAT, we incorporate LLMs with dif- ferent architectures, such GLM4-9B and show that LearNAT consistently yields substantial gains across architectures for instance, im- proving GLM4-9B by 7.4%t and Meta- -lamm----m--BB-.- ----trutt by 8.1%f on BIRD-dev. These results confirm that LearNAT is both architecture auchtecture-agnostic and highly effective across a wide range of I.LM configurations.
backbones. The results
30

---

Published as a conference paper at ICLR 2026
F.12 ANALYSIS OF AST SIMILARITY
We evaluate the importance of node similarity and structural similarity in LearNAT by adjusting the weight parameter Eq. 5. Specifically, vary a between O, 0.25, 0.5, 0.75.
Experimental results (illustrated Fig. 9) show that using only node similarity or only structural similarity leads to performance degradation, indicating that both types of similarity contribute to evaluation quality. A balanced setting (a 0.5) does not achieve optimal performance. LearNAT achieves the best performance when 0.5 than structural similarity in AST-based similarity assessment. This highlights that while both node and structural similarity are necessary, node similarity plays a slightly more critical role in guiding AST-based decomposition and reward estimation.
1, suggesting that node similarity is more effective
BIRD-dev
Spider-dev
59
89
BIRD-dev
Spide-des dev
57
87
55
85
53
0.25
Figure 9: Execution accuracy on BIRD-dev and Spider-dev using various in AST similarity esti- mation.
F.13 SYSTEM LEVEL POTENTIAL OF LEARNAT
We have conducted experiments to explore the performance of LearNAT under system- level setting. The results are presented in Fig. 10. In this setup, we invoke LearNAT multiple times for the query generate set of candidate SQL, and then apply the most basic form of self-consistency to select the final SQL output. Results demonstrate that LearNAT can indeed benefit from multi-call improve performance; however, this improvement comes the cost of significantly increased token consumption.
Performance
Takerr Cost
Performance
62
Token Cost (K)
30
58
The number of candidate SQL statements
Figure 10: Performance and Token Cost of LearNAT with Qwen2..-Coodr--7 as backbone LLM using generating multiple candidate SQL and selecting SQL via self-consistency.
G RELATED WORK
G. NL2SQL PARSING BASED ON LLMS
Model-level Solution. Model-level solutions refer to approaches where single large language model, given natural language query, database schema, and optionally additional instructions, gen- erates single SQL statement in end-to-end manner. This SQL is directly used the final output.
31

---

Published as a conference paper at ICLR 2026
Model level solutions are typically based on model fine-tuning methods. Model fine-tuning (Zhang et al., 2023b) adapts pre-trained LLMs to specific tasks by adjusting model parameters through ad- ditional training. While promising for NL2SQL, this approach is limited to public models with accessible parameters. Due to the performance gap between large-scale private and small-scale pub- lic models, existing research has primarily focused on system-level solution, with relatively few studies (Yang et al., 2024b; Wu et al., 2024; Li et al., 2024b; Sun et al., 2023; Li et al., 2023a) dedicated to fine-tuning open-source models. Despite their empirical success, these studies focus solely on learning the target SQL queries while neglecting the reasoning process involved in parsing complex SQL structures. This results in mere memorization of outcomes rather than fostering a deep understanding of the underlying problems.
The works most closely related to ours are Reasoning-SOO (Pourreza et al., 2025), SynCoT (Liu et al., 2025), and Struct-LLMM (Stoisser et al., 2025). These approaches similarly incorporate reason- ing during the inference stage and employ reinforcement learning algorithms to enhance the model's reasoning capabilities. Both Reasoning- SQL (Pourreza et al., 2025) and Struct-LLM (Stoisser al., 2025) optimize LLM performance on NL2SQL by replacing naïve binary rewards with continuous reward signals. However, although they design various reward mechanisms, all of these rewards are applied only to the final generated SQL. In contrast, the rewards designed in LearNAT are primarily used evaluate intermediate subtasks. In other words, LearNAT introduces a process reward (Wang el al., 2024; Lightman et al., 2024) model that explicitly regulates the correctness of intermediate reasoning steps, whereas Reasoning-SDP and Struct-LLM focuses on outcome re- wards (Wang et al., 2024; Lightman et al., 2024).
System-level Solution. System-level methods go beyond the end-to-end generation by the LLM. These approaches typically incorporate additional components such as schema linking, candidate SQL generaatt,,,,, result selection or consistency verification, and SQL refinement, aiming to improve overall robustness and accuracy. System-level solutions are typically based on Prompt engineering. Prompt engincering (Ekin, 2023) aims to guide model outputs towards desired results through care- fully designed input prompts and can be applied to both open-source and proprietary models. In the NL2SQL domain, prompt engineering serves as a crucial technique for enhancing the performance of LLMs (Kim et al., 2020; Li et al., 2024a). Several studies (Gao et al., 2024; Mao et al., 2024; Dong et al., 2023; Lee et al., 2025; Talaei et al., 2024; Pourreza et al., 2024) have explored differ- ent prompt engineering strategies to enhance NL2SQL performance. The most relevant works are DIN-SQL (Pourreza & Rafici, 2023) and MAC-SQL (Wang et al., 2025), which employ zero-shot prompting (Let's 's think step by step) or few-shot prompting (c.g., using a small set of demonstrations) to help LLMs decompose complex NL2SQL tasks. While these methods have achieved significant success on publicly available NL2SQL benchmarks, open-source models, constrained by smaller parameter sizes and limited pretraining knowledge, exhibit substantially weaker performance in task decomposition compared to closed-source models (Shen el al., 2023).
G.2 ENHAANCING REASONING WITH RL
Cearch-Guided Reasoning in LLMs. Recent research efforts (Feng et al., 2023; Chen et al., 2024; Xie et al., 2024b) aiming at advancing the reasoning capabilities of LLMs have increasingly incor- porated Monte Carlo Tree Search to generate trajectories for model training, yielding significant improvements in reasoning performance. Despite these successes, MCTS-drive methods still face several challenges, such as the vast search space inherent to language models and the difficulty of quantifying node rewards. Existing research in the mathematical domain primarily relies on self- evaluation or training external evaluation models based on labeled data. In the NL2SQL domain, we introduce a novel approach that leverages abstract syntax trees to quantify node rewards, effectively guiding the model to prioritize the exploration of the most valuable nodes.
Direct Preference Optimization (DPO) Algorithms. Among various reinforcement learning al- gorithms, Direct Preference Optimization (DPO) (Rafailov et al., 2023) has gained popularity due to its simplicity. DPO relies on instance-level preference signals for model optimization. However, it faces challenges in handling multi-step reasoning tasks, as it struggles to rectify specific errors that arise during the reasoning process (Hwang et al., 2024; Liao et al., 2024). Additionally, relying on model-generated positive samples can reinforce misleading correlations that stem from flawed inter- mediate steps, thereby weakening generalization (Setlur et al., 2024). To address these challenges,
32

---

Published as a conference paper at ICLR 2026
recent research has introduced step-level DPO (Setlur al., 2024; Lai et al., 2024), which offers more granular error identification and thus improves reasoning accuracy. However, the naive DPO algorithm struggles to capture -ra-ggd step-level supervisory signals in multi-step preference learning. This uniform treatment of all correct and incorrect steps significantly limits the model's potential for optimization.
33


Reviews:
[{"review_id": "SLzmpRkouv", "reviewer": "Reviewer_kPT4", "summary": "This paper introduces LearNAT, a novel framework that starts from task decomposition for NL2SQL. The core innovation lies in leveraging an AST-guided Monte Carlo Tree Search (MCTS) reasoning framework for efficient reasoning and data synthesis, as well as integrating AST-based structural alignment into the optimization objective to enhance the DPO algorithm. These methods collectively boost the baseline model’s performance by more than 10%.", "questions": "1. Given the diversity of SQL queries—where different SQL skeletons result in varying AST structures—how does the AST-guided MCTS handle such cases during data synthesis? Are these instances treated as error trajectories?\n2. Can the authors provide a more detailed analysis of sample correctness to elucidate the intrinsic incentives of the improved DPO? Specifically, it would be helpful to demonstrate under what kinds of samples LearNAT’s margin-aware DPO exhibits advantages over vanilla DPO, rather than only presenting final aggregate metrics.", "limitations": "", "rating": 4, "confidence": 5, "soundness": 3, "presentation": 2, "contribution": 2, "strengths": "1. Proposes an AST-guided Chain-of-Thought (CoT) task decomposition and verification mechanism, achieving high controllability and impressive success rates in intermediate process validation.\n2. Innovatively improves the DPO algorithm by incorporating AST skeleton contrast in the optimization target, enabling fine-grained supervision of multi-step reasoning.", "weaknesses": "1. The writing lacks clarity, particularly regarding the model inference stage: implementation details, methods used, and specific parameters are not sufficiently described. It remains unclear whether Monte Carlo Tree Search (MCTS) or voting methods were employed during the inference process. Furthermore, the rationale behind the specific parameter settings is not discussed, nor is it specified whether hyperparameter analysis was conducted to optimize the inference performance.\n2. The baseline selection in this paper is notably insufficient and lacks relevance. Current comparisons fail to directly target key methods such as DPO [1] and MCTS [2,3] with similar model scales, making LearNAT's claimed advantages difficult to substantiate. Without rigorous and fair evaluations against established approaches, the performance improvements may be unconvincing. The authors must provide more targeted and transparent baseline comparisons to truly demonstrate the superiority of LearNAT.\n3. Although the abstract and introduction highlight the heavy test-time computational burden of existing methods, the paper does not explicitly quantify the inference efficiency gains brought by AST-pruned MCTS, nor provide detailed time cost statistics. Supplementary experiments in this regard are recommended.\n\n\n[1] Uncovering the Impact of Chain-of-Thought Reasoning for Direct Preference Optimization: Lessons from Text-to-SQL\n\n[2] SQL-o1: A Self-Reward Heuristic Dynamic Search Method for Text-to-SQL\n\n[3] Alpha-SQL: Zero-Shot Text-to-SQL using Monte Carlo Tree Search", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "r6zKKAW7bs", "reviewer": "Reviewer_RUNy", "summary": "The paper propose LearNAT, a framework that enhances LLMs' ability to decompose complex queries through decomposition synthesis procedure and margin-aware reinforcement learning.  Decomposition synthesis procedure uses AST-guided search and pruning to precede efficient and verifiable decomposition on the BIRD-train dataset for the margin-aware reinforcement learning. Margin-aware reinforcement learning modified DPO's loss function by a AST-based reward distinction between samples. The experiment shows that LearNAT enables 7B-parameter models to reach performance close to GPT-4.", "questions": "None.", "limitations": "", "rating": 6, "confidence": 4, "soundness": 3, "presentation": 3, "contribution": 3, "strengths": "1. The paper introduces a novel approach that leverages ASTs for task decomposition, enabling the synthesis of training data for reinforcement learning.\n2. This paper further proposes a modification to the DPO framework by incorporating an AST-distance-based reward to better estimate reward margins and enhance performance on BIRD and Spider datasets.", "weaknesses": "1. The authors acknowledge that although LearNAT does not achieve state-of-the-art performance among system-level approaches, it consumes fewer tokens during inference. However, LearNAT should also be compared against model-level approaches of similar model size, such as Reasoning-SQL and OmniSQL, which demonstrate stronger performance on the BIRD leaderboard.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "V2zuLfQeii", "reviewer": "Reviewer_HybD", "summary": "This paper presents LearNAT, a framework designed to enhance the performance of small, open large language models (LLMs) on natural language to SQL (NL2SQL) tasks. The method combines two ideas:\n\n1. An AST-guided decomposition synthesis process that uses Monte Carlo Tree Search (MCTS) guided by the SQL Abstract Syntax Tree (AST) of gold queries to generate verifiable intermediate subtasks (sub-SQLs).\n\n2. A Margin-Aware Direct Preference Optimization (MDPO) objective that introduces AST-based structural margins between positive and negative steps, providing fine-grained reward signals without a learned reward model.\n\nExperiments on BIRD and Spider benchmarks demonstrate substantial accuracy improvements for open Qwen2.5-coder models (7B/14B/32B) and notable efficiency advantages over GPT-4-based system-level pipelines. The paper provides ablations, cost analyses, and code release, emphasizing openness and reproducibility.", "questions": "### Method Clarity & Assumptions\n\n1. **Gold AST availability**  \n   You mention that the decomposition synthesis uses the gold SQL AST to guide MCTS.\n   - How does this affect scalability to datasets without gold SQLs?\n   - Can LearNAT generate training data in a semi-supervised setting, or does it strictly rely on gold supervision?\n\n2. **Verification signal granularity**  \n   You mention “verifiable intermediate subtasks.”\n   - Are these subtasks verified purely syntactically (AST match) or also semantically (execution match on DB)?\n   - How do you handle equivalent but syntactically different SQL forms?\n\n3. **MDPO stability**  \n   - Did you observe training instability compared to vanilla DPO due to margin scaling or structural rewards?\n   - Are the AST-based margins dynamically computed or fixed?", "limitations": "", "rating": 8, "confidence": 4, "soundness": 4, "presentation": 4, "contribution": 3, "strengths": "- **Motivated practical problem:** Tackles a highly relevant challenge — enabling small, public models to achieve competitive NL2SQL performance without expensive test-time pipelines.\n\n- **Strong methodological alignment:** AST-guided decomposition is both interpretable and efficient, providing verifiable supervision that directly matches SQL’s structural nature.\n\n- **Novel preference learning variant:** The margin-aware DPO objective elegantly integrates structured information into preference learning without requiring a learned reward model.\n\n- **Empirical results and cost analysis:** Large gains on BIRD and Spider, along with token-cost comparisons, demonstrate both effectiveness and efficiency.\n\n- **Reproducibility:** Clear method description, ablation studies, and commitment to open code release.", "weaknesses": "### Offline Dependence on Gold SQL ASTs\nThe synthesis process relies on gold ASTs ($AT(Y)$) for search and reward computation, limiting scalability to unlabeled settings.\n\n### Baseline Comparison Fairness\nModel-level and system-level results (e.g., GPT-4 pipelines) are mixed without clear labels or cost normalization.\n\n### Limited Reward-Learning Baselines\nMDPO is compared only to vanilla DPO.\n\n### Compute and Cost Transparency\nSynthesis and fine-tuning costs are underreported.\n\n### Robustness and Variance Reporting\nMain results appear from single runs, which limits reliability.\n\n### Scope Limitation to Canonical ASTs\nThe method depends on well-defined SQL ASTs, which may not exist in less-structured domains.\n\n### Relation to Concurrent Structured-Reasoning Work\nThe paper should cite Struct-LLM (Stoisser et al., 2025), which also explores structured reasoning over SQL and Cypher using reinforcement learning. Briefly contrast LearNAT’s offline AST-guided preference learning with Struct-LLM’s online RL-based reasoning approach.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}]

Author rebuttal:

Decision: Accept (Poster)