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

Summary
Problem
Method
Results
Takeaways
Abstract

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:

  1. Filter Noise: Distinguish between new information and conversational filler.
  2. Track State: Understand how the SQL structure evolves (e.g., adding a WHERE clause or changing an INTERSECT to an EXCEPT).
  3. 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.

Model Architecture 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.

Experimental Results 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:

  1. Retrieval Sparsity: Finding isomorphic trajectories for rare dialogue patterns can be difficult.
  2. 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.

Find Similar Papers

Try Our Examples

  • Search for recent studies that use perplexity-based metrics for dynamic context window selection or dependency analysis in conversational LLMs.
  • Identify the origin of "schema linking" as an intermediate representation in Text-to-SQL and how "Role-State" digitization fundamentally differs from traditional graph-based linking.
  • Explore if the "Evolutionary Trajectory Searching" and isomorphism check approach has been applied to other code generation tasks like Python script synthesis from dialogue.
Contents
Rose-SQL: Empowering Small LRMs to Surpass Fine-Tuned Experts in Multi-Turn SQL Generation
1. TL;DR
2. The Bottleneck: Why "Small" Models Fail at Conversations
3. Methodology: The "Role-State" Blueprint
3.1. 1. Unified Representation
3.2. 2. Evolutionary Trajectory Searching
3.3. 3. Hierarchical Reasoning
4. Performance: David vs. Goliath
5. Deep Insight: Why Why This Matters
6. Conclusion & Limitations