Back to articles

Teaching Language Models to Search During Pretraining

3 min read

Language models are increasingly given access to search at inference time. But in the usual pipeline, the model first learns to predict text during pretraining; tool use is added later through post-training. Search-Native Pretraining explores a different sequence: teach models to search while they are still acquiring their foundational language-modeling behavior.

What the approach changes

The researchers start with ordinary text corpora and augment them with synthetic web-search queries. They run those queries against a local search index, then train on the resulting material. The model learns not only to predict text, but also to produce search calls and incorporate retrieved responses into its language modeling. The resulting search-pretrained models are called QueryLM.

The experiments use Wikipedia and DCLM-Edu data and cover model sizes from 360 million to 3.3 billion parameters. The authors report improved performance on knowledge-intensive tasks, as well as greater steerability toward retrieved evidence: responses are more responsive to the material returned by search. One notable comparison is that a 1.4B QueryLM consistently matches or outperforms a FLOP-matched 3.3B conventional baseline across the knowledge-intensive tasks tested. This is a result for the paper’s evaluated settings, not evidence that a smaller model will be better in every application.

The team also applies supervised fine-tuning to both search-pretrained and conventionally pretrained models. The QueryLM advantage remains afterward. The authors interpret this as evidence that the tested post-training procedures do not fully recreate capabilities developed during pretraining. In other words, when a model learns to search may matter, not just whether a search tool is available later.

Why it matters—and what remains open

The broader idea is to treat search as a learned behavior rather than an accessory attached only at deployment. A model that has practiced moving from a query to retrieved evidence and then to a response may be better prepared to use retrieval systems for questions that depend on specific knowledge. This offers an alternative to relying only on larger parameter counts or trying to teach tool use entirely after pretraining.

The evidence should still be read within its limits. The supplied summary does not provide task-level scores, and it does not establish how results change with different indexes, data quality, or query-generation methods. Search also cannot guarantee a sound answer if the returned pages are irrelevant or unreliable. The authors say they are releasing training data and model checkpoints, which should make further evaluation possible.

Hugging Face Daily Papers

Comments

Checking sign-in status...

Loading comments...

Related articles