NeurIPS 2026QuestionsPapersAreasAboutMarkdown

CAPER: Clause-Aligned Process Supervision for Text-to-SQL

Lujie Ban, Jiasheng Shi, Jinyang Li, Xiaolin Han, Tsz Nam Chan, Chenhao Ma

NeurIPS page · OpenReview · alphaXiv · Open on the map

Category: LLM Post-Training: RL & Distillation › Reward-Driven Agentic RL with LLMs · Type: new method · Keywords: clause-aligned supervision, text-to-SQL, error localization, abstract syntax tree, counterfactual intervention, reward modeling

Summary

CAPER introduces clause-aligned process supervision for Text-to-SQL, automatically deriving clause-level feedback via counterfactual interventions on the SQL abstract syntax tree to improve execution accuracy and error localization.

Explained to a 5-year-old

A computer program tries to turn words into SQL commands. It usually only knows if the final command works, not why it failed. The new idea makes a picture of the SQL steps and changes them one by one to see which step caused the problem. This helps the program learn better and fix mistakes.

Explained to a 5-year-old, longer

Imagine you have a robot that reads sentences and writes instructions for a database. You want the robot to understand why its instructions are wrong. The researchers gave the robot a special tool that looks at the steps of the instructions like a puzzle. They change each step in a safe way to see what happens. This creates a lot of helpful examples that tell the robot which part of the instruction is wrong. Using these examples, the robot can learn to fix its mistakes and become more accurate. The researchers tested this robot on two big collections of database questions and found it works much better than before, both in getting the right answers and in spotting its own errors.

For a technical reader

The system generates fine-grained supervision by perturbing the SQL abstract syntax tree, creating clause-level feedback signals. This data is used to train a lightweight reward model that guides policy optimization and validates candidate queries. Experiments on BIRD and Spider show significant gains in execution accuracy and error localization compared to a strong baseline.

Problem

Models that translate natural language to SQL are usually judged only by whether the final query executes correctly, offering little insight into which intermediate SQL decisions caused errors. Additionally, token-level supervision does not align well with semantic decisions and can penalize execution-equivalent queries.

Method

The approach derives clause-level supervision through counterfactual interventions on the SQL abstract syntax tree, enabling root-cause error localization for reward modeling. The resulting data is used to train a lightweight clause-based reward model that provides clause-boundary feedback for policy optimization and candidate verification.

Results

The approach improves execution accuracy by up to 15.3% relative to GPT-5.4 and achieves 84.53% accuracy and 90.60% MRR for failure localization on held-out failures.

Contributions

The paper introduces a way to automatically generate clause-level supervision through counterfactual interventions on the SQL abstract syntax tree, providing fine-grained error localization for language-to-SQL models, and demonstrates strong performance gains on two benchmark datasets.

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction