trl-lab/qwen3.5-2b-grpo-sqale
trl-lab/qwen3.5-2b-grpo-sqale is a 2.3 billion parameter text-to-SQL agent model, based on Qwen3.5-2B, developed by TRL-Lab. It is uniquely trained with Reinforcement Learning (GRPO) directly on the SQaLe dataset, which features large, real-world database schemas. This model excels at navigating complex database structures and performing agentic tool-use to generate accurate SQL queries without direct schema prompting, making it highly effective for natural language to SQL conversion in large-schema environments.
Loading preview...
MSQaLe: A Specialized Text-to-SQL Agent
MSQaLe is a 2.3 billion parameter text-to-SQL agent model, built upon the Qwen3.5-2B architecture and developed by TRL-Lab. It is distinctively trained using Reinforcement Learning (GRPO) on the SQaLe dataset, which comprises over 1.4 million questions and 176,000 SQL queries across 9,259 real-world schemas. A key differentiator is its ability to operate as an agent, exploring databases via tools and looking up values, rather than relying on the schema being present in the prompt. This approach enables it to handle large schemas effectively, with a median of 113 tables and 538 columns.
Key Capabilities
- Agentic Text-to-SQL Conversion: Operates as an agent, using tools to explore databases and construct SQL queries without direct schema prompting.
- Strong Performance for its Size: Achieves significant improvements over the untrained base model, with +33.0 points on BIRD dev and +27.6 points on the SQaLe test set. It outperforms many general-purpose models in the 9-12B parameter range.
- Handles Large Schemas: Demonstrates strong ability to identify relevant tables in large schemas, opening every gold table in 89.7% of episodes on full-size SQaLe test schemas.
- Value Grounding: Effectively looks up string literals from data, grounding 88% of necessary literals before submission, compared to 35% for the untrained base model.
- Reinforcement Learning Only: Trained exclusively with reinforcement learning (GRPO), without supervised warm-starts or distilled reasoning traces.
Good For
- Natural Language to SQL in Complex Databases: Ideal for applications requiring conversion of natural language questions into SQL queries against databases with many tables and columns.
- Agentic Database Interaction: Suitable for scenarios where the model needs to dynamically explore database structures and retrieve information through tool use.
- Research in Text-to-SQL Agents: A valuable resource for researchers studying small, specialized text-to-SQL models and agentic learning in database contexts.