Source-led article

Feyn AI’s SQRL Model Reframes Text-to-SQL with Database Inspection

AI Tools//3 min read
Illustration of an AI model interacting with a database schema, with SQL query lines visible
Illustration of an AI model interacting with a database schema, with SQL query lines visible
Dr Martens 'How to Wear' campaign | by University of Salford | openverse | by

Feyn AI, a Y Combinator-backed startup, has launched SQRL, a new family of text-to-SQL models designed to enhance accuracy by first inspecting databases before generating SQL queries. This innovative approach moves beyond traditional text-to-SQL systems that treat the task purely as a translation problem, instead focusing on resolving ambiguity and ensuring queries are supported by actual data.

The flagship model, SQRL-35B-A3B, has reportedly achieved 70.6% execution accuracy on the BIRD Dev benchmark, surpassing Claude Opus 4.6, which scored 68.77% in the same evaluation. This performance highlights a significant step forward in natural language to SQL conversion, especially for complex and imperfect real-world databases.

The Problem with Traditional Text-to-SQL

Current text-to-SQL models often struggle with issues that go beyond syntactic correctness. A perfectly valid SQL query can still return incorrect answers if it joins the wrong tables, misinterprets ambiguous columns, or filters for non-existent values. These errors are not caught by execution alone and schema information often provides insufficient detail to prevent them. For instance, a schema might not indicate how a county name is stored (e.g., “Alameda,” “Alameda County,” or “ALAMEDA”), leading to inaccurate results.

The BIRD benchmark, which uses databases from real domains with imperfect values and complex relationships, is designed to measure these types of failures by comparing returned rows against a reference result.

SQRL’s Innovative Inspection Approach

Feyn AI’s core insight is that the necessary missing information resides within the database itself. SQRL models are designed to ask for this information. When presented with a natural language question and a database schema, SQRL first assesses if the provided context is sufficient. If ambiguity remains, it performs read-only database inspections, using the returned data to refine and draft its final SQL query. This ‘decision to inspect’ is circumstantial; simpler queries are answered directly without inspection.

The interaction involves two distinct actions: an `` block requests an observation from the database, while an `` block commits to the final query. The system executes exploration queries in read-only mode, returning results within `` tags. SQRL can inspect up to five times, though most questions are resolved in fewer steps.

Training and Deployment

SQRL combines the benefits of both single-shot and frontier pipeline approaches. Easy questions are answered quickly, while ambiguous ones trigger an inspection, balancing cost and accuracy. The models were trained using a cleaned dataset from BIRD and Spider benchmarks, removing examples with problematic reference SQL. This rigorous data curation ensures that the models learn from accurate examples.

The 35B-A3B teacher model was trained directly with CISPO (Clipped Importance Sampling Policy Optimization), a reinforcement learning method that preserves gradient signals from rare but decisive tokens. This allowed the model to learn when and how to inspect the database effectively. Smaller, self-hostable versions, SQRL-4B and SQRL-9B, were fine-tuned on trajectories from the teacher model, preserving its reasoning and exploration capabilities.

Datos clave

Metric SQRL-35B-A3B Claude Opus 4.6 SQRL-9B SQRL-4B
BIRD Dev Accuracy 60% 77% 80% 80%
Parameters 35B (3B active) N/A 9B 4B

Deployment options include SQRL-9B as the recommended default, SQRL-4B for resource-constrained environments, and SQRL-35B-A3B for maximum accuracy. Feyn AI emphasizes keeping database execution read-only during inspection and parsing raw message content to preserve the model’s actions.

For Indian businesses and developers working with large datasets, SQRL presents a compelling solution for more accurate and reliable data querying through natural language. Its ability to inspect databases locally ensures that sensitive schema, queries, and observations remain within controlled infrastructure, addressing privacy and security concerns.

Source: MarkTechPost, https://www.marktechpost.com/2026/07/19/feyn-ai-releases-sqrl-a-text-to-sql-model-family-that-inspects-the-database-before-writing-a-query/