Topic Over Source: The Key to Effective Data Mixing for Language Models Pre-training
Not on the map. Why?
Abstract (arXiv)
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.
Key facts. Cited by 4 papers in the map (data through 7 Oct 2026). Builds on 19 of its 29 references that are in the map. First posted on arXiv 24 Feb 2025.
Builds on
19 of 29 references.
References · 19
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2024The Llama 3 Herd of Modelscited by 14,192
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
- 2018Think you have Solved Question Answering? Try ARC, the AI2 Reasoning Challengecited by 4,710
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
- 2019PIQA: Reasoning about Physical Commonsense in Natural Languagecited by 2,818
- 2017Billion-scale similarity search with GPUscited by 2,477
- 2018Can a Suit of Armor Conduct Electricity? A New Dataset for Open Book Question Answeringcited by 2,114
- 2021Scaling Language Models: Methods, Analysis & Insights from Training Gophercited by 1,199
- 2024The FineWeb Datasets: Decanting the Web for the Finest Text Data at Scalecited by 1,104
- 2017RACE: Large-scale ReAding Comprehension Dataset From Examinationscited by 851
- 2023A Pretrainer's Guide to Training Data: Measuring the Effects of Data Age, Domain Coverage, Quality, & Toxicitycited by 180
7 more
- 2024RegMix: Data Mixture as Regression for Language Model Pre-trainingcited by 172
- 2023DoGE: Domain Reweighting with Generalization Estimationcited by 87
- 2025Organize the Web: Constructing Domains Enhances Pre-Training Data Curationcited by 73
- 2015MLlib: Machine Learning in Apache Sparkcited by 55
- 2024Large Language Models Offer an Alternative to the Traditional Approach of Topic Modellingcited by 35
- 2024Data, Data Everywhere: A Guide for Pretraining Dataset Constructioncited by 11
- 2024Addressing Topic Granularity and Hallucination in Large Language Models for Topic Modellingcited by 7
Built on by
Citing papers per year: 2025: 1; 2026: 3.
4 papers.
- 2026GEM: Geometric Entropy Mixing for Optimal LLM Data Curationcited by 1
- 2025topicwizard -- a Modern, Model-agnostic Framework for Topic Model Visualization and Interpretationcited by 0
- 2026HERMES: A Multi-Granularity Labeling Substrate for Pre-training Data Mixturescited by 0
- 2026Curriculum Learning as Transport: Understanding Curricula with Wasserstein Geodesicscited by 0
- 2026Curriculum Learning as Transport: Understanding Curricula with Wasserstein Geodesics8 Sep 2026
- 2026HERMES: A Multi-Granularity Labeling Substrate for Pre-training Data Mixtures2 Jul 2026
- 2026GEM: Geometric Entropy Mixing for Optimal LLM Data Curation27 Apr 2026
- 2025topicwizard -- a Modern, Model-agnostic Framework for Topic Model Visualization and Interpretation19 May 2025