Feyn AI Releases SQRL, a Text-to-SQL Model Family That Inspects the Database Before Writing a Query
Most text-to-SQL techniques deal with the activity as translation. Feyn AI (YC-backed startup) reframes it round inspection. The Feyn workforce has launched SQRL, a household of fashions that flip pure language questions into SQL. Instead of producing a question instantly, SQRL can examine the database first. This lets it resolve ambiguity and write solely queries the knowledge really helps.
Feyn workforce studies that the flagship SQRL-35B-A3B reaches 70.6% execution accuracy on BIRD Dev. That determine edges Claude Opus 4.6 at 68.77% underneath the similar analysis. Three checkpoints ship overtly on Hugging Face: SQRL-4B, SQRL-9B, and SQRL-35B-A3B.
A question may be legitimate SQL and nonetheless be incorrect
Text-to-SQL is commonly described as a translation drawback, however that framing misses the hardest half. A question may be completely legitimate SQL and nonetheless return the incorrect reply. It can be a part of the incorrect tables, learn an ambiguous column incorrectly, or filter for values that don’t exist. None of those errors throws an error, so none is caught by execution alone.
Schema info doesn’t stop them. A schema lists tables, columns, sorts, and generally relationships. It doesn’t reveal whether or not a county is saved as Alameda, Alameda County, or ALAMEDA. It can not inform you which be a part of produces duplicate rows.
The BIRD benchmark makes these failures measurable. Its databases span actual domains and comprise imperfect values, ambiguous columns, and nontrivial relationships. A system is scored by executing its SQL and evaluating the returned rows towards a reference end result. For question languages, syntactic correctness isn’t sufficient. Feyn’s core perception is that the lacking info already lives inside the database. The mannequin merely wants permission to ask for it.
SQRL inspects earlier than it solutions
SQRL receives a query, its schema, and elective proof about the database. If that context is sufficient, it returns a question without delay. If one thing stays ambiguous, it runs read-only queries and makes use of the returned rows to draft its remaining reply. The determination to examine is circumstantial. Counting rows in a single desk wants no lookup, so SQRL solutions immediately.
The interplay makes use of two distinct actions. An <sql> block requests an statement from the database. An <reply> block commits to the remaining question. The harness executes exploration queries in read-only mode and returns their rows inside <statement> tags. SQRL can examine as much as 5 instances, although most questions end in fewer steps.
The explainer under walks via each behaviors on actual examples, then compares the household towards frontier fashions on BIRD Dev.
One mannequin that folds in each conventional methods
Text-to-SQL has traditionally adopted two approaches, and every trades away one thing necessary.
Single-shot fashions generate the whole question in a single flip. They are cheap to serve, however they need to infer all the things from the schema, which may produce logically incorrect queries. Frontier pipelines as a substitute retrieve context, generate candidates, critique them, after which choose a solution. This can maximize accuracy, however each query requires a number of costly frontier calls and a number of database spherical journeys. That value makes such pipelines laborious to position on the sizzling path.
SQRL combines each in a single mannequin. Easy questions keep quick, whereas ambiguous questions earn an inspection. The mannequin pays the value of wanting solely when the query wants it.
Training the determination to examine
Giving a mannequin database entry doesn’t educate it when or the right way to look. That conduct must be educated, and execution-based coaching is unforgiving. If a reference question is itself incorrect, a appropriate mannequin reply receives the incorrect reward. Feyn due to this fact cleaned the coaching pool first. Starting from BIRD and Spider, it eliminated examples whose reference SQL produced no usable end result. Three mannequin judges then reviewed the remaining pairs and dropped any question that didn’t reply its query as written. The check cut up combines a held-out Spider cut up with BIRD dev, and the remainder of the knowledge went into coaching.
The 35B-A3B trainer educated immediately with CISPO, a reinforcement studying methodology from MiniMax’s M1 work. CISPO clips the importance-sampling weights somewhat than the coverage ratio, which preserves gradient sign from uncommon however decisive tokens. For every query, the mannequin produced eight full trajectories. Feyn executed each remaining question and rewarded a end result that matched the reference, a binary sign that ignores wording and checks solely the returned rows.
Group-relative coaching wants variation inside every group. Eight appropriate or eight failed makes an attempt carry no sign about which choices helped. Feyn due to this fact educated on the ‘blended zone,’ the place solely a few of the eight makes an attempt succeeded, so each group may reinforce the selections that separated a appropriate trajectory from an incorrect one. That is how the trainer realized when to examine.
To make the conduct deployable, Feyn workforce sampled full trainer trajectories and saved solely runs whose remaining SQL returned the appropriate end result. This produced about 10,200 examples, every preserving the reasoning, exploration queries, observations, and remaining reply. The 4B and 9B college students have been fine-tuned on these trajectories, then refined with the similar CISPO execution reward. SQRL builds on the Qwen3.5 and Qwen3.6 mannequin households.
Performance throughout the household
Feyn evaluated SQRL on BIRD Dev, scoring a question appropriate when it returns the similar end result as the reference. SQRL-35B-A3B scores 70.60% and prompts about 3B parameters per token. The 9B pupil holds almost all of that at 69.80%. SQRL-4B reaches 68.80%, matching Claude Opus 4.6 on this analysis in a mannequin sufficiently small to host wherever, so your schema, queries, and observations keep on infrastructure you management.
In Feyn’s reported comparability, the frontier area trails: Claude 4.5 Sonnet at 67.34%, Qwen3-Coder-480B-A35B at 66.17%, GLM-4.7 at 63.82%, DeepSeek-R1 at 61.67%, and Kimi-K2-Thinking at 60.63%.
Deployment notes
Feyn recommends SQRL-9B as the default checkpoint, with SQRL-4B for the tightest budgets and SQRL-35B-A3B for the highest accuracy. The 9B mannequin serves with vLLM:
vllm serve feyninc/sqrl-9b
--served-model-name sqrl-9b
--gpu-memory-utilization 0.90
--max-model-len 32768
The utility loop is small. Keep database execution read-only, and return every statement to the mannequin till it emits a solution. One caveat issues. Do not allow a serving-layer reasoning parser. The motion protocol seems in the content material after the closing </suppose> tag, so stripping that content material removes the mannequin’s <sql> or <reply> motion. Parse the uncooked message content material and protect all the things after the remaining suppose tag. The mannequin playing cards comprise the full system immediate and a reference harness.
Key Takeaways
- SQRL is a text-to-SQL mannequin household that runs read-only probes to examine a database earlier than committing to a remaining question.
- Feyn studies SQRL-35B-A3B at 70.6% execution accuracy on BIRD Dev, above Claude Opus 4.6 at 68.77% in the similar analysis.
- The flagship distills into 4B and 9B college students; SQRL-4B matches Opus on this check whereas staying self-hostable.
- Training cleaned BIRD and Spider, rewarded execution matches, and used CISPO plus distillation to show the mannequin when to examine.
- All three checkpoints are open on Hugging Face and serve with vLLM via a read-only harness that feeds observations again to the mannequin.
- SQRL is constructed by Feyn. You can discover the workforce on GitHub, Hugging Face, and X.
The submit Feyn AI Releases SQRL, a Text-to-SQL Model Family That Inspects the Database Before Writing a Query appeared first on MarkTechPost.
