EAAI Journal 2026 Journal Article
BoA-SQL: Executable Blueprint-of-Action for Text-to-SQL with reinforcement learning
- Yang Wang
- Zhilong Xie
- Lin Zhang
- Lingyun Gu
- Qing Li
Recent progress in large language models has opened new possibilities for querying databases using natural language instead of SQL. Yet existing methods, often relying on linear reasoning, struggle with complex nested logic and are susceptible to error propagation. We propose BoA-SQL, which turns reasoning into a durable, structured plan. Our contributions are threefold: (1) To resolve schema ambiguity and context overload, a lightweight, knowledge graph-driven linker grounds the query by pruning irrelevant schema before planning. (2) To overcome the structural mismatch of linear plans, a persistent, tree-structured blueprint aligns with SQL’s hierarchy, enabling localized repair of faulty segments without full re-computation. (3) To align the language model’s text-generation objective with execution correctness, a two-stage reinforcement learning policy optimizes the entire blueprint for task success. Extensive evaluations on public benchmarks Spider and a complex real-world database validate this approach. BoA-SQL achieves 85. 6% execution accuracy. This figure notably increases to 88. 2% after correcting benchmark label errors. These findings suggest that durable, structure-aware planning, combined with schema grounding and planning-aligned optimization, is a practical path to reliable Text-to-SQL.