/ Модель

Характеристики

Контекст
262 144 токена
Лицензия
Apache 2.0
Архитектура
qwen3_5 · dense
Базовая модель
Qwen3.5-9B
Библиотека
transformers
Опубликована
1 ноя 2026

Qwen3.5-9B_text2sql

Генерация текстаТекст → текст5 профессий

Дообученная Qwen3.5-9B, которая преобразует вопросы о данных и схемы базы в SQL-запросы для SQLite.

705скачиваний за 30 дней0лайковвеса обновлены8 ноя 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Qwen3.5-9B Text-to-SQL — дообученная EuricoGVP модель на базе Qwen/Qwen3.5-9B для преобразования вопроса о данных, схемы базы и необязательной подсказки в один SQL-запрос для SQLite. Модель создана с помощью LoRA, адаптер слит с весами; это причинная языковая модель с визуальным энкодером, который при дообучении не изменялся. В модели 9 млрд параметров; обучение проводилось на последовательностях до 4096 токенов, а контекст до 8192 токенов оценивался отдельно.

Модель предназначена для запросов к базам данных на естественном языке и генерации SQL по схеме, в частности для сценариев Text-to-SQL и аналитических интерфейсов. В README приведены результаты на англоязычных наборах BIRD и Spider: точность исполнения составляет 57,17% и 59,32% на BIRD dev в зависимости от представления схемы и 82,01% на Spider dev. Рекомендуются формат запроса из карточки и жадное декодирование; модель сама запросы не выполняет и не проверяет. Лицензия — Apache-2.0.

Сценарии применения

  • генерация SQLite-запросов по вопросу на естественном языке
  • создание запросов к базе данных по схеме и описаниям столбцов
  • подготовка SQL для англоязычного аналитического интерфейса
  • автоматизация преобразования вопросов пользователей в запросы к данным

Ограничения

Генерирует запросы только для SQLite; другие диалекты и языки не оценивались. Модель не выполняет и не проверяет запросы, а качество на схемах длиннее 4096 токенов недостаточно исследовано; многие ошибочные ответы могут выполняться без ошибки, но возвращать неверный результат.

Для каких профессий подходит5

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Также подходит для

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Qwen3.5-9B Text-to-SQL

Collection Sibling Model Sibling Model Sibling Model Base Model Notebooks

[!Note] This repository contains the full model weights and configuration files in the Hugging Face Transformers format. The LoRA adapter is merged into the weights, so PEFT is not needed.

These artifacts are compatible with Hugging Face Transformers and vLLM.

Qwen3.5-9B Text-to-SQL is a fine-tune of Qwen/Qwen3.5-9B that generates one SQLite query from a database schema, an optional hint and a question.

Qwen3.5-9B Text-to-SQL Highlights

Compared with the base model, this fine-tune delivers:

  • Higher Execution Accuracy: 57.17% on BIRD dev with the plain schema, 59.32% with column descriptions and 82.01% on Spider dev, between 4.7 and 7.2 percentage points above the base model.
  • Significant Gain in All Runs: exact McNemar p below 1e-04 in all three runs, with higher accuracy at every difficulty level of both benchmarks.
  • Fewer Execution Errors: from 143 to 48 on BIRD plain, from 136 to 60 on BIRD desc, and from 18 to 14 on Spider dev.

For more details, please refer to the notebooks.

Model Overview

  • Type: Causal Language Model with Vision Encoder
  • Task: Text-to-SQL for SQLite
  • Base Model: Qwen/Qwen3.5-9B
  • Language Model
    • Number of Parameters: 9B
    • Hidden Dimension: 4096
    • Number of Layers: 32
    • Hidden Layout: 8 × (3 × (Gated DeltaNet → FFN) → 1 × (Gated Attention → FFN))
  • Fine-Tuning
    • Method: LoRA with Unsloth, merged into the weights
    • Rank and Alpha: 16 and 16
    • Epochs: 1
    • Precision: bf16
    • Scope: language model only, the vision encoder was not changed
  • Max Training Length: 4,096 tokens
  • Evaluated Context Length: 8,192 tokens

Training Data

SourceExamplesLicense
EuricoGVP/birdsql_complete_trainset (BIRD train)5,980CC BY-SA 4.0
EuricoGVP/spider_sql_complete (Spider train), without formula_1, which is also in BIRD dev8,097CC BY-SA 4.0
seeklhy/SynSQL-2.5M subset, with long context and names that need quotes2,105Apache-2.0
llmsql-bench/llmsql-benchmark subset, with columns that need quotes950MIT
Total17,132

Model Family

ModelBase ModelWeights
Qwen3.5-0.8B Text-to-SQLQwen/Qwen3.5-0.8Babout 1.7 GB
Qwen3.5-2B Text-to-SQLQwen/Qwen3.5-2Babout 4.4 GB
Qwen3.5-4B Text-to-SQLQwen/Qwen3.5-4Babout 9 GB
Qwen3.5-9B Text-to-SQL (this repository)Qwen/Qwen3.5-9Babout 19 GB

Benchmark Results

Execution accuracy (EX) in percent, against Qwen/Qwen3.5-9B with the same prompts. BIRD dev has 1,534 questions on 11 databases, with two variants: plain (schema only) and desc (schema with column descriptions). Spider dev has 1,034 questions on 20 databases.

BenchmarkBaseThis ModelOnly This Model CorrectOnly Base CorrectMcNemar p
BIRD dev, plain51.1157.172011081.35e-07
BIRD dev, desc52.0959.322211101.04e-09
Spider dev77.2782.0196475.10e-05

BIRD (dev)

MetricBase, plainThis Model, plainBase, descThis Model, desc
Simple57.5162.7059.4665.08
Moderate42.4651.2941.8152.80
Challenging37.9340.6937.9343.45
Execution errors1434813660

Spider (dev)

MetricBaseThis Model
Easy91.1393.95
Medium83.1888.12
Hard66.6772.99
Extra51.8157.23
Execution errors1814

Model Family Comparison

ModelBIRD plainBIRD descSpider dev
Qwen3.5-0.8B base12.3915.3237.14
Qwen3.5-0.8B fine-tuned37.4838.2069.73
Qwen3.5-2B base25.6826.7357.93
Qwen3.5-2B fine-tuned43.1645.1173.98
Qwen3.5-4B base46.22*46.28*77.08
Qwen3.5-4B fine-tuned54.7656.1981.82
Qwen3.5-9B base51.1152.0977.27
Qwen3.5-9B fine-tuned57.1759.3282.01

Values from this repository, EuricoGVP/Qwen3.5-0.8B_text2sql, EuricoGVP/Qwen3.5-2B_text2sql and EuricoGVP/Qwen3.5-4B_text2sql. *Measured with the same benchmark notebook as the fine-tuned models.

[!Note] A query counts as correct when it returns the same result as the gold query on the real database. BIRD compares results as sets, as in the official evaluation.py. Spider follows exec_eval.py from the official test-suite, but runs only on the original database, without the extra test-suite databases, so the official score would be equal or lower.

Quickstart

[!Important] The model was trained and evaluated in non-thinking mode, with the prompt below. Keep enable_thinking=False and this format to reproduce the results.

Prompt Template

Replace None with the hint when you have one. The model answers with a single SQL code block.

SYSTEM_PROMPT = """You are an expert SQLite data analyst.

You will be given a database schema, an optional hint, and a question.
Write a single SQLite query that answers the question.

Rules:
- Use only the tables and columns present in the schema.
- Use the hint when it is provided; it explains domain terms in the question.
- Return exactly the columns the question asks for, nothing more.
- Output only the query, inside a single ```sql code block.
- Do not explain your reasoning and do not write any text outside the code block."""

schema = """CREATE TABLE singer (Singer_ID int PRIMARY KEY, Name text);
CREATE TABLE song (Song_ID int PRIMARY KEY, Title text, Singer_ID int);"""
question = "Show the names of singers that have more than one song."

messages = [
    {"role": "system", "content": SYSTEM_PROMPT},
    {"role": "user", "content": f"Database schema:\n{schema}\n\nHint: None\n\nQuestion: {question}"},
]

Inference with vLLM

# pip install vllm
from vllm import LLM, SamplingParams

llm = LLM(model="EuricoGVP/Qwen3.5-9B_text2sql", max_model_len=8192, language_model_only=True)
sampling = SamplingParams(temperature=0, max_tokens=2048)

outputs = llm.chat([messages], sampling, chat_template_kwargs={"enable_thinking": False})
print(outputs[0].outputs[0].text)

Inference with Transformers

# pip install "transformers>=5.22.1" accelerate
from transformers import AutoModelForImageTextToText, AutoTokenizer

model_id = "EuricoGVP/Qwen3.5-9B_text2sql"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForImageTextToText.from_pretrained(model_id, dtype="auto", device_map="auto")

inputs = tokenizer.apply_chat_template(
    messages, add_generation_prompt=True, enable_thinking=False, return_tensors="pt", return_dict=True
).to(model.device)
output = model.generate(**inputs, max_new_tokens=2048, do_sample=False, eos_token_id=tokenizer.eos_token_id)
print(tokenizer.decode(output[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True))

Best Practices

To achieve the benchmark performance, we recommend the following settings:

  1. Prompt Format: use the system prompt and the user message above without changes. Other formats were not evaluated.
  2. Greedy Decoding: use temperature=0, as in the benchmarks.
  3. Column Descriptions: include them in the schema when you have them. On BIRD dev they raised EX from 57.17% to 59.32%.
  4. Read-Only Execution: run the generated queries on a read-only connection and review the results. The model does not run or validate queries.

Limitations

  • The model generates SQLite only. Both benchmarks are in English and use SQLite, so other languages and dialects were not evaluated.
  • Most wrong answers run without error: 609 of 657 on BIRD plain, 564 of 624 on BIRD desc and 172 of 186 on Spider dev.
  • The most common execution error is no such column: 43 of 48 on BIRD plain, 54 of 60 on BIRD desc and 11 of 14 on Spider dev.
  • Examples over 4,096 tokens were not used in training, so behavior on very large schemas is not well measured.

License

  • Model weights: Apache-2.0, the same license as the base model. This is a modified version of Qwen/Qwen3.5-9B: the weights were changed by LoRA fine-tuning.
  • Files in data/: CC BY-SA 4.0, since they contain questions, schemas and queries from BIRD and Spider, with attribution to the original authors. The excerpts from SynSQL-2.5M (Apache-2.0) and LLMSQL (MIT, derived from WikiSQL, BSD-3-Clause) are compatible with this redistribution. Anyone using these data must respect the original license of each dataset.
  • Notebooks: Apache-2.0.

Citation

If you find this work helpful, feel free to cite it.

@misc{pereira2026qwen35text2sql9b,
  title  = {{Qwen3.5-9B Text-to-SQL}},
  author = {Eurico Pereira},
  year   = {2026},
  url    = {https://huggingface.co/EuricoGVP/Qwen3.5-9B_text2sql}
}
@misc{qwen3.5,
    title  = {{Qwen3.5}: Towards Native Multimodal Agents},
    author = {{Qwen Team}},
    month  = {February},
    year   = {2026},
    url    = {https://qwen.ai/blog?id=qwen3.5}
}

@article{li2024can,
  title={Can llm already serve as a database interface? a big bench for large-scale database grounded text-to-sqls},
  author={Li, Jinyang and Hui, Binyuan and Qu, Ge and Yang, Jiaxi and Li, Binhua and Li, Bowen and Wang, Bailin and Qin, Bowen and Geng, Ruiying and Huo, Nan and others},
  journal={Advances in Neural Information Processing Systems},
  volume={36},
  year={2024}
}

@inproceedings{Yu&al.18c,
  title     = {Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Task},
  author    = {Tao Yu and Rui Zhang and Kai Yang and Michihiro Yasunaga and Dongxu Wang and Zifan Li and James Ma and Irene Li and Qingning Yao and Shanelle Roman and Zilin Zhang and Dragomir Radev},
  booktitle = "Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing",
  address   = "Brussels, Belgium",
  publisher = "Association for Computational Linguistics",
  year      = 2018
}

@inproceedings{llmsql_bench,
  title={LLMSQL: Upgrading WikiSQL for the LLM Era of Text-to-SQL},
  author={Pihulski, Dzmitry and Charchut, Karol and Novogrodskaia, Viktoria and Koco{\'n}, Jan},
  booktitle={2025 IEEE International Conference on Data Mining Workshops (ICDMW)},
  year={2025},
  organization={IEEE}
}

Acknowledgements

Thanks to the Qwen Team, Unsloth, vLLM and the authors of BIRD, Spider, SynSQL-2.5M, LLMSQL and WikiSQL.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers

Можно запустить

Подбираем GPU…

Класс архитектуры
Qwen3_5ForConditionalGeneration
Ревизия весов
25e88d0

0 моделей