Search From the Start: Search-Native Pretraining for Language Models
Organizations: EPFL · University of Toronto
Abstract
Modern language models (LMs) are increasingly deployed with access to search tools at inference. Yet pretraining remains predominantly focused on predicting static text, with search capabilities typically introduced during post-training. We propose Search-Native Pretraining as a practical route to teach search capability during pretraining from ordinary text corpora. Specifically, we augment pretraining corpus at scale with web-search queries and retrieve web response using a local index. Training on this augmented corpus teaches models to generate search calls and incorporate retrieved evidence during language modeling. Across Wikipedia and DCLM-Edu corpora and 360M to 3.3B parameter scales, search-pretrained models ("QueryLM") show improved performance on knowledge-intensive tasks and higher steerability toward the retrieved evidence. Crucially, their advantage persists after supervised fine-tuning of both search-pretrained and conventionally pretrained models, indicating that the tested post-training procedures do not fully recover the capabilities developed during pretraining. Throughout our experiments, we find that a 1.4B QueryLM consistently beats or matches the performance of a FLOP-matched 3.3B baseline model across all knowledge intensive tasks. These results establish search-pretraining as a practical way to develop foundational search capabilities during pretraining. We release the training artifacts, including model checkpoints and data.
Figures & tables
Appendix figures & tables15 assets
Supplementary material from the paper’s appendix.
Appendix
| Corpus | Wikipedia | DCLM-Edu | ||
|---|---|---|---|---|
| Model size | 360M | 400M | 1.4B | 3.3B |
| Layers | 32 | 14 | 24 | 32 |
| Hidden width | 960 | 1,280 | 2,048 | 2,816 |
| Feed-forward width | 2,560 | 5,120 | 8,192 | 11,264 |
| Query / key-value heads | 15 / 5 | 10 / 10 | 16 / 16 | 22 / 22 |
| Head dimension | 64 | 128 | 128 | 128 |
| Setting | Wikipedia | DCLM-Edu |
|---|---|---|
| Optimizer | AdamW | Muon + AdamW |
| Tokens per update | 1,048,576 | 1,048,320 |
| Peak learning rate | 0.02828 (Muon); AdamW rates in text | |
| Warmup | 2% of steps | 40 steps, first segment only |
| Learning-rate decay | Cosine to zero | Linear to 5% of peak |
| AdamW |
| Setting | Wikipedia | DCLM-Edu |
|---|---|---|
| Initialization | Pretrained weights | Pretrained weights and optimizer state |
| Optimizer | AdamW | Muon + AdamW |
| Training length | 1 epoch, 134 updates | 1 epoch, 33 updates |
| Sequences per update | 64 | 256 |
| Tokens per update | 262,144 | 1,048,320 |
| Peak learning rate | pretraining peaks (Muon 0.0226) |
Language Model Pretraining
Language model pretraining teaches models language patterns and knowledge from large text corpora before they are adapted to specific tasks.
See all 485 papers