Please note: This PhD seminar will take place in DC 3301.
Xiangru Jian, PhD candidate
Daivd R. Cheriton School of Computer Science
Supervisor: Professor M. Tamer Özsu
Generating correct SQL requires recovering the logical structure of a natural-language question. Chain-of-thought supervision aims to make this reasoning explicit, but free-form explanations can be costly to generate, difficult to reproduce, and inconsistent with the target query. This talk presents RA-SQL, a framework that uses relational algebra as a structured reasoning language for text-to-SQL. By deterministically compiling existing SQL queries into canonical algebra trees, RA-SQL obtains reproducible supervision without additional reasoning annotations. A single autoregressive model learns to generate an algebraic plan followed by the final SQL query.
I will explain the design of RA-SQL and develop a theoretical account of when this intermediate representation can help. The analysis connects canonicalization to probability mass aggregation across SQL variants and derives an execution-accuracy lower bound in terms of plan accuracy, plan–SQL consistency, and execution faithfulness. These quantities also provide a diagnostic framework for understanding the system’s successes and remaining bottlenecks. Across seven benchmarks and models ranging from 0.5B to 7B parameters, RA-SQL improves execution accuracy by up to 10 percentage points over direct SQL generation. Controlled experiments on BIRD show a 6.2 percentage-point gain over LLM-generated chain-of-thought supervision. I will also examine limitations in robustness and transfer, highlighting both the promise and the boundaries of using formal database representations to supervise language-model reasoning.