/ Модель

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

Контекст
40 960 токенов
Параметры
3,7 млрд
Размер весов
8 ГБ
Лицензия
Apache 2.0
Архитектура
qwen3 · dense
Базовая модель
Qwen3-4B
Библиотека
transformers
Опубликована
20 ноя 2026

sid1-qwen3-4b

Генерация текстаТекст → текст
108скачиваний за 30 дней0лайковвеса обновлены21 ноя 2026

Описание модели

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

Дообученная на Qwen3-4B модель для агентного поиска документов, нужных для ответа на многошаговые вопросы.

sid1-qwen3-4b — языковая модель Qwen3, дообученная методом обучения с подкреплением GRPO для поиска документов, подтверждающих ответ на многошаговый вопрос. Модель разработал автор репозитория на основе Qwen/Qwen3-4B; все 4,022 млрд параметров были обучены. Она использует архитектуру Qwen3ForCausalLM и формат safetensors в bf16, работает с контекстом до 40 960 токенов и предназначена для запуска через Transformers.

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

Это ранняя исследовательская версия: обучение остановили на 175 из 400 запланированных шагов. Обучение и оценка проводились на многошаговых вопросах из MuSiQue, HotpotQA и 2WikiMultiHopQA по абзацам Википедии; перенос на другие типы вопросов, коллекции и языки не проверен. Во время обучения модель не использовала инструмент чтения документов и опиралась на короткие поисковые выдержки; увеличение числа возвращаемых документов повышает полноту, но снижает точность. Лицензия — Apache-2.0.

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

  • Поиск подтверждающих документов для многошагового вопроса
  • Ранжирование документов в коллекции Википедии
  • Поэтапный поиск документов через плотный и ключевой поиск
  • Использование как поискового этапа системы ответов на вопросы
  • Исследование агентного поиска с вызовом инструментов

Ограничения

Модель не пишет ответы, требует совместимой схемы инструментов и системного промпта, а её обучение и оценка ограничены англоязычными вопросами по абзацам Википедии из трёх бенчмарков. Обучение остановлено раньше запланированного срока; инструмент чтения документов модель фактически не использовала, а перенос на другие коллекции и языки не оценивался.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

Бенчмарки пользователейпока нет

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

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

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

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

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

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

    Модели ответят на каждую задачу, судья оценит ответы по шкале 0–100.

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

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

Открыть на Hugging Face

sid1-qwen3-4b: a search agent trained with reinforcement learning

Qwen/Qwen3-4B fine-tuned with reinforcement learning (GRPO) to find the documents that answer a multi-hop question. It does not write an answer. It searches a collection with dense and keyword search, reads, searches again hop by hop, and finally reports a ranked list of document ids. The recipe follows the SID-1 technical report, scaled down to a 4B model, three public datasets and one GPU.

This is an early stop: 175 of a planned 400 training steps (see Training). It is a research artifact, not a finished replication of SID-1.

Model details

Base modelQwen/Qwen3-4B, 4,022,468,096 parameters, all of them trained
TrainingRL only, no supervised fine-tuning (there is no target text to imitate): the reward is the NDCG of the reported list against the datasets' annotated supporting paragraphs
Formatbf16 safetensors, same architecture and tensor names as the base model (loads with AutoModelForCausalLM)
LanguageEnglish
LicenseApache 2.0, as the base model
Developed bymasterofaudio2077
DemoAgentic Search, Trained with RL: replay recorded runs or run the model live, next to plain vector search
CodeThe training notebook and the reference agent loop (agent.py, agent_core.py) are in the demo Space

Uses

Direct use. Give it a question and four tools over your own collection: search_dense, search_bm25, read, report. It returns the ids of the documents needed to answer the question. Use it as the retrieval step of a question-answering system, or to study agentic search.

Out-of-scope. It is not a chat model and does not answer questions. It was trained on one tool schema and one system prompt (below) and may not follow different ones. It was never trained on the open web, other languages, or other kinds of collections.

Bias, risks and limitations

  • In-domain evaluation. Training and evaluation questions come from the same three benchmarks (MuSiQue, HotpotQA, 2WikiMultiHopQA) over Wikipedia paragraphs. Train and dev questions do not overlap, but the results do not show how well it works on other question styles or collections.
  • Early stop. Stopped at step 175 of 400. The learning-rate decay phase of the schedule never started. On the 96-question checkpoints the score had flattened at about 0.66 since step 100, so more steps may or may not have helped.
  • It never uses read. During training the read tool was called 0.0 times per trajectory; it relies on the 160-character excerpts that the searches return. Do not expect it to open documents.
  • Lower precision. It reports more documents than the base model (up to 20), so recall and NDCG rise while precision falls (table below).
  • One run, one seed. There are no confidence intervals. The evaluation has 600 questions (200 per dataset), and the 96-question checkpoints during training are noisy.
  • Cost of 4 samples. The best number (4 samples fused) needs four full runs per question.
  • Inherits the biases and failure modes of the Qwen3 base model and of the Wikipedia text it searches.

How to get started

One turn of the agent with transformers. The prompt and tool schema must be exactly these, because the model was trained on them.

import json, re, torch
from transformers import AutoTokenizer, AutoModelForCausalLM

repo = "masterofaudio2077/sid1-qwen3-4b"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, dtype=torch.bfloat16, device_map="auto").eval()

TOOLS = [
    {"type": "function", "function": {"name": "search_dense",
        "description": "Semantic (embedding) search over the document collection. Returns the top matches as '[doc_id] title: excerpt'.",
        "parameters": {"type": "object", "properties": {"query": {"type": "string", "description": "a natural-language query or a short drafted answer passage"}}, "required": ["query"]}}},
    {"type": "function", "function": {"name": "search_bm25",
        "description": "Keyword (BM25) search over the document collection. Best for names, titles and rare terms. Returns the top matches as '[doc_id] title: excerpt'.",
        "parameters": {"type": "object", "properties": {"query": {"type": "string", "description": "keywords"}}, "required": ["query"]}}},
    {"type": "function", "function": {"name": "read",
        "description": "Read the full text of one document.",
        "parameters": {"type": "object", "properties": {"doc_id": {"type": "string"}}, "required": ["doc_id"]}}},
    {"type": "function", "function": {"name": "report",
        "description": "Finish. Report every document needed to answer the question, most relevant first. Must be the only call in its turn.",
        "parameters": {"type": "object", "properties": {"doc_ids": {"type": "array", "items": {"type": "string"}}}, "required": ["doc_ids"]}}},
]

SYSTEM_PROMPT = (
    "You are a retrieval agent. You are given a question. Do not answer it. Find the documents in the collection that are needed to answer it "
    "and report their ids, most relevant first.\n"
    "Search with several different queries in the same turn (semantic and keyword), read documents when an excerpt is not enough, and follow "
    "multi-step questions hop by hop. When you are done, call report once with the ids of all the documents needed. "
    "You have at most 6 turns, and report must be called before they run out."
)

msgs = [{"role": "system", "content": SYSTEM_PROMPT},
        {"role": "user", "content": "When did the luxury division of the maker of the Toyopet Master change the RX 350 body style?"}]
prompt = tok.apply_chat_template(msgs, tools=TOOLS, add_generation_prompt=True, enable_thinking=True, tokenize=False)
ids = tok(prompt, return_tensors="pt", add_special_tokens=False).to(model.device)
out = model.generate(**ids, max_new_tokens=1536, do_sample=True, temperature=0.7, top_k=0, top_p=1.0,
                     eos_token_id=tok.convert_tokens_to_ids("<|im_end|>"))
text = tok.decode(out[0, ids.input_ids.shape[1]:], skip_special_tokens=True)
calls = [json.loads(c) for c in re.findall(r"<tool_call>\s*(.*?)\s*</tool_call>", text.rsplit("</think>", 1)[-1], re.S)]
print(calls)    # a list of {"name": ..., "arguments": {...}}: several searches per turn, or a single report

To run the whole loop (up to 6 turns), run each call against your collection and feed the results back as the model's next input, formatted as [doc_id] title: excerpt lines inside <tool_response> blocks. Stop at report. agent.py and agent_core.py in the demo Space do this, including the parsing and the exact result format.

Sampling. The model was trained and evaluated with temperature only (1.0 in training, 0.7 in evaluation), no top-k and no top-p, and generation stops at <|im_end|>. This repository's generation_config.json is the Qwen3 default (temperature 0.6, top-k 20, top-p 0.95), so pass top_k=0, top_p=1.0 as above.

Training details

Data

Questions from the train splits of three public multi-hop QA sets, with the supporting paragraphs as gold documents:

DatasetQuestion pool
MuSiQueall 19,938 train questions
HotpotQA (distractor)50,000 sampled
2WikiMultiHopQA50,000 sampled

119,938 questions in the pool; 175 steps × 16 questions = 2,800 of them were actually used. The search collection is the pooled, de-duplicated paragraphs of all three sets (train and dev): 578,747 paragraphs with random ids. 200 dev questions per dataset (600 in total) are held out for evaluation; none of them is a training question.

Procedure

  • Algorithm: GRPO in a custom loop (Magistral style, as in SID-1): 16 questions × 8 attempts per step, no KL term, no importance ratio, one update per batch. A group whose attempts all get the same reward gives zero signal and is skipped. The advantage is the reward minus the group mean, divided by the group's total generated tokens (SID-1's length-bias fix).
  • Rollouts: vLLM, tool results appended as tokens (the chat template is never re-applied). At most 6 turns, 1,536 tokens per turn, up to 6 parallel tool calls per turn, context cap 4,608 → 6,144 tokens (from step 100).
  • Tools: search_dense (Qwen3-Embedding-0.6B, top 4), search_bm25 (bm25s, top 4), read (first 1,800 characters), report (at most 20 ids, must be the only call in its turn).
  • Reward: NDCG of the reported list against the gold paragraphs, (0 if it never reported), minus 0.1 for a malformed turn, minus a length penalty that grows linearly from 0 at 3,000 generated tokens to 0.1 at 7,000.
  • Optimizer: Lion with 8-bit momentum and stochastic rounding, peak learning rate 5e-7 on a warmup-stable-decay schedule (40 warmup steps, constant until step 320, then linear decay to 10%), weight decay 0.1, gradient clip 1.0. Linear layers trained with FP8 matmuls (torchao) on bf16 weights; gradient checkpointing.
  • Stopped at step 175 of 400, in the constant phase of the schedule, so the learning rate was still 5e-7.
HyperparameterValue
Questions × attempts per step16 × 8
Steps run / planned175 / 400
Training temperature1.0
Seed0 (one run)
Training-time peak GPU memory32.6 GiB

Training progress

Quick checkpoints on 96 held-out dev questions (32 per dataset, 1 sample, temperature 0.7, so noisy), then the full evaluation:

Step0 (base)255075100125150175final (600 questions)
NDCG0.4550.5040.6180.5860.6580.6600.6720.6620.684

Evaluation

Setup. 600 held-out dev questions (200 per dataset) searched over the full 578,747-paragraph collection, temperature 0.7, context cap 8,192 tokens, at most 6 turns. "1 sample" is the first attempt; "4 samples fused" combines the four attempts' lists with reciprocal rank fusion and keeps the top 20. Metrics are computed on the reported list of at most 20 ids. The two baselines use the question itself as the query and take the top 10.

SystemNDCGRecallPrecisionF1
Qwen3-4B (base), 1 sample0.4550.4130.5110.436
Qwen3-4B (base), 4 samples fused0.6040.5980.5130.517
sid1-qwen3-4b, 1 sample0.6840.6990.3560.461
sid1-qwen3-4b, 4 samples fused0.7290.7810.2370.355
Vector search only, top 100.5790.602n/an/a
BM25 only, top 100.508n/an/an/a

Behaviour on the same questions:

Basesid1-qwen3-4b
Well-formed tool calls94.9%99.9%
Ends with a report86.3%99.9%
Turns per question2.64.1
Tool calls per turn0.961.52
Generated tokens per question1,4371,510

The vector-search rows retrieve 10 documents and the agent reports up to 20, so precision is not comparable across those rows; NDCG and recall are the fairer comparison. Per-dataset numbers are in the MLflow run linked below.

Comparison with other agentic-search models

Other open-weight search agents report results on live-web benchmarks. sid1-qwen3-4b has no number on these, and its retrieval scores above cannot be put next to them. The table below is copied from the XYZ-Aquila-mini model card (open-weight systems under 40B parameters); we did not run any of these models. -- means not reported, and † marks values that card's authors reproduced under their own common setup. DeepSearchQA is F1, WideSearch is Item F1 Max@4, and the rest are accuracy, in percent.

BenchmarkXYZ-Aquila-miniAgents-A1Nex-N2-miniapodex-miniMiroThinker 1.7 minisid1-qwen3-4b (ours)
BrowseComp78.875.574.171.567.9n/a
BrowseComp-ZH82.9--79.6†80.6--n/a
DeepSearchQA89.5--87.2†82.2--n/a
GAIA97.196.0----80.3n/a
LiveBrowseComp48.729.6†41.4†32.8†34.9†n/a
HLE51.147.637.1†46.836.4n/a
WideSearch80.8--62.0--73.3†n/a

Why "n/a". Those systems search the live web, run code, read whole pages within up to 256K tokens of context, and are graded on the final answer. sid1-qwen3-4b searches a fixed collection of short paragraphs, works within 8K tokens, never calls read, never writes an answer, and is graded on the documents it reports. It is one component of such a system, not a replacement for one. XYZ-Aquila-mini is post-trained from a 35B-parameter mixture-of-experts model (3B active), and the others differ in size, tools and training, so the table says nothing about which recipe is better.

What we can measure. BrowseComp-Plus is the BrowseComp question set over a fixed corpus of 100,195 web pages (averaging 5,000 words), with human-labelled evidence pages (needed to answer, about 6 per question) and gold pages (contain the answer, about 3), so retrieval can be scored without a live web. benchmarks/sid1_bench_bcp.ipynb is a self-contained Colab notebook that runs this model, the base Qwen3-4B, and vector and BM25 baselines on it with the metrics of the two published tables below. Our rows are pending: the notebook has not been run yet. Expect low numbers, because the model was trained on short Wikipedia paragraphs, never opens pages, and our index keeps only the first 1,500 characters of each page (6,000 for BM25).

Published retrievers, from the BrowseComp-Plus leaderboard (retriever_results.csv; the full question is the query, one search):

Retriever (whole question as the query)Evidence nDCG@10Evidence Recall@5Gold nDCG@10Gold Recall@5
BM250.0160.0120.0170.014
Qwen3-Embedding-0.6B0.0800.0620.0740.085
Qwen3-Embedding-4B0.1410.0980.1360.130
Qwen3-Embedding-8B0.2030.1450.1950.185
ReasonIR-8B0.1680.1220.1550.153
sid1-qwen3-4b, first 10 reported ids (ours)pendingpendingpendingpending

Our row is not like for like: an agent searches several times and reports a list, while these retrievers answer one query. We score its first 10 reported ids.

Published open-weight agents, from the same leaderboard (agent_results.csv; open-weight models with the default scaffold and the Qwen3-Embedding-8B retriever, top 5 results with 512-token previews per search). Accuracy is graded on the final answer; Recall is the fraction of evidence pages returned by at least one search call.

Open-weight agent (Qwen3-Embed-8B retriever)Parameters (B)Accuracy (%)Recall (%)Search calls
Qwen3-32B3210.727.800.94
SearchR1-32B3211.0810.171.69
oss-20b-low2014.1017.371.87
oss-20b-medium2030.4841.3113.64
oss-20b-high2035.0649.2923.87
oss-120b-low12025.5422.502.21
oss-120b-medium12038.5543.459.64
oss-120b-high12044.1052.6318.35
kimi-k2-0711-preview100035.4238.3811.22
DeepSeek-R1-052868516.3916.322.72
WebSailor-32B3227.5929.308.00
Tongyi-DeepResearch-30B-A3B3044.4662.3230.37
GLM-4.635748.1957.7225.6
GLM-4.735850.1868.6935.32
SearchAgent-Zero837.9550.8738.47
sid1-qwen3-4b (ours)4n/a: it does not answerpending (see note)pending

Our "Recall" will be the same quantity (evidence pages returned by at least one search call) but with top-4 results and 160-character excerpts, a smaller context (8K) and at most 6 turns, over our own truncated index. Treat it as an indication, not a leaderboard entry.

Environmental impact

Hardware1 × NVIDIA RTX PRO 6000 Blackwell Server Edition (96 GB)
Wall-clockabout 9.0 hours for the whole run, including the base, 25-step and final evaluations
PlatformGoogle Colab
Carbon emittednot measured

Technical specifications

  • Architecture: Qwen3 dense decoder, 36 layers, tied input and output embeddings, 8 key-value heads, head dimension 128.
  • Software: torch 2.14.0, vLLM 0.34.0 (rollouts), torchao 0.18.0 (FP8), transformers 5.22, bm25s 0.3.16, MLflow 3.18.0.
  • Metrics and curves: the run rl-20261120-0500 in the sid1-qwen3-4b-agentic-search experiment on DagsHub MLflow.

Citation

@misc{sid1_qwen3_4b_2026,
  title        = {sid1-qwen3-4b: a search agent trained with reinforcement learning},
  author       = {masterofaudio2077},
  year         = {2026},
  howpublished = {\url{https://huggingface.co/masterofaudio2077/sid1-qwen3-4b}}
}

Method: the SID-1 technical report. Base model: Qwen3.

Model card contact

Open a discussion on this repository.

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
Qwen3ForCausalLM
Ревизия весов
23a6dbf

0 моделей