Junyi Zhao
Author directory2026
SCOPE-SQL: Structured Semantic Credit for Reinforcement Learning of Interactive SQL Repair Agent
Hong Qi | Junyi Zhao | Boyan Li | Juyong Jiang | Yuyu Luo
Findings of the Association for Computational Linguistics: EMNLP 2026
Hong Qi | Junyi Zhao | Boyan Li | Juyong Jiang | Yuyu Luo
Findings of the Association for Computational Linguistics: EMNLP 2026
Text-to-SQL deployment is moving from one-shot query generation to interactive repair of executable but semantically incorrect SQL. In this setting, a model must revise an erroneous query under public tool feedback while preserving correct input structures. Existing reinforcement-learning signals are ill matched: outcome rewards reveal only whether the final SQL passes, whereas unconstrained process supervision may reward steps not grounded in SQL semantics. We propose SCOPE-SQL, a reinforcement-learning framework that treats SQL structure as an auditable credit space for interactive repair. It maps candidate queries and public feedback into F0–F6 modules—schema/runtime, table/join, projection, predicate, aggregation/grouping, order/limit, and nesting—and assigns action-level credit for repairing target modules, preserving stable modules, gathering evidence, and submitting when ready. Persistent low-credit regions then drive semantic refresh, generating validator-filtered frontier repair tasks. On BIRD-CRITIC-SQLite, SCOPE-SQL with semantic refresh reaches 48.8% success using a Qwen2.5-Coder-7B backbone, improving over current sota RL baselines by 4.4 and 4.2 points. Ablations attribute 4.4 and 1.8 points to process credit and semantic refresh. Trajectory analysis further shows better repair behavior: Repair+Preserve paths rise from 38.8% to 77.5%, while damage-and-recover paths fall from 43.8% to 1.2%. These results suggest that SQL-structured credit is an interpretable training signal for both policy learning and data expansion in interactive SQL repair.