To enhance the Gemini 2.5-pro model’s text-to-SQL capabilities, we implemented a structured approach comprised of data filtering, multitask learning, and self-consistency techniques.
Step 1: Data Filtering – We discarded flawed queries using a two-stage pipeline: execution-based validation ensured reliable responses, while LLM-based validation confirmed semantic alignment, creating a high-quality dataset crucial for effective training.
Step 2: Multitask Learning – Utilizing the Supervised Tuning API on Vertex AI, we fine-tuned the model across related tasks beyond basic Text-to-SQL. This enriched its analytic and self-correcting abilities, enabling deeper reasoning and improved accuracy.
Step 3: Self-Consistency – By generating multiple query candidates and clustering execution results, we maximized inference accuracy. Employing the “Few” candidates method, we achieved top ranking on the BIRD benchmark, highlighting our model’s strong baseline capabilities.
This research informs ongoing enhancements in Google Data Cloud products like AlloyDB, which offers AI-powered SQL functionalities, supporting efficient data management without compromising performance.
