# Topic Over Source: The Key to Effective Data Mixing for Language Models Pre-training

Source: [Topic Over Source: The Key to Effective Data Mixing for Language Models Pre-training](<https://www.sota2.com/research/paper/68fa7a801e209131cea8384f>)

Collection index: [llms.txt](<https://www.sota2.com/research/llms.txt>)

Data updated: 2025-10-27T06:59:41.376Z

Authors: Jiahui Peng, Xinlin Zhuang, Jiantao Qiu, Ren Ma, Jing Yu, He Zhu, Conghui He

Published: 2025-02-24T03:25:56.000Z

## Abstract

The performance of large language models (LLMs) is significantly affected by the quality and composition of their pre-training data, which is inherently diverse, spanning various languages, sources, and topics. Effectively integrating these heterogeneous data groups is crucial for optimizing LLM performance. Previous research has predominantly concentrated on source-based data mixing, often neglecting the nuanced topic-level characteristics of the data. To address this gap, we propose a topic-based data mixing strategy that utilizes detailed topic labels generated through a multi-stage process combining unsupervised clustering, LLM-based summarization, and supervised classifier training. With this strategy, we conduct the first comprehensive comparison of topic-based versus source-based partitioning across multiple mixing strategies. We demonstrate that language models pretrained on data mixed by topics consistently outperform those trained on data mixed by sources across multiple methods including RegMix, DoReMi,temperature-based sampling, and a manual mixing method based on downstream task performance. Our theoretical analysis reveals that topic-based data achieves significantly lower validation loss compared to source-based approaches, creating a better optimization landscape for model training. We will make our code, annotated datasets, and topic classification models publicly available to facilitate further research.

## Recorded benchmark results

A research result applies to its stated dataset, split, metric and evaluation configuration. Compare like-for-like settings, preserve the metric's unit and direction, and distinguish paper-reported results from independent reproduction. The best result recorded here is not a claim of exhaustive, current global coverage.

- [Zero-shot Evaluation on AI2 OLMES zero-shot](<https://www.sota2.com/research/sota/zero-shot-evaluation-on-ai2-olmes-zero-shot.md>): Zero-shot Evaluation; AI2 OLMES zero-shot; ScienceQA: 32.54.

## Original sources and implementation

[Original paper](<https://arxiv.org/abs/2502.16802>)

[PDF](<https://arxiv.org/pdf/2502.16802.pdf>)
