EvoSQL Improves Text-to-SQL with Co-Evolution and Memory

Jiawei Zhou, Jianwei Wang, Chenyu Zhou, Chaojian Shi, Ming Dong, Kai Wang· July 24, 2026 View original

Summary

EvoSQL is a co-evolution framework that significantly advances Text-to-SQL capabilities by iteratively interacting a generator and a critic, maintaining a contextualized candidate memory, and using execution signals for verification. It also introduces Self-Distillation Policy Optimization (SDPO) fine-tuning, leading to substantial performance gains on complex Text-to-SQL benchmarks.

While large language models have greatly improved Text-to-SQL capabilities, generating complex database queries still demands advanced reasoning, including multi-step decomposition and execution-based error diagnosis. To address these challenges, EvoSQL, a novel co-evolution framework, has been developed. EvoSQL conceptualizes SQL synthesis as an iterative dialogue between a generator, which proposes SQL candidates, and a critic, which evaluates them.The framework maintains a dynamic, contextualized memory of candidate SQL queries. These candidates are rigorously verified using both actual execution signals and LLM-based critique. The memory is then updated through a utility-guided aggregation process, ensuring that the system continuously learns and refines its approach. To further enhance the underlying generator-critic pair, EvoSQL incorporates a Self-Distillation Policy Optimization (SDPO) fine-tuning stage. This stage injects execution-aware supervision into modern coding LLM backbones, making them more adept at generating correct SQL.Extensive experiments on challenging benchmarks like Spider and BIRD demonstrate that EvoSQL consistently outperforms existing open-source models. The gains are particularly notable on BIRD-Dev, with improvements ranging from +1.37% to +9.19% for various models. The SDPO initialization further boosts performance. These results underscore the effectiveness of memory-grounded co-evolution as a robust strategy for developing more reliable and generalizable Text-to-SQL systems.

Why it matters

This research is highly valuable for professionals working with data and databases, particularly those looking to automate or simplify complex data querying. EvoSQL promises more accurate and reliable Text-to-SQL systems, reducing the need for manual SQL writing and debugging.

How to implement this in your domain

  1. 1Evaluate your current Text-to-SQL solutions for accuracy and efficiency, especially for complex queries.
  2. 2Explore integrating co-evolutionary frameworks and memory-augmented generation into your Text-to-SQL pipeline.
  3. 3Investigate applying Self-Distillation Policy Optimization (SDPO) to fine-tune your existing coding LLMs for SQL generation.
  4. 4Utilize execution-based feedback loops to continuously improve the performance and reliability of your Text-to-SQL models.

Who benefits

Data AnalyticsSoftware DevelopmentBusiness IntelligenceDatabase ManagementFinancial Services

Key takeaways

  • Complex Text-to-SQL requires advanced reasoning beyond one-shot generation.
  • EvoSQL is a co-evolution framework using a generator, critic, and candidate memory.
  • It verifies SQL candidates with execution signals and LLM-based critique.
  • EvoSQL significantly improves Text-to-SQL performance on complex benchmarks.

Original post by Jiawei Zhou, Jianwei Wang, Chenyu Zhou, Chaojian Shi, Ming Dong, Kai Wang

"arXiv:2607.20489v1 Announce Type: new Abstract: Text-to-SQL has advanced rapidly with large language models, but complex database queries still require reasoning beyond one-shot generation, including multi-step decomposition, execution-based diagnosis, and targeted correction. We…"

View on X

Originally posted by Jiawei Zhou, Jianwei Wang, Chenyu Zhou, Chaojian Shi, Ming Dong, Kai Wang on X · view source

Want to go deeper?

Turn these trends into skills with Learnijoy's hands-on AI & tech courses.

Explore courses