## What Is SQRL?
Most text-to-SQL systems treat the task as a straightforward translation: take a natural-language question and directly produce a SQL query. Feyn AI, a YC-backed startup, reframes the problem around **inspection** rather than pure translation. The company has open-sourced **SQRL**, a family of models that follow a two-step approach. Given a question, schema, and optional evidence, SQRL first decides whether the information provided is sufficient. If ambiguity remains, it issues read-only “probe” queries to inspect the database, then commits to a final SQL statement only after resolving uncertainty. This design reduces errors caused by ambiguous columns, wrong joins, or unexpected value encodings—issues that produce syntactically valid but logically wrong queries.
## Performance
In evaluations on the BIRD Dev benchmark, SQRL’s flagship model **SQRL-35B-A3B achieved 70.6% execution accuracy**, outperforming Claude Opus 4.6 (68.77%) under the same conditions. SQRL ships in three sizes—4B, 9B, and 35B—all available openly on Hugging Face.
## How SQRL Works: Inspect Before You Answer
Text-to-SQL failures often happen even when the generated query is valid SQL. Common pitfalls include joining the wrong tables, misinterpreting ambiguous column names, or filtering on values stored in unexpected formats (for example, “Alameda” vs “Alameda County” vs “ALAMEDA”). Schema documentation alone cannot resolve these issues because schemas rarely capture encoding conventions or data semantics.
The BIRD benchmark exposes these failures by testing systems on real-world databases with imperfect data and nontrivial relationships. Scoring depends on executing the generated SQL and comparing the results to a reference answer. For SQRL, the key insight is that the information needed to resolve ambiguity already exists in the database; the model simply needs to be allowed to query it.
SQRL operates in two modes:
– **Direct answering** when the schema and question are unambiguous.
– **Inspection** when doubt remains, using read-only probes to confirm column values, distinct entries, or data distributions before issuing the final query.
Interaction follows a controlled pattern:
– An `
– An `
The harness executes exploration queries in read-only mode and feeds results back in `
## Interactive Example
Below is a simplified walkthrough of how SQRL handles multiple real-world queries, comparing direct responses with inspection-based reasoning. You can explore these behaviors interactively using the embedded demo.
### Use Cases
– **Counting rows** is direct because it requires no data lookup.
– **Filtering by county** may require inspection to confirm encoding.
– **Checking status flags** may reveal unexpected literal values.
– **Counting orders** can be direct when limited to a single table.
## Comparison With Frontier Models
SQRL’s inspection-first strategy shows clear advantages against leading models on BIRD Dev. The chart below compares execution accuracy, highlighting how early inspection reduces errors that commonly trip other systems.
*(Note: The benchmark figures reflect Feyn’s own measurements under the same harness, not the official BIRD leaderboard.)*
## FAQ
**What does “execution accuracy” mean in the BIRD benchmark?**
Execution accuracy measures whether the generated SQL, when run against the database, returns the same rows as the reference query. Both syntactic correctness and semantic correctness matter.
**Why can’t schemas alone prevent these errors?**
Schemas list tables, columns, and types but do not specify how values are stored (e.g., “Alameda” vs “Alameda County”), whether joins produce duplicates, or which encoding conventions are used.
**How is inspection different from general execution?**
Standard execution assumes the query is final. Inspection allows SQRL to issue read-only probes first, observe actual data, and adjust the final query accordingly—all within the same model loop.
**What is the role of the `
`
**Why does SQRL sometimes answer directly without inspection?**
When the schema and question are unambiguous—such as counting rows in a single table—SQRL can skip inspection and answer immediately, saving time and steps.
**How many inspection steps can SQRL take?**
SQRL can inspect up to five times per question, though most queries resolve in fewer steps.
## Conclusion
SQRL demonstrates that treating text-to-SQL as an **inspection problem** rather than a pure translation task leads to measurably better results. By allowing models to probe databases before finalizing queries, Feyn’s approach tackles ambiguity and encoding issues that commonly cause silent failures. With strong benchmark performance and open availability of multiple model sizes, SQRL provides both a practical tool and a conceptual shift for SQL generation research.



