URLs Help, Topics Guide: Understanding Metadata Utility in LLM Training

Dongyang Fan, Vinko Sabolčec, Martin Jaggi

Introduction

Large Language Model (LLM) pretraining typically involves processing massive web-scraped datasets. In standard pipelines, valuable metadata—such as source URLs, timestamps, and topic tags—is discarded, leaving the model to learn from raw text in a "context-free" manner. This paper investigates "Context-Conditioned Pretraining," a method where metadata is preserved and prepended to training documents. The study systematically evaluates which types of metadata provide utility, finding a distinct split: URLs accelerate training and improve accuracy, while human-interpretable tags like topics and quality scores enable superior control during inference.

Methodology

The researchers trained 1.5B parameter language models on 100 billion tokens from the FineWeb-Edu dataset. The core approach involves prepending metadata to each document, wrapped in special <boc> (beginning of context) and <eoc> (end of context) tokens.

Figure 1: Data format for Context-Conditioned Pretraining, showing metadata prepended to document text using special tokens.

To ensure the model uses metadata as an auxiliary hint rather than a prediction target, the authors employed a masked loss strategy where the model is not penalized for failing to predict the metadata tokens themselves. Furthermore, to maintain the model's ability to function without metadata (standard zero-shot use), the training data consisted of a 90/10 mixture of context-prepended and standard context-free text.

Pretraining Efficiency

A key finding of the study is that not all metadata types are equally beneficial for training speed. While it might be intuitive that human-readable labels like "Topic: Science" or "Quality Score: 5" would help the model organize information, the results show otherwise.

Figure 5: Training perplexity across different metadata types. Only URLs significantly lower perplexity compared to the standard baseline.

As shown in Figure 5, only the inclusion of raw URLs consistently lowered training perplexity. Explicit labels like Quality Scores (QS) or Domain Information (DI) did not provide a speedup. The authors hypothesize that human-assigned labels may conflict with the latent clusters the model naturally discovers through URLs. Interestingly, combining URLs with other tags actually degraded performance compared to using URLs alone, suggesting that "more metadata" is not always better.

Downstream Performance and the Few-Shot Effect

The efficiency gains in pretraining translate to significant real-world benefits. The URL-conditioned model achieved the same average performance across nine downstream tasks at 60 billion tokens that a standard model required 100 billion tokens to reach—a 40% training speedup.

However, these benefits are context-dependent. In 0-shot evaluations, the performance gap between standard and context-conditioned models is negligible. The advantages only emerge in few-shot settings (e.g., 5-shot), where the model has enough prompt context to "activate" the latent semantic associations it learned from URLs during pretraining. In 5-shot tests, the URL-conditioned model achieved 47.8% average accuracy compared to 46.7% for the baseline.

Controllable Inference via Topic Guidance

While Topic and Format metadata did not accelerate pretraining, they proved highly effective for steering model output at inference time. By applying Classifier-Free Guidance (CFG)—a technique borrowed from image generation that mathematically amplifies the difference between context-conditioned and context-free distributions—the researchers could force the model to adopt specific personas or formats with high reliability.

For example, when prompted for medical information, a model guided by "Topic: Health" metadata produced responses that were significantly more coherent and relevant (scoring 9.07/10 by GPT-4o) than the standard model (7.75/10). This suggests that while some metadata helps the model learn faster, other metadata helps the user control the model better.

Conclusion and Limitations

This research provides a nuanced view of metadata utility in LLM training. URLs act as powerful latent anchors that speed up learning, while topic tags serve as effective control knobs for generation. Future work is needed to verify these findings at larger scales (70B+ parameters) and to explore the safety implications of such highly steerable models, as malicious metadata could potentially be used to guide models toward harmful outputs.

Summary updated

BibTeX
@inproceedings{fan2025urls,
  author = {Dongyang Fan and Vinko Sabolčec and Martin Jaggi},
  title = {{URLs Help, Topics Guide: Understanding Metadata Utility in LLM Training}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=NcxmgX95ue},
}
Figure