/ Модель

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

Контекст
8 192 токена
Параметры
362 млн
Лицензия
Apache 2.0
Архитектура
llama · dense
Базовая модель
querylm-wiki-360m
Библиотека
transformers
Опубликована
19 ноя 2026

querylm-wiki-360m-sft-search

Генерация текстаТекст → текст3 профессии
120скачиваний за 30 дней0лайковвеса обновлены23 ноя 2026

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

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

Англоязычная модель на 361,8 млн параметров для диалоговой генерации текста и изучения поиска с внешним ретривером.

QueryLM 360M (Wikipedia), search fine-tuned — англоязычная языковая модель Kausp11 для генерации текста и экспериментов с поиском через внешний ретривер. Это плотная авторегрессионная модель семейства Llama с архитектурой LlamaForCausalLM и 361,8 млн параметров; она дообучена за одну эпоху на диалогах пользователя и ассистента, часть которых содержит блоки поиска. Метаданные указывают контекст до 8192 токенов, а README описывает обучение и упаковку данных в последовательности длиной 4096 токенов.

Модель может вести диалог в текстовом формате с префиксами System, User и Assistant. Для поиска она генерирует запрос в специальном блоке, после чего вызывающая система должна выполнить поиск, вставить найденный фрагмент в контекст и продолжить генерацию. Модель не генерирует текст найденных фрагментов сама. Обучение включало английскую Википедию и около 53 тысяч диалогов; модель рассчитана прежде всего на англоязычный энциклопедический текст и исследование взаимодействия генерации с ретривером.

Модель небольшая и слаба за пределами энциклопедических текстов; автор сообщает, что она уступает моделям DCLM-Edu в ответах на вопросы. Оценки качества пока не приведены. Модель не проходила обучение безопасности и может уверенно сообщать ложные сведения; результат поиска зависит от внешнего ретривера и переданных им фрагментов. Лицензия репозитория — 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.

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

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

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

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

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

Открыть на Hugging Face

QueryLM 360M (Wikipedia), search fine-tuned

The chat version of QueryLM 360M: fine-tuned for one epoch from the base model Kausp11/querylm-wiki-360m on user-assistant conversations, part of which contain search blocks. QueryLM is a language model pretrained from scratch on text with inline search blocks (a search query followed by a retrieved passage), so it writes queries and reads passages as part of ordinary text generation.

Stagebase model + search fine-tuning; fine-tuned from Kausp11/querylm-wiki-360m
ArchitectureSmolLM2-360M configuration (32 layers, width 960, 15 heads), trained from scratch; context 4,096 tokens
Parameters361.8M
Loads withplain transformers (LlamaForCausalLM); no custom code

How to use

The model can be used without search like any causal language model. To let it search: open a search block, let it write the query, run your own retriever, insert the result, and let it continue.

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

repo = "Kausp11/querylm-wiki-360m-sft-search"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, torch_dtype=torch.bfloat16).eval()

Q_OPEN, Q_CLOSE = tok.convert_tokens_to_ids("<WEB_QUERY>"), tok.convert_tokens_to_ids("</WEB_QUERY>")

def my_search(query: str) -> str:
    """Replace with your retriever (BM25 index, web search API, ...). Return one short passage."""
    return "Canberra is the capital city of Australia. It was founded in 1913 and is the country's largest inland city."

@torch.no_grad()
def generate(text, max_new_tokens, stop_id=None, allow_search=True):
    x = tok(text, add_special_tokens=False, return_tensors="pt")
    kw = {} if allow_search else {"bad_words_ids": [[Q_OPEN]]}
    out = model.generate(**x, max_new_tokens=max_new_tokens, do_sample=False,
                         eos_token_id=stop_id, pad_token_id=tok.eos_token_id, **kw)
    return tok.decode(out[0, x.input_ids.shape[1]:], skip_special_tokens=True)

# Chat format is plain text: "User: ...\n\nAssistant: ". There is no chat template.
prompt = "User: What is the capital of Australia?\n\nAssistant: "

query = generate(prompt + "<WEB_QUERY>", max_new_tokens=24, stop_id=Q_CLOSE).strip()            # 1) the model writes the query
block = f"<WEB_QUERY>{query}</WEB_QUERY> <WEB_RESPONSE>{my_search(query)}</WEB_RESPONSE>"        # 2) you retrieve and insert the block
answer = generate(prompt + block, max_new_tokens=64, allow_search=False)                         # 3) the model answers
print("query :", query)
print("answer:", answer.split("\n\nUser:")[0].strip())

Output of this exact script (CPU, bfloat16, torch 2.8.0, transformers 4.56.0, run 2026-11-19 on the files in this repo):

query : Australia capital city name
answer: Canberra is the capital city of Australia. It is the largest city in Australia, and the capital of the Australian Capital Territory. Canberra is the capital of the Australian Capital Territory, and the capital of the Northern Territory. Canberra is the capital of the Northern Territory, and the capital of the Australian Capital Territory.

The passage here is a fixed example string; the output shows the mechanics, not the model's accuracy.

Search-block format

Tokenid
<WEB_QUERY>49152
</WEB_QUERY>49153
<WEB_RESPONSE>49154
</WEB_RESPONSE>49155

Layout in the training text: …text<WEB_QUERY>query</WEB_QUERY> <WEB_RESPONSE>passage</WEB_RESPONSE> text continues…. The tokenizer is the SmolLM2 tokenizer plus these four tokens (vocabulary 49,156). The loss covered the text, the query and the query tags; the response tags and the passage carried no loss, so the model does not generate passages. The caller supplies them.

Chat format: plain text with System:, User: and Assistant: prefixes, turns separated by a blank line. There is no chat template, so apply_chat_template does not apply. A search goes at the start of the assistant turn or at the start of a sentence.

Training data

Pretraining: English Wikipedia, 4,885,877 articles (54,582 further articles held out for evaluation), annotated with search blocks by a fine-tuned annotator model (Gemma 4 E4B-it with a LoRA adapter). The annotator marks positions where a search would help (insertion probability at least 0.05, at least 40 characters apart) and writes a query of at most 24 tokens for each. Passages come from BM25 retrieval over the public Sphere web corpus and are shortened by extractive cleaning. An insertion is kept only if the passage overlaps the text that follows it in the document (ROUGE-1 F1 of at least 0.1 against the next 260 characters).

Fine-tuning: about 53,000 user-assistant conversations. About 64% teach general chat skills (SmolTalk subsets) and 15% tool calling (SmolTalk2 subsets), without search. The remaining 21% are SmolTalk conversations whose assistant turns were annotated with search blocks by the same pipeline as the pretraining text, each block moved to the start of the sentence it was placed in (38,436 blocks in 9,713 conversations). 35.2M tokens, packed into 4,096-token sequences; loss on assistant text, queries and end of turn.

Training procedure

Pretraining optimizerAdamW, peak LR 5e-4, weight decay 0.1
Batch256 sequences x 4,096 tokens = 1,048,576 tokens per update
Schedule2% warmup, cosine decay to zero; 4 epochs
Pretraining budget31,860 updates; 33.4B tokens processed, of which 16.0B document tokens; 6.31e19 FLOPs; bf16 compute
Fine-tuningfresh AdamW, peak LR 2e-5, 3% warmup, cosine decay; 134 updates of 64 sequences (one epoch)

Provenance

Checkpointrun sft_v4cannsent_wiki360_v1, update 134 of 134 (finished)
Initialised fromKausp11/querylm-wiki-360m (weights)
CodeHugging Face Trainer causal-LM script
model.safetensors sha25688212ffbe3e6f5b353fb8d3658210d11adda5c005c0f97d96ffee45222d20aa2
Also published asKausp11/searchlm-sft_v4cannsent_wiki360_v1 (identical weights, earlier name)

Evaluation

Evaluation results will be added later.

Intended use and limitations

  • A research artifact for studying models that learn to search during pretraining. Not a product.
  • Fine-tuned for one epoch on a small chat mixture. It follows the plain-text chat format above and is not a general-purpose assistant.
  • English Wikipedia text only; no safety or refusal training of any kind. It will state false things fluently.
  • It searches usefully only when the caller runs the loop above. Passages are inserted verbatim into the context: whatever the retriever returns, the model conditions on, including wrong or adversarial text. The retrieval source is the caller's choice and responsibility.
  • A small model trained on Wikipedia only: weak outside encyclopedic text, and weaker than the DCLM-Edu models at question answering.

Built with Llama

Built with Llama. The fine-tuning data was selected with the help of Llama 3.1 8B (base), used as a yes/no classifier that decides which candidate conversations are kept for search annotation (none of its text enters the data), and it contains SmolTalk conversations generated with Llama 3.1 models (5,452 from smol-magpie-ultra, generated with Llama-3.1-405B-Instruct, and 907 from everyday-conversations, generated with Llama-3.1-70B-Instruct). Llama 3.1 is licensed under the Llama 3.1 Community License, Copyright © Meta Platforms, Inc. All Rights Reserved. License: https://www.llama.com/llama3_1/license/ ; Acceptable Use Policy: https://www.llama.com/llama3_1/use-policy/

License

Apache-2.0 (licence text in LICENSE). Training text: English Wikipedia (CC BY-SA 4.0). Retrieved passages used as masked context during pretraining come from Sphere (CC BY-NC 4.0); they are not part of this repo.

Citation

Paper: Search From the Start: Search-Native Pretraining for Language Models · Project page: https://kaustubhp11.github.io/querylm/

@article{ponkshe2026searchfromthestart,
  title   = {Search From the Start: Search-Native Pretraining for Language Models},
  author  = {Ponkshe, Kaustubh and Je, Gyung Hyun and Taga, Stefan and Raffel, Colin and Jaggi, Martin},
  journal = {arXiv preprint arXiv:2611.26809},
  year    = {2026}
}

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
LlamaForCausalLM
Ревизия весов
2dc729a

0 моделей