Breaking News • AI • Technology • Startups • Cybersecurity • Future Tech

SQRL: Feyn AI’s Text-to-SQL Model Revolutionizes Database Interaction with Pre-Query Inspection

SQRL: Feyn AI's Text-to-SQL Model Revolutionizes Database Interaction with Pre-Query Inspection

The Challenge with Traditional Text-to-SQL Models

The bigger takeaway is simple: Converting natural language questions into accurate SQL queries has long been a complex task for AI systems. Most text-to-SQL models approach this as a straightforward translation problem, aiming to generate syntactically correct SQL. However, Feyn AI, a YC-backed startup, highlights a critical flaw in this approach: a query can be perfectly valid SQL and still produce incorrect or misleading results.

Traditional systems often struggle with:

  • Ambiguous Column Names: Is ‘county’ stored as ‘Alameda’, ‘Alameda County’, or ‘ALAMEDA’? Schema information alone doesn’t clarify this.
  • Incorrect Joins: Joining the wrong tables or creating duplicate rows without error.
  • Non-Existent Values: Filtering for data that isn’t present in the database, leading to empty or irrelevant results.

These issues don’t trigger SQL errors, making them difficult to detect through execution alone. The BIRD benchmark, with its real-world databases containing imperfect values and complex relationships, effectively measures these types of failures by comparing query results against a reference.

Introducing SQRL: Inspecting Before Answering

In practical terms, Feyn AI’s groundbreaking solution is SQRL, a family of text-to-SQL models that redefines the problem around inspection rather than just translation. SQRL’s core insight is that the missing information needed for accurate queries already resides within the database itself; the model simply needs the ability to ask for it.

Here’s how SQRL operates:

  1. Upon receiving a natural language question and the database schema, SQRL first assesses if it has enough context to generate a query immediately.
  2. If ambiguity remains, SQRL performs read-only exploration queries on the database. These queries are enclosed in <sql> blocks, requesting observations.
  3. The database returns the requested rows within <observation> tags, providing SQRL with crucial real-time context.
  4. Using this new information, SQRL drafts and refines its final query, ensuring it’s not only valid SQL but also logically correct and supported by the actual data.

For example, This decision to inspect is circumstantial. Simple requests, like counting rows in a single table, require no lookup, allowing SQRL to answer directly. For more complex or ambiguous questions, SQRL can inspect the database up to five times, though most are resolved in fewer steps.

Combining the Best of Both Worlds

Historically, text-to-SQL systems have followed two main paths:

  • Single-shot models: Generate the entire query in one go. They are cost-effective but prone to logical errors due to limited context.
  • Frontier pipelines: Involve multiple steps of context retrieval, candidate generation, critique, and selection. These maximize accuracy but are expensive and slow due to numerous API calls and database round trips.

That said, SQRL cleverly combines these strategies within a single model. It handles easy questions efficiently with a single pass and only incurs the cost of inspection when ambiguity necessitates it, striking an optimal balance between accuracy and computational expense.

Advanced Training for Intelligent Inspection

Teaching an AI model when and how to inspect a database is a sophisticated challenge. Feyn AI developed a unique training methodology:

  • Data Cleaning: They meticulously cleaned existing BIRD and Spider datasets, removing examples where reference SQL produced unusable results or didn’t accurately answer the question.
  • Reinforcement Learning: The flagship SQRL-35B-A3B model was trained using CISPO (Clipped Importance Sampling Policy Optimization), a reinforcement learning method that preserves gradient signals from critical, rare tokens.
  • Group-Relative Training: By focusing on the ‘mixed zone’—where only some of eight generated query attempts succeeded—the model learned to differentiate effective inspection strategies from ineffective ones.
  • Distillation: To create deployable student models (SQRL-4B and SQRL-9B), Feyn sampled successful teacher trajectories, preserving the reasoning and observations, and then fine-tuned these smaller models with the same execution reward.

Unmatched Performance and Accessibility

Interestingly, SQRL has demonstrated impressive results on the BIRD Dev benchmark, where queries are scored correct only if they return the exact same result as the reference:

  • SQRL-35B-A3B: Achieves 70.60% execution accuracy, outperforming Claude Opus 4.6 (68.77%) in the same evaluation.
  • SQRL-9B: Nearly matches the flagship at 69.80%.
  • SQRL-4B: Reaches 68.80%, matching Claude Opus 4.6. This compact model is small enough for self-hosting, ensuring data privacy and control.

Feyn AI has made all three SQRL checkpoints openly available on Hugging Face, built upon the Qwen3.5 and Qwen3.6 model families. They recommend SQRL-9B as the default for most applications, SQRL-4B for tight budget constraints, and SQRL-35B-A3B for peak accuracy requirements. Deployment is straightforward using vLLM, with key recommendations to ensure database execution remains read-only and that the raw message content, including action protocols, is preserved.

Expert Perspective

From an industry angle, the clearest signal around Feyn AI SQRL Text-to-SQL is how it may influence sqrl. The story reads less like a one-day spike and more like a marker of broader movement.

The next phase will depend on how quickly teams, regulators, or customers react. In practice, that gives Feyn AI SQRL Text-to-SQL room to reshape expectations across database over the near term.

For readers focused on practical impact, the best next step is to watch what changes around model once attention turns into execution.

Frequently Asked Questions

Why does Feyn AI SQRL Text-to-SQL matter right now?

The Challenge with Traditional Text-to-SQL Models The bigger takeaway is simple: Converting natural language questions into accurate SQL queries has long been a complex task for AI systems.

What broader change could Feyn AI SQRL Text-to-SQL signal?

Most text-to-SQL models approach this as a straightforward translation problem, aiming to generate syntactically correct SQL.

What should the market watch next around Feyn AI SQRL Text-to-SQL?

However, Feyn AI, a YC-backed startup, highlights a critical flaw in this approach: a query can be perfectly valid SQL and still produce incorrect or misleading results.

Key Takeaways

  • SQRL is a novel text-to-SQL model family from Feyn AI that inspects databases via read-only probes before generating final queries.
  • It achieves 70.6% execution accuracy on BIRD Dev with its 35B-A3B model, surpassing frontier models like Claude Opus 4.6.
  • Smaller 4B and 9B student models offer comparable performance, with SQRL-4B enabling self-hostable, private text-to-SQL solutions.
  • The training involved meticulous data cleaning, CISPO reinforcement learning, and distillation to teach intelligent inspection.
  • All SQRL models are open-source on Hugging Face, deployable with vLLM, and designed for secure, read-only database interaction.

Source: https://www.marktechpost.com/2026/07/19/feyn-ai-releases-sqrl-a-text-to-sql-model-family-that-inspects-the-database-before-writing-a-query/

Share this article

Subscribe

By pressing the Subscribe button, you confirm that you have read our Privacy Policy.

Latest News

More Articles