---
title: Agentar-Scale-SQL-Generation-32B
canonical_url: "https://www.modelscope.cn/models/AntGroup/Agentar-Scale-SQL-Generation-32B"
md_url: "https://www.modelscope.cn/models/AntGroup/Agentar-Scale-SQL-Generation-32B.md"
repository: AntGroup/Agentar-Scale-SQL-Generation-32B
last_updated: 2025-11-28
license: apache-2.0
pipeline_tag: text-generation
tasks:
  - text-generation
model_type:
  - qwen2
architectures:
  - Qwen2ForCausalLM
base_model:
  - Omni-SQL-32B
base_model_relation: finetune
parameters: 32.8B
tensor_type:
  - BF16
library_name:
  - safetensors
  - pytorch
frameworks:
  - pytorch
language:
  - en
inference_backends:
  - "deploy_task text/emb"
  - "lmdeploy 0.9.1"
  - "lmdeploy_turbomind 0.9.1"
  - "sglang 0.5.2"
  - "vllm 0.9.2"
downloads: 468
stars: 17
---

# Agentar-Scale-SQL-Generation-32B

> Agentar-Scale-SQL-Generation-32B - AntGroup 在 ModelScope 开源的模型。We are excited to release the Agentar-Scale-SQL-Generation-32B, the core Reasoning SQL Generator used in our SOTA framework, Agentar-Scale-SQL. Our framework achieved 81.67% execution accuracy on…

AntGroup/Agentar-Scale-SQL-Generation-32B 是 ModelScope 魔搭社区上的 32.8B 参数text-generation模型，采用 apache-2.0 许可，基于 Omni-SQL-32B 构建，可用 deploy_task text/emb、lmdeploy 0.9.1、lmdeploy_turbomind 0.9.1 部署。

- **Repository**: AntGroup/Agentar-Scale-SQL-Generation-32B
- **License**: apache-2.0
- **Tasks**: text-generation
- **Parameters**: 32.8B
- **Base model**: Omni-SQL-32B
- **Inference backends**: deploy_task text/emb, lmdeploy 0.9.1, lmdeploy_turbomind 0.9.1, sglang 0.5.2, vllm 0.9.2
- **Downloads**: 468
- **Stars**: 17
- **Last updated**: 2025-11-28

Source: https://www.modelscope.cn/models/AntGroup/Agentar-Scale-SQL-Generation-32B

---

## Important Links

[![Paper](https://img.shields.io/badge/paper-arXiv-red)](https://arxiv.org/abs/2509.24403)
[![GitHub](https://img.shields.io/badge/GitHub-Repo-blue.svg)](https://github.com/antgroup/Agentar-Scale-SQL)
[![Leaderboard](https://img.shields.io/badge/BIRD%20Leaderboard-%231-brightgreen)](https://bird-bench.github.io/)
[![Hugging Face](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Models-yellow)](https://huggingface.co/collections/antgroup/agentar-scale-sql)
[![ModelScope](https://img.shields.io/badge/ModelScope-Models-blue)](https://modelscope.cn/collections/Agentar-Scale-SQL-0c368e98f73f41)

## Introduction

We are excited to release the **Agentar-Scale-SQL-Generation-32B**, the core **Reasoning SQL Generator** used in our SOTA framework, **Agentar-Scale-SQL**. Our framework achieved **81.67% execution accuracy** on the challenging BIRD benchmark, ranking first on the official leaderboard.

This model is a key component of our "Orchestrated Test-Time Scaling" strategy and has several key features:

  - **Base Model:** It is fine-tuned from `Omni-SQL-32B`.
  - **RL-Enhanced Reasoning:** The model was further trained using an execution-grounded **Reinforcement Learning** framework (GRPO) to enhance its intrinsic reasoning capabilities.
  - **Deep Reasoning:** It is engineered to conduct deep, step-by-step reasoning and construct complex, high-accuracy SQL queries.

This model is one of the two main generators in the `Agentar-Scale-SQL` framework's "Diverse Synthesis" step, working in parallel with an ICL generator to produce a robust pool of SQL candidates.

## Model Downloads

| **Model**                         | **Role**       |                      
|-----------------------------------|----------------|
| **Agentar-Scale-SQL-Generation-32B**  | **SQL Generator**  |
| Agentar-Scale-SQL-Selection-32B | SQL Selector |

## Performance

The performance metrics below reflect the **entire Agentar-Scale-SQL framework**, which uses this Generation model as a key component. The results demonstrate our SOTA performance on the BIRD benchmark.

| Methods                      | EX (Dev) | **EX (Test)** | R-VES (%) |
|:-----------------------------|:---:|:---:|:---------:|
| **Agentar-Scale-SQL (Ours)** | **74.90** | **81.67** | **77.00** |
| AskData + GPT-4o             | 76.14 | 80.88 |   76.24   |
| LongData-SQL                 | 74.32 | 77.53 |   71.89   |
| CHASE-SQL + Gemini           | 74.90 | 76.02 |   69.94   |
| JoyDataAgent-SQL             | 74.25 | 75.74 |   70.16   |
| TCDataAgent-SQL              | 74.12 | 75.74 |     -     |
| Contextual-SQL               | 73.50 | 75.63 |   70.02   |
| XiYan-SQL                    | 73.34 | 75.63 |   71.41   |


## Prompt Template

````python
PROMPT_TEMPLATE = """Task Overview:
You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.

Database Engine:
{{ dialect }}

Database Schema:
{{ db_schemas }}
This schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.
{% if matched_contents %}
Matched contents:
{{ matched_contents }}
Matched contents presents values related to the question, together with their source table and column, for your reference in SQL generation.
{% endif %}
Question:
{%- if hint %}
{{ hint }}
{{ question }}
{%- else %}
{{ question }}
{%- endif %}

Instructions:
- If Matched contents is provided, you can use it as reference when generating the SQL query.
- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.
- The generated query should return all of the information asked in the question without any missing or extra information.
- Before generating the final SQL query, please think through the steps of how to write the query.

Output Format:
In your answer, please enclose the generated SQL query in a code block:
```sql
-- Your SQL query
```

Take a deep breath and think step by step to find the correct SQL query.
"""
````

## Try Our Product
We are developing a ChatBI product that transforms complex business data into conversational insights. If you are interested in trying our ChatBI product, please contact us.

<figure>
  <img src="./resources/product_info.jpg" 
       alt="dingding" 
       width="300" 
       style="display: block; margin: 0 auto;">
  <figcaption style="text-align: center; font-style: italic; color: #555;">
    Figure 1:  The contact information.
  </figcaption>
</figure>

## Acknowledgments

If you find our work useful, please cite the Agentar-Scale-SQL paper:

```bibtex
@misc{wang2025agentarscalesqladvancingtexttosqlorchestrated,
      title={Agentar-Scale-SQL: Advancing Text-to-SQL through Orchestrated Test-Time Scaling}, 
      author={Pengfei Wang and Baolin Sun and Xuemei Dong and Yaxun Dai and Hongwei Yuan and Mengdie Chu and Yingqi Gao and Xiang Qi and Peng Zhang and Ying Yan},
      year={2025},
      eprint={2509.24403},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2509.24403}, 
}
```
