/ Модель

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

Контекст
8 192 токена
Размер весов
5,2 ГБ
Лицензия
Apache 2.0
Архитектура
querylm_nanochat · dense
Базовая модель
standard-dclm-1.4b
Библиотека
transformers
Опубликована
20 ноя 2026

standard-dclm-1.4b-sft-search

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

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

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

Англоязычная модель на 1,4 млрд параметров для генерации текста и экспериментов с внешним поиском, дообученная на диалогах с поисковыми блоками.

Kausp11/standard-dclm-1.4b-sft-search — англоязычная модель генерации текста, разработанная на основе Kausp11/standard-dclm-1.4b и дообученная авторами на диалоговых данных с примерами поисковых блоков. Это контрольная модель для исследования поиска, подключаемого во время генерации: модель формирует запрос, внешний ретривер находит фрагмент, а затем модель продолжает ответ с учётом переданного текста. Архитектура — плотный декодер NanochatForCausalLM с 24 слоями; контекст — 4 095 токенов. Модель принимает и выдаёт текст, включая специальный формат поисковых блоков; поиск выполняет вызывающая система, а не сама модель.

Модель дообучена в течение одной эпохи примерно на 53 тысячах диалогов, около 21% которых содержат поисковые блоки. Она предназначена для экспериментального изучения поисково-расширенной генерации и не является универсальным помощником. В README отмечены отсутствие обучения безопасности и отказам, склонность уверенно сообщать неверные сведения и зависимость ответов от текста, добавленного ретривером. Лицензия репозитория — Apache-2.0.

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

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

Ограничения

Это исследовательская контрольная модель, а не универсальный помощник; она не обучалась безопасности и отказам и может уверенно выдавать ложные сведения. Результат зависит от переданного ретривером текста, а встроенного поиска нет.

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

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

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

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

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

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

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

Открыть на Hugging Face

Standard 1.4B (DCLM-Edu), search fine-tuned

The plain-text baseline Kausp11/standard-dclm-1.4b after the same one-epoch chat fine-tuning as QueryLM, on the same data. It is the comparison model for Kausp11/querylm-dclm-1.4b-sft-search. The base model never saw a search block during pretraining; it meets search blocks for the first time in this fine-tuning.

Stagebase model + search fine-tuning; fine-tuned from Kausp11/standard-dclm-1.4b
Paired modelKausp11/querylm-dclm-1.4b-sft-search (same architecture and compute, pretrained with search blocks)
Architecturenanochat-style decoder: 24 layers, width 2,048, 16 heads, feed-forward 8,192, head dim 128, context 4,095 tokens
Parameters1,409.6M reported (2,619.1M stored, including value embeddings)
Loads withtransformers + trust_remote_code=True (the repo ships modeling_nanochat.py)

How to use

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/standard-dclm-1.4b-sft-search"
tok = AutoTokenizer.from_pretrained(repo)
# trust_remote_code runs modeling_nanochat.py from this repo; pin `revision=` to a commit you have read.
model = AutoModelForCausalLM.from_pretrained(repo, trust_remote_code=True, 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-20 on the files in this repo):

query : Australia capital city located in
answer: The capital of Australia is Canberra.

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: …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 model writes the query; the caller supplies the passage.

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.

Training data

Pretraining: DCLM-Edu as plain text: more document text than the paired QueryLM model saw, so that both use the same compute. No search blocks, no annotation.

Fine-tuning: the same data as the paired QueryLM model, Kausp11/querylm-search-sft-data: about 53,000 user-assistant conversations, 21% of which carry search blocks at the start of a sentence in the assistant turns.

Training procedure

Pretraining optimizerMuon for matrix weights (peak LR 0.02828), AdamW for embeddings and output head
Batch256 sequences x 4,095 tokens = 1,048,320 tokens per update
Schedule40 warmup steps, constant, then linear decay to 5% of peak at the end
Pretraining budget41,936 updates; 44.0B tokens; 4.51e20 FLOPs; bf16 compute. Same number of updates and FLOPs as the paired QueryLM model
Fine-tuningresumes from the pretraining checkpoint with its optimizer state; 33 updates of 256 sequences (one epoch); learning rates 0.8x the pretraining peaks, constant for the first half, then linear to zero; identical to the paired QueryLM model

Provenance

Checkpointrun sftnc_v4cannsent_baseline_d24_cm44, update 33 of 33 (finished)
Initialised fromKausp11/standard-dclm-1.4b (weights and optimizer state)
Codenanochat (upstream commit 92d63d4) with a local search-data branch
model-00001-of-00002.safetensors sha2568b640fc3bf320af9e73a35abc7185f462e58bfe2d841ec5f344164e39457b756
model-00002-of-00002.safetensors sha2560ca8b231dcc12c07c8e812348dcb483961829bba1dca4e0c76cfde76296c0f5e
Also published asKausp11/searchlm-dclm_nc-sftnc_v4cannsent_baseline_d24_cm44 (identical weights, earlier name)

Evaluation

Evaluation results will be added later.

Intended use and limitations

  • A research artifact: the control model for studying search-augmented 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 web text only; no safety or refusal training of any kind. It will state false things fluently.
  • Passages are inserted verbatim into the context: whatever the retriever returns, the model conditions on. The retrieval source is the caller's choice and responsibility.
  • Loading executes Python from this repository (modeling_nanochat.py). Read it or pin a revision.

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). modeling_nanochat.py is adapted from nanochat, MIT License, Copyright (c) 2025 Andrej Karpathy (text in LICENSE-nanochat). Training text: DCLM-Edu (CC-BY-4.0). The fine-tuning data contains passages 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

Нельзя запустить

Модели нужен код из репозитория; запуск откроется после проверки совместимости.

Класс архитектуры
NanochatForCausalLM
Ревизия весов
eb72231

0 моделей