AI
Advanced Language Models Make Traditional Schema Linking Obsolete in SQL Query Generation
Researchers show that modern LLMs can successfully generate database queries without the traditional schema-filtering step, achieving top performance on major benchmarks.
A new research paper challenges a longstanding assumption in natural language-to-SQL systems: that filtering database schemas is essential for accurate query generation. Using the latest generation of large language models, researchers demonstrate that this traditional preprocessing step may no longer be necessary.
The Schema Linking Problem#
In conventional Text-to-SQL pipelines, schema linking serves as a critical filtering stage. Its purpose is to identify which tables and columns from a database are relevant to a user's question while excluding irrelevant ones. The theory is sound: by reducing noise and focusing the model's attention, schema linking should improve query accuracy.
However, this approach has a fundamental weakness—imperfect filtering can inadvertently remove columns that are actually needed, leading to incomplete or incorrect SQL generation.
A New Approach for Modern Models#
The research team explored whether contemporary LLMs have developed sufficient reasoning capabilities to handle raw, unfiltered schemas. Their finding is striking: when the complete schema fits within the model's context window, newer models can effectively identify and use relevant database elements even when surrounded by irrelevant information.
This insight led them to redesign their Text-to-SQL pipeline by eliminating schema linking entirely and instead employing alternative techniques to enhance performance:
- Augmentation — adding contextual information to improve model understanding
- Selection — strategically choosing which schema elements to present
- Correction — refining the model's outputs after generation
Benchmark Results#
The approach achieved first place on the BIRD benchmark, a widely-recognized evaluation for Text-to-SQL systems, with an accuracy of 71.83%. This competitive result suggests that the elimination of schema linking, combined with these alternative strategies, is a viable and potentially superior path forward for SQL query generation tasks.

