Search From the Start
Search-Native Pretraining for Language Models

Overview

Many factual details in a training corpus cannot be inferred from general patterns and must be memorized. This is especially challenging for smaller models. Search offers another way to access that information, using external sources that can change without retraining the model.

Language models are usually taught to use search after pretraining. We instead augment ordinary pretraining documents with inline search calls and retrieved evidence. The resulting models, QueryLM, learn when to search, what to search for, and how to use the results to continue the document.

We train models from 360M to 3.3B parameters on Wikipedia and DCLM-Edu, with over 100B tokens in the augmented DCLM-Edu corpus. QueryLM improves on search-based question answering and follows supplied evidence more readily; the advantage persists after fine-tuning.

Method

We insert search queries and retrieved evidence into ordinary training documents. Each query uses only the preceding text. The model learns to generate the query and continue the original document, with the retrieved response available as context.

At Racetrack Playa, stones leave trails stretching over 100 meters, propelled by wind-driven, millimeter-thin ice.

Simplified excerpts from the paper, not live searches.

Three-stage pipeline: insert queries and evidence into documents, train with response tokens masked, then generate queries to an external search tool at inference.
Documents are augmented with search calls; training supervises text and queries while masking responses. At inference, a search tool returns evidence and generation continues.
Annotation and training details

The original document remains the prediction target. The inserted queries demonstrate how to ask for missing information, while the retrieved text supplies context for the continuation. Because each query is written from the preceding text alone, it does not get to look ahead at the answer.

Choose when and what to search.

We fine-tune a small annotator on teacher-generated examples. It scores candidate insertion points in a causal pass through each document, then writes queries from the text preceding the selected positions.

Keep useful evidence.

Queries are run against a local BM25 index over Sphere web documents. We select relevant sentences and filter responses by their overlap with the original continuation, using this overlap as a proxy for usefulness.

Learn the call and continuation.

The next-token objective supervises document text and queries. Retrieved responses remain visible as context but are masked from the loss, so the model is not directly trained to reproduce the search engine’s output.

Results

We compare QueryLM with standard models trained on the same documents without search augmentation, with pretraining compute matched.

QueryLM performs better on search-based QA, retains an advantage after fine-tuning, and follows counterfactual evidence more readily. Select a result category to explore the comparisons.

Three panels comparing QueryLM and Standard at 400M, 1.4B and 3.3B: base QA, QA after standard SFT, and counterfactual evidence following after search SFT. QueryLM is higher across these comparisons.
QueryLMCompute-matched StandardQA averages cover eight tasks. External models in the first panel are evaluated without search; QueryLM uses search. Select the figure to enlarge.Swipe across the plots to see all panels.

A targeted improvement.

Base QueryLM is slightly below the baseline on general benchmarks. After search fine-tuning, the models are broadly comparable, with mixed results across tasks.

Less augmentation can still help.

Shorter responses and fewer search blocks reduce training overhead while retaining useful search ability. The ablations examine this performance–cost trade-off.

Models and data

Hugging Face collection

The collection includes QueryLM checkpoints, compute-matched Standard baselines, augmented training corpora, and the search annotator. Use base checkpoints to study what is learned during pretraining, or Search SFT checkpoints to examine the models after search-augmented fine-tuning. The filters below keep each QueryLM checkpoint beside its corresponding baseline.

Model checkpoints

Wikipedia and DCLM-Edu models, from 360M to 3.3B parameters. Base and search fine-tuned checkpoints are paired with their Standard baselines.

Browse the model collection

Training data

Documents with inline search queries and evidence, plus the search fine-tuning conversations.

Search annotator

The Gemma 4 E4B LoRA adapter used to identify search insertion points and write queries.

Get the annotator

Find a checkpoint

Showing 8 checkpoint pairs.

BibTeX

Preprint, November 2026. arXiv:2611.26809.

BibTeX
@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}
}