Feyn AI Releases SQRL, a Text-to-SQL Model Family That Inspects the Database Before Writing a Query
Feyn AI introduces SQRL, a text-to-SQL model family that prioritizes database inspection over direct translation to resolve ambiguity and ensure query correctness. The flagship SQRL-35B-A3B achieves 70.6% execution accuracy on the BIRD Dev benchmark, outperforming Claude Opus 4.6 and other leading frontier models. SQRL utilizes a dynamic inspection mechanism, allowing the model to run read-only exploratory queries via `<sql>` blocks before committing to a final answer via `<answer>` blocks. Trai
Analysis
TL;DR
- Feyn AI introduces SQRL, a text-to-SQL model family that prioritizes database inspection over direct translation to resolve ambiguity and ensure query correctness.
- The flagship SQRL-35B-A3B achieves 70.6% execution accuracy on the BIRD Dev benchmark, outperforming Claude Opus 4.6 and other leading frontier models.
- SQRL utilizes a dynamic inspection mechanism, allowing the model to run read-only exploratory queries via
<sql>blocks before committing to a final answer via<answer>blocks. - Training leverages the CISPO reinforcement learning method and a curated dataset filtered by model judges to remove erroneous reference queries, ensuring robust reward signals.
- Smaller variants (SQRL-4B and SQRL-9B) maintain high performance, with the 4B model matching Claude Opus 4.6's accuracy while being deployable on local infrastructure.
Why It Matters
This development shifts the paradigm of text-to-SQL from static schema translation to dynamic data exploration, addressing the critical failure mode where syntactically valid SQL yields semantically incorrect results. By enabling models to inspect data distributions and resolve ambiguities like inconsistent naming conventions, SQRL offers a more reliable solution for enterprise applications where data quality varies. The availability of open-source, smaller models that match frontier proprietary performance provides organizations with privacy-preserving, cost-effective alternatives for on-premise deployment.
Technical Details
- Dynamic Inspection Architecture: SQRL employs a two-action framework using
<sql>tags for read-only exploration queries and<answer>tags for final SQL generation. The model decides whether to inspect based on ambiguity, performing up to five inspection rounds, though most queries resolve in fewer steps. - Training Methodology: The teacher model (SQRL-35B-A3B) was trained using CISPO, a reinforcement learning technique that clips importance-sampling weights to preserve gradient signals from rare tokens. Training focused on the "mixed zone" of trajectories where some attempts succeeded and others failed to isolate effective decision-making patterns.
- Data Curation: The training dataset was rigorously cleaned by removing examples with unusable reference SQL and filtering out queries that did not correctly answer the prompt, as judged by three model judges. This ensures that execution-based rewards are accurate and not penalized for flawed ground truth.
- Model Specifications: Built on Qwen3.5 and Qwen3.6 families, the model family includes SQRL-4B, SQRL-9B, and SQRL-35B-A3B. The 35B model activates approximately 3B parameters per token, optimizing inference efficiency.
- Benchmark Performance: Evaluated on BIRD Dev, SQRL-35B-A3B achieved 70.60% execution accuracy, surpassing Claude Opus 4.6 (68.77%), Claude 4.5 Sonnet (67.34%), and Qwen3-Coder-480B-A35B (66.17%).
Industry Insight
- Shift from Schema-Only to Data-Aware Generation: Developers should move beyond relying solely on schema definitions for text-to-SQL tasks. Implementing agents that can perform limited, read-only data inspections can significantly reduce logical errors caused by ambiguous column names or inconsistent data formats.
- Cost-Effective Deployment of High-Accuracy Models: The performance parity between the open-source SQRL-4B and proprietary models like Claude Opus 4.6 suggests that smaller, specialized models can replace expensive API calls for many enterprise use cases, reducing latency and costs while keeping sensitive data on-premise.
- Importance of Reward Signal Integrity: The success of SQRL highlights the necessity of curating high-quality training data for reinforcement learning in code generation. Automated evaluation pipelines must account for potential errors in ground-truth SQL to avoid teaching models incorrect behaviors.
Disclaimer: The above content is generated by AI and is for reference only.