AIJian/TrustSQL-8B
AIJian/TrustSQL-8B is an 8.2 billion parameter Text-to-SQL model fine-tuned from Qwen3-8B, developed by Ai Jian and collaborators. It specializes in generating SQL queries from natural language over unknown database schemas, utilizing multi-turn reinforcement learning and tool integration. The model achieves 65.8 EX on BIRD-Dev with greedy decoding and is designed for robust SQL generation within a tool-using agent loop to prevent schema hallucination.
Loading preview...
TrustSQL-8B: Advanced Text-to-SQL for Unknown Schemas
TrustSQL-8B is an 8.2 billion parameter language model developed by Ai Jian and collaborators, specifically fine-tuned for Text-to-SQL tasks. Built upon the Qwen3-8B architecture, this model excels in generating accurate SQL queries even when the database schema is initially unknown. It leverages a novel approach combining multi-turn reinforcement learning with tool integration, designed to enhance reliability and reduce common issues like schema hallucination.
Key Capabilities and Features
- Specialized Text-to-SQL: Optimized for converting natural language questions into SQL queries, particularly in complex scenarios where database schemas are not fully known beforehand.
- Tool-Integrated Reinforcement Learning: Employs a unique two-stage training pipeline involving SFT warm-up and Phase-Aware GRPO optimization, guided by an
Explore → Propose → Generate → Confirminteraction protocol. - Schema Hallucination Prevention: The explicit 'proposal checkpoint' within its inference setup is crucial for verifying tables and columns via tool output, significantly mitigating the risk of generating SQL based on incorrect schema assumptions.
- Performance Benchmarks: Achieves competitive results on challenging Text-to-SQL datasets, including 65.8 EX on BIRD-Dev (greedy decoding) and 83.9 EX on Spider-Test, demonstrating its effectiveness in real-world scenarios.
- Robust Inference Workflow: Designed to operate within an agent loop that explores metadata, proposes verified elements, generates and executes SQL, and confirms results, allowing for iterative refinement.
Ideal Use Cases
- Database Query Automation: Automating the generation of SQL queries from natural language requests for databases with potentially evolving or unfamiliar schemas.
- Business Intelligence Tools: Integrating natural language interfaces into BI platforms, allowing users to query data without deep SQL knowledge.
- Data Exploration: Assisting data analysts and scientists in exploring new datasets by translating their questions into executable SQL, even when schema details are not fully memorized.
Limitations: The model was primarily trained and evaluated using SQLite-based benchmarks. Its inference requires a live and secure metadata/execution environment, and generated SQL should always be validated, preferably with read-only permissions initially.