DeepHorus is an innovative tech media and intelligence platform focused on AI, blockchain, startups, and emerging technologies.
Published on

Feyn AI Releases SQRL, a Text-to-SQL Model Family That Inspects the Database Before Writing a Query

Authors
  • avatar
    Name
    DeepHorus
    Twitter

Feyn AI, a Y Combinator-backed startup, has released SQRL, a family of text-to-SQL models that take a novel approach to generating database queries. Instead of treating the task as a straightforward translation from natural language to SQL, SQRL models inspect the database before writing a query, allowing them to resolve ambiguities and produce only queries that the data can actually support. This approach addresses a critical flaw in traditional text-to-SQL systems: a query can be syntactically valid but semantically wrong, joining incorrect tables or filtering for nonexistent values without throwing any errors. By enabling the model to examine the database first, SQRL aims to eliminate such hidden mistakes.

The BIRD benchmark, which tests SQL generation on real-world databases with imperfect data, makes these failures measurable. The Feyn team reports that their flagship model, SQRL-35B-A3B, achieves a 70.6% execution accuracy on BIRD Dev, slightly outperforming Claude Opus 4.6 at 68.77% under the same evaluation. Three open-source checkpoints are available on Hugging Face: SQRL-4B, SQRL-9B, and SQRL-35B-A3B. These models vary in size and capacity, offering flexibility for different deployment scenarios.

SQRL operates by first receiving a natural language question, its schema, and optional evidence. If the context is sufficient, it returns a query immediately. Otherwise, it runs read-only inspection queries, receiving the results within

tags, and uses that information to draft its final answer. The model can inspect up to five times, though most questions are resolved in fewer steps. This dynamic behavior allows SQRL to handle both trivial and complex questions efficiently.

Historically, text-to-SQL systems have followed two strategies: single-shot models that generate a query in one turn (inexpensive but prone to logical errors), and multi-step pipelines that retrieve context, generate candidates, and critique them (accurate but costly). SQRL combines both approaches in a single model, paying the cost of inspection only when necessary. This hybrid design makes it suitable for production environments where latency and cost matter.

The training process for SQRL was rigorous. Feyn cleaned the training data from BIRD and Spider by removing examples with faulty reference SQL. Three separate model judges then reviewed the remaining pairs, dropping any query that did not correctly answer its question. This ensured that the model learned from accurate ground truths, despite the challenges of execution-based training. The test split combines a held-out Spider split with BIRD dev.

Industry experts see SQRL as a significant step forward in making text-to-SQL more reliable. By allowing models to inspect the database, Feyn has addressed a fundamental limitation of schema-only approaches. The open release on Hugging Face also encourages community experimentation and integration into existing tools. As databases grow more complex and diverse, such inspection-based methods may become essential for accurate data querying. Feyn AI plans to continue refining SQRL and expanding its capabilities, potentially setting a new standard for text-to-SQL models.

Read original article →Source: marktechpost