Rose-SQL: Empowering Small LRMs to Surpass Fine-Tuned Experts in Multi-Turn SQL Generation
Rose-SQL: Role-State Evolution Guided Structured Reasoning for Multi-Turn Text-to-SQL
Rose-SQL is a training-free framework for multi-turn Text-to-SQL tasks that leverages small-scale Large Reasoning Models (LRMs) like Qwen3. It introduces "Role-State," a structural blueprint that maps natural language entities to functional SQL roles, achieving SOTA performance on SParC and CoSQL benchmarks without task-specific fine-tuning.
TL;DR
Rose-SQL is a plug-and-play, training-free framework that transforms small-scale Large Reasoning Models (LRMs) like Qwen3-8B into multi-turn Text-to-SQL powerhouses. By introducing a novel Role-State representation and an evolutionary guidance mechanism, it bridges the gap between conversational intent and structured query syntax, outperforming even the best fine-tuned models on benchmarks like SParC and CoSQL.
The Bottleneck: Why "Small" Models Fail at Conversations
While models like GPT-4 excel at Text-to-SQL via In-Context Learning (ICL), small open-source models (4B-14B) usually fall short. The authors identify that the issue isn't raw intelligence but structural misalignment. In a multi-turn dialogue, the model must:
- Filter Noise: Distinguish between new information and conversational filler.
- Track State: Understand how the SQL structure evolves (e.g., adding a
WHEREclause or changing anINTERSECTto anEXCEPT). - Map Roles: Correctly identify whether a table column should be "selected," "joined," or "grouped."
Without task-specific fine-tuning, small models lose the "thread" of the conversation, leading to hallucinated columns or broken logic.
Methodology: The "Role-State" Blueprint
The core innovation of Rose-SQL is the Role-State. Instead of asking the model to jump directly from text to SQL, Rose-SQL introduces an intermediate structural blueprint.
1. Unified Representation
Role-State assigns functional roles (e.g., selected, join, condition, group) to schema elements. This is digitized into a ten-dimensional indicator vector. This vector acts as a "DNA" for the SQL query, allowing for mathematical comparison across turns.
Figure 1: The Rose-SQL pipeline showing Gain Dependency Analysis and Isomorphism-guided search.
2. Evolutionary Trajectory Searching
To handle the "evolution" of a dialogue, Rose-SQL doesn't just look at history; it searches for structural isomorphism. It calculates a "Gain Dependency Score" (using perplexity reduction) to find which previous turns actually matter. It then verifies if the current dialogue's evolution matches a historical pattern from the training set by checking if their vectorized Role-State transitions are isomorphic.
3. Hierarchical Reasoning
Finally, the model follows a sequential "thought chain":
- Contextual Anchor: Focus on the most relevant history.
- Structural Plan: Predict the Role-State first.
- Syntactic Execution: Generate the final SQL code.
Performance: David vs. Goliath
The results are striking. A Qwen3-4B model equipped with Rose-SQL performs at the level of an 8B baseline. More importantly, the 8B and 14B versions significantly outperform Track-SQL, a state-of-the-art model that requires extensive supervised fine-tuning.
Table 1: Competitive analysis across SParC and CoSQL benchmarks.
Key highlights from the experiments:
- Interaction Match (IM-EX): Rose-SQL increased Qwen3-8B's multi-turn performance by 20.6% on SParC.
- Robustness: The framework provided consistent gains across different backbones, including DeepSeek-R1-Distill-Llama and GPT-OSS.
- Complexity Handling: Ablation studies show the biggest gains in "Extra Hard" queries, where structural logic usually breaks down.
Deep Insight: Why Why This Matters
For years, the industry thought that "small" models needed task-specific fine-tuning (SFT) to handle complex domain logic like SQL. Rose-SQL challenges this "SFT-Dependency." It proves that if we provide the right structural inductive bias through sophisticated prompting and intermediate representations, small models can exhibit "emergent" domain expertise that rivals or exceeds fine-tuned experts.
Conclusion & Limitations
Rose-SQL offers a blueprint for "Training-Free Domain Adaptation." However, the authors note some current limitations:
- Retrieval Sparsity: Finding isomorphic trajectories for rare dialogue patterns can be difficult.
- Overhead: The detailed prompts increase token usage and latency.
Despite this, Rose-SQL marks a significant step toward more efficient, context-aware semantic parsing using the next generation of reasoning-heavy small models.
Senior Editor's Take: This paper is a masterclass in "Structural Prompt Engineering." By turning abstract SQL logic into a computable vector space (Role-State), the authors essentially gave the LLM a compass to navigate the fog of multi-turn interactions.
