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

Disclosure: Some links in this article are affiliate links. AI Maestro may earn a commission if you make a purchase, at no…

By Vane July 19, 2026 5 min read
Feyn AI Releases SQRL, a Text-to-SQL Model Family That Inspects the Database Before Writing a Query

Feyn AI has released SQRL, a new text-to-SQL model family that checks a database before generating a query.

Most systems treat this task as translation. SQRL reframes it as inspection. The models generate a query only after resolving ambiguity or confirming the data supports the request. This prevents logically valid SQL from returning incorrect results.

A valid query can still be wrong

Standard schema information lists tables, columns, and types. 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 measures these failures. A system is scored by executing its SQL and comparing the returned rows against a reference result. 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. If that context is enough, it returns a query immediately. If something remains ambiguous, it runs read-only queries and uses the returned rows to draft its final answer.

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.

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 maximise 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 behaviour 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.

What it means

For database users, the change is practical. The model no longer guesses blindly. It checks the data first. This reduces errors caused by ambiguous column names or unexpected join duplicates. The three checkpoints are available on Hugging Face.

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 distils 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.
Scroll to Top