AIArtificial IntelligenceTrends

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

Views: 5
0 0
Read Time:6 Minute, 25 Second

  

Most text-to-SQL systems treat the task as translation. Feyn AI (YC-backed startup) reframes it around inspection. The Feyn team has released SQRL, a family of models that turn natural language questions into SQL. Instead of generating a query immediately, SQRL can inspect the database first. This lets it resolve ambiguity and write only queries the data actually supports.

Feyn team reports that the flagship SQRL-35B-A3B reaches 70.6% execution accuracy on BIRD Dev. That figure edges Claude Opus 4.6 at 68.77% under the same evaluation. Three checkpoints ship openly on Hugging Face: SQRL-4B, SQRL-9B, and SQRL-35B-A3B.

A query can be valid SQL and still be wrong

Text-to-SQL is often described as a translation problem, but that framing misses the hardest part. A query can be perfectly valid SQL and still return the wrong answer. It can join the wrong tables, read an ambiguous column incorrectly, or filter for values that do not exist. None of these mistakes throws an error, so none is caught by execution alone.

Schema information does not prevent them. A schema lists tables, columns, types, and sometimes relationships. It does not reveal whether a county is stored as Alameda, Alameda County, or ALAMEDA. It cannot tell you which join produces duplicate rows.

The BIRD benchmark makes these failures measurable. Its databases span real domains and contain imperfect values, ambiguous columns, and nontrivial relationships. A system is scored by executing its SQL and comparing the returned rows against a reference result. For query languages, syntactic correctness is not enough. Feyn’s core insight is that the missing information already lives inside the database. The model simply needs permission to ask for it.

SQRL inspects before it answers

SQRL receives a question, its schema, and optional evidence about the database. If that context is enough, it returns a query at once. If something remains ambiguous, it runs read-only queries and uses the returned rows to draft its final answer. The decision to inspect is circumstantial. Counting rows in a single table needs no lookup, so SQRL answers directly.

The interaction uses two distinct actions. An <sql> block requests an observation from the database. An <answer> block commits to the final query. The harness executes exploration queries in read-only mode and returns their rows inside <observation> tags. SQRL can inspect up to five times, though most questions finish in fewer steps.

The explainer below walks through both behaviors on real examples, then compares the family against frontier models on BIRD Dev.

One model that folds in both traditional strategies

Text-to-SQL has historically followed two approaches, and each trades away something important.

Single-shot models generate the entire query in one turn. They are inexpensive to serve, but they must infer everything from the schema, which can produce logically incorrect queries. Frontier pipelines instead retrieve context, generate candidates, critique them, and then select an answer. This can maximize accuracy, but every question requires several expensive frontier calls and multiple database round trips. That cost makes such pipelines hard to place on the hot path.

SQRL combines both in a single model. Easy questions stay short, while ambiguous questions earn an inspection. The model pays the cost of looking only when the question needs it.

Training the decision to inspect

Giving a model database access does not teach it when or how to look. That behavior has to be trained, and execution-based training is unforgiving. If a reference query is itself wrong, a correct model answer receives the wrong reward. Feyn therefore cleaned the training pool first. Starting from BIRD and Spider, it removed examples whose reference SQL produced no usable result. Three model judges then reviewed the remaining pairs and dropped any query that did not answer its question as written. The test split combines a held-out Spider split with BIRD dev, and the rest of the data went into training.

The 35B-A3B teacher trained directly with CISPO, a reinforcement learning method from MiniMax’s M1 work. CISPO clips the importance-sampling weights rather than the policy ratio, which preserves gradient signal from rare but decisive tokens. For each question, the model produced eight complete trajectories. Feyn executed every final query and rewarded a result that matched the reference, a binary signal that ignores wording and checks only the returned rows.

Group-relative training needs variation inside each group. Eight correct or eight failed attempts carry no signal about which decisions helped. Feyn therefore trained on the ‘mixed zone,’ where only some of the eight attempts succeeded, so every group could reinforce the choices that separated a correct trajectory from an incorrect one. That is how the teacher learned when to inspect.

To make the behavior deployable, Feyn team sampled complete teacher trajectories and kept only runs whose final SQL returned the correct result. This produced about 10,200 examples, each preserving the reasoning, exploration queries, observations, and final answer. The 4B and 9B students were fine-tuned on these trajectories, then refined with the same CISPO execution reward. SQRL builds on the Qwen3.5 and Qwen3.6 model families.

Performance across the family

Feyn evaluated SQRL on BIRD Dev, scoring a query correct when it returns the same result as the reference. SQRL-35B-A3B scores 70.60% and activates about 3B parameters per token. The 9B student holds nearly all of that at 69.80%. SQRL-4B reaches 68.80%, matching Claude Opus 4.6 on this evaluation in a model small enough to host anywhere, so your schema, queries, and observations stay on infrastructure you control.

In Feyn’s reported comparison, the frontier field 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 model serves with vLLM:

vllm serve feyninc/sqrl-9b 
  --served-model-name sqrl-9b 
  --gpu-memory-utilization 0.90 
  --max-model-len 32768

The application loop is small. Keep database execution read-only, and return each observation to the model until it emits an answer. One caveat matters. Do not enable a serving-layer reasoning parser. The action protocol appears in the content after the closing </think> tag, so stripping that content removes the model’s <sql> or <answer> action. Parse the raw message content and preserve everything after the final think tag. The model cards contain the complete system prompt and a reference harness.

Key Takeaways

  • SQRL is a text-to-SQL model family that runs read-only probes to inspect a database before committing to a final query.
  • Feyn reports SQRL-35B-A3B at 70.6% execution accuracy on BIRD Dev, above Claude Opus 4.6 at 68.77% in the same evaluation.
  • The flagship distills into 4B and 9B students; SQRL-4B matches Opus on this test while staying self-hostable.
  • Training cleaned BIRD and Spider, rewarded execution matches, and used CISPO plus distillation to teach the model when to inspect.
  • All three checkpoints are open on Hugging Face and serve with vLLM through a read-only harness that feeds observations back to the model.
  • SQRL is built by Feyn. You can find the team on GitHub, Hugging Face, and X.

The post Feyn AI Releases SQRL, a Text-to-SQL Model Family That Inspects the Database Before Writing a Query appeared first on MarkTechPost.

 

​MarkTechPost

Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

Average Rating

5 Star
0%
4 Star
0%
3 Star
0%
2 Star
0%
1 Star
0%

Leave a Reply

Latest news