Text Generation
Transformers
Safetensors
English
querylm_nanochat
custom_code

Standard 400M (DCLM-Edu), base model

The plain-text baseline for Kausp11/querylm-dclm-400m: a 400M-parameter language model with the same architecture, trained from scratch on DCLM-Edu web text without search blocks, for the same compute. QueryLM is trained on text with inline search blocks (a query followed by a retrieved passage), which makes its training sequences longer; this model spends the same compute on more plain text instead. Use the two together to measure what search-augmented pretraining changes.

This is the base model (pretraining only). The chat fine-tuned version is Kausp11/standard-dclm-400m-sft-search.

Stage base model (pretraining only; no chat format)
Paired model Kausp11/querylm-dclm-400m (same architecture and compute, pretrained with search blocks)
Architecture nanochat-style decoder: 14 layers, width 1,280, 10 heads, feed-forward 5,120, head dim 128, context 4,095 tokens
Parameters 401.2M reported (842.2M stored, including value embeddings)
Loads with transformers + trust_remote_code=True (the repo ships modeling_nanochat.py)

How to use

A text-continuation model. It was not trained to search: the four search tokens are in its vocabulary (same tokenizer as QueryLM) but it never saw them in training.

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

repo = "Kausp11/standard-dclm-400m"
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()

# Base model: it continues text. Few-shot examples set the question-answer format.
prompt = ("Question: Who wrote the novel Pride and Prejudice?\nAnswer: Jane Austen\n\n"
          "Question: What is the chemical symbol for gold?\nAnswer: Au\n\n"
          "Question: What is the capital of Australia?\nAnswer:")
x = tok(prompt, add_special_tokens=False, return_tensors="pt")
with torch.no_grad():
    out = model.generate(**x, max_new_tokens=16, do_sample=False, pad_token_id=tok.eos_token_id)
print("answer:", tok.decode(out[0, x.input_ids.shape[1]:], skip_special_tokens=True).split("\n")[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):

answer: Canberra

Tokenizer: the SmolLM2 tokenizer plus the four search tokens used by QueryLM (vocabulary 49,156).

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.

Training procedure

Pretraining optimizer Muon for matrix weights (peak LR 0.02828), AdamW for embeddings and output head
Batch 256 sequences x 4,095 tokens = 1,048,320 tokens per update
Schedule 40 warmup steps, constant, then linear decay to 5% of peak at the end
Pretraining budget 10,100 updates; 10.6B tokens; 3.09e19 FLOPs; bf16 compute. Same number of updates and FLOPs as the paired QueryLM model

Provenance

Checkpoint run dclm_nc_baseline_d14_allcm_chin10k, step 10,100. The run branches at step 9,000 from a longer 400M run and decays the learning rate over steps 9,000 to 10,100; the schedule is finished
Initialised from scratch
Code nanochat (upstream commit 92d63d4) with a local search-data branch
model.safetensors sha256 b32623029bff7648a3eafb62b81af121818b9a9e91b7d255cc10e2760852b3cf

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.
  • Base model: it continues text and has no chat format.
  • English web text only; no safety or refusal training of any kind. It will state false things fluently.
  • Loading executes Python from this repository (modeling_nanochat.py). Read it or pin a revision.

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).

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}
}
Downloads last month
50
Safetensors
Model size
0.8B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Kausp11/standard-dclm-400m

Finetunes
1 model

Dataset used to train Kausp11/standard-dclm-400m

Collection including Kausp11/standard-dclm-400m

Paper for Kausp11/standard-dclm-400m