NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Metadata Conditioning Accelerates Language Model Pre-training

Tianyu Gao, Alexander Wettig, Luxi He, Yihe Dong, Sadhika Malladi, Danqi Chen

Introduction

Modern Large Language Models (LLMs) are typically pre-trained on massive, heterogeneous web crawls. These datasets contain a vast spectrum of content, ranging from high-quality academic papers to low-quality forum posts. Standard pre-training treats all documents as equivalent samples, which ignores the inherent context provided by the source. This lack of context leads to learning inefficiencies, as the model must learn diverse styles and quality levels simultaneously without a prior signal.

Methodology: Metadata Conditioning then Cooldown (MeCo)

To address these challenges, researchers introduced MeCo (Metadata Conditioning then Cooldown). MeCo is a simple, zero-overhead pre-training strategy that leverages source metadata to improve learning efficiency.

Overview of MeCo vs. Standard Pre-training. MeCo prepends source URLs during the first 90% of training, followed by a 10% "cooldown" phase without metadata. This approach achieves comparable accuracy with 33% fewer training tokens.

The MeCo process consists of two distinct stages:

  1. Metadata Conditioning (First 90%): The model is fed a prefix containing the document's source URL domain (e.g., URL: en.wikipedia.org). The model is trained to predict tokens within the document text only, not the metadata prefix itself.
  2. Cooldown (Final 10%): To ensure the model remains general-purpose and functional when metadata is absent, the final phase of training uses standard text without prefixes.

At inference time, MeCo enables "Conditional Inference." Users can either provide no metadata for standard use or prepend specific URLs to "steer" the model toward desired behaviors, such as improved factuality or reduced toxicity.

Key Results and Scalability

The primary advantage of MeCo is its significant data efficiency. Experimental results on a 1.6B parameter model show that MeCo matches the performance of standard pre-training while requiring 33% less data (160B tokens vs. 240B tokens).

Average performance across 10 tasks for various model sizes. MeCo consistently outperforms standard pre-training from 600M to 8B parameters.

Furthermore, the benefits of MeCo scale effectively with model size. As shown in the evaluation across the OLMES suite (averaging 10 diverse tasks), MeCo consistently provides performance gains over standard baselines for models ranging from 600M to 8B parameters. Notably, the performance gap often widens as the model size increases, with a +1.0 gain observed at the 1.6B scale.

Discussion: The Power of Grouping

A key finding of the study is the "Grouping Hypothesis." The researchers discovered that replacing real URLs with random hashed strings yielded similar performance gains. This suggests that the model does not necessarily need to understand the semantic meaning of a source (like "Wikipedia"); rather, it benefits from knowing which documents belong to the same group, allowing it to learn source-specific patterns more efficiently.

Additionally, MeCo provides a unique mechanism for steerability. Prepending "fake" but semantically suggestive URLs (e.g., factquizmaster.com) can improve zero-shot reasoning, while prepending wikipedia.org can reduce the toxicity of generated text by shifting the model into a more formal, encyclopedic mode.

Conclusion

MeCo represents a highly efficient, zero-overhead tweak to the standard pre-training pipeline. By simply prepending metadata and including a short cooldown phase, models can be trained significantly faster while gaining new capabilities for inference-time steering. While future work is needed to explore multilingual settings and downstream instruction tuning, MeCo demonstrates that structural awareness of training data is a powerful lever for LLM optimization.

Summary updated

BibTeX
@inproceedings{gao2025metadata,
  author = {Tianyu Gao and Alexander Wettig and Luxi He and Yihe Dong and Sadhika Malladi and Danqi Chen},
  title = {{Metadata Conditioning Accelerates Language Model Pre-training}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=DdMMzlI5YE},
}
Figure