Source-linked AI summary

BiMix: A Bivariate Data Mixing Law for Language Model Pretraining

Ce Ge, Zhijian Ma, Daoyuan Chen, Yaliang Li, Bolin Ding

arXiv:2405.14908v4cs.LGcs.AIcs.CL

TL;DR

Pretraining data composition affects language-model performance, but existing approaches provide limited systematic understanding of mixed-domain scaling. BIMIX models domain proportions and training volume jointly, and experiments show accurate prediction, effective optimization, and lightweight entropy-based mixture construction. Its conclusions are bounded by the observed proportion and training-volume ranges and by evaluation settings that consistently include domains during training and evaluation.

  • Problem

    Existing methods lack a systematic, efficient framework for understanding how mixed-domain composition affects language-model performance.

    Source: §1 · p. 2, §3 · p. 3
  • Method

    BIMIX jointly models domain proportions and training volume, using the resulting law to predict losses and optimize mixtures; entropy measures provide lightweight proxy proportions.

    Source: §1 · p. 2, §4 · p. 7
  • Results

    BIMIX accurately models joint scaling, generalizes across mixtures, optimizes domain proportions, and outperforms existing methods in the reported experiments.

    Source: §1 · p. 2, §7 · p. 11
  • Takeaways & Limitations

    Entropy-based measures offer an efficient, training-free strategy for constructing practical data mixtures while BIMIX provides interpretable tools for scaling and optimization.

    Source: §7 · p. 11

    Applicability under extreme conditions is not guaranteed because experiments covered domain proportions from 0.0007 to 0.7256 and capped training data at approximately 100B tokens.

    Source: §6 · p. 10

Abstract

from arXiv · show

Large language models have demonstrated remarkable capabilities across various tasks, primarily attributed to the utilization of diversely sourced data. However, the impact of pretraining data composition on model performance remains poorly understood. This paper introduces $\textbf{BiMix}$, a novel bivariate data mixing law that models the joint scaling behavior of domain proportions and data volume in LLM pretraining. $\textbf{BiMix}$ provides a systematic framework for understanding and optimizing data mixtures across diverse domains. Through extensive experiments on two large-scale datasets, we demonstrate $\textbf{BiMix}$'s high accuracy in loss extrapolation (mean relative error < 0.2%) and its generalization to unseen mixtures (R${}^{2}$ > 0.97). Optimization of domain proportions yields superior model performance compared to existing methods. Furthermore, we establish entropy-based measures as efficient proxies for data mixing, offering a computationally lightweight strategy. Our work contributes both theoretical insights into data mixing dynamics and practical tools for enhancing LLM training efficiency, paving the way for more effective scaling strategies in language model development.

1 INTRODUCTION

BIMIX addresses the lack of a systematic framework for understanding how mixed-domain pretraining data affects model performance. It models domain proportions and training volume jointly, achieving accurate prediction and enabling mixture optimization across datasets and training scenarios.

  • Existing data-mixing methods rely on heuristics or computationally expensive optimization and lack a general scaling framework.This limits efficient resource allocation and performance prediction across data compositions.Source: §1 · pp. 1–2
  • BIMIX jointly models domain proportions and training volume to predict and optimize mixed-domain pretraining outcomes.The framework mathematically relates these variables to model performance.Source: §1 · p. 2
  • Experiments on two large-scale datasets show accurate performance prediction across varied mixtures and scaling scenarios.The experiments validate BIMIX across diverse datasets and training settings.Source: §1 · p. 2
  • BIMIX enables domain-proportion optimization that outperforms existing high-cost methods in convergence speed and downstream task performance.Source: §1 · p. 2
  • Entropy measures provide effective proxies for efficient mixture optimization and practical data-mixing guidance.Source: §1 · p. 2

2 RELATED WORK

Prior work studies pretraining mixtures through manual heuristics, predefined configurations, or iterative optimization, while scaling-law research usually models limited variables. BIMIX instead targets scalable, joint modeling of domain composition and data volume across many domains.

  • Manual mixture rules lack universal standards and portability, while iterative methods such as DoReMi and DoGE require considerable computational cost.These approaches optimize domain weights through reference or proxy-model training.Source: §2 · p. 2
  • Entropy proxies offer a training-free alternative that can produce mixtures comparable or superior to existing methods.Source: §2 · p. 2
  • Existing scaling laws primarily model averaged outcomes against individual scaling factors, overlooking domain-specific behavior in heterogeneous corpora.Source: §2 · pp. 2–3
  • BIMIX jointly models domain proportion and data volume with a scalable formulation demonstrated for up to 22 domains.This distinguishes it from approaches whose complexity grows substantially with the number of domains.Source: §2 · p. 3

3 THE PROPOSED BIMIX

BIMIX addresses the dependence between domain proportions and total training volume by modeling domain-specific validation losses as a bivariate scaling system. Disentangled observations motivate a separable, interpretable formulation whose fitted curves track observed loss across both variables.

3 THE PROPOSED BIMIX

  • Existing scaling laws overlook domain-specific predictability, while a domain’s training amount depends jointly on total data volume and its allocated proportion.Changing one proportion under fixed total volume also changes other domains’ allocations.Source: §3 · p. 3

3.1 FORMULATION

  • BIMIX represents validation losses across m domains as functions of each domain proportion and training steps.The formulation uses five fitting coefficients per domain, giving linear complexity in the number of domains rather than quadratic complexity.Source: §3.1 · p. 3

3.2 OBSERVING SCALING BEHAVIORS BY DISENTANGLING VARIABLES

  • Figure 1 compares observed validation losses with Eq. (3) fits as training steps increase at fixed domain proportions, using logarithmic axes.The reported curves closely fit observations and show consistent downward curvature.Source: §3.2 · p. 4, Figure 1 · p. 4
  • At fixed training steps, validation loss varies approximately linearly with domain proportion in logarithmic space, supporting a power-law dependence.Figure 2 visualizes observed points and fitted results for this relationship.Source: §3.2 · p. 5, Figure 2 · p. 5
  • Disentangling the two variables reveals separable scaling effects, which are combined into a mutually modulated bivariate law.Multiplicative shifts across curves motivate the integrated, interpretable formulation.Source: §3.2 · pp. 5–6

4 EXPERIMENTAL SETUP

The experiments use diverse multi-domain datasets, controlled decoder-only transformers, and observations collected across mixtures and training steps. They evaluate BIMIX through domain validation loss, downstream question-answering benchmarks, candidate mixture baselines, and entropy-based proportions.

  • Experiments use the 22-domain Pile and seven-domain SlimPajama datasets, with samples packed and chunked into 1024-token sequences.Source: §4 · p. 6
  • The models are decoder-only transformers based on DoReMi, with 280M-scale and 1B-scale configurations.Both use the GPT-NeoX tokenizer.Source: §4 · p. 6
  • Training runs span up to 200,000 update steps, approximately 100 billion tokens, with evaluations every 5 billion tokens.A single DoReMi round required 670 GPU hours on the stated infrastructure.Source: §4 · p. 6
  • BIMIX fitting uses tuples of domain proportion, training steps, and domain loss, with up to m × n × k observations fitted by Trust Region Reflective optimization.Source: §4 · p. 6
  • Evaluation reports per-domain validation loss and, when needed, one-shot Exact Match on WebQuestions, LAMBADA, and TriviaQA.Source: §4 · pp. 6–7
  • Candidate mixtures include dataset baselines, DoReMi proportions, and entropy-derived alternatives.Source: §4 · p. 7
  • Entropy-based mixtures normalize Shannon, conditional, joint, and von Neumann entropy across domains to produce proportions summing to one.Higher-entropy domains receive greater emphasis, and measurement adds negligible overhead during tokenization.Source: §4 · p. 7

5 RESULTS AND ANALYSIS

BIMIX is evaluated as a framework for extrapolating losses, assessing unseen mixtures, optimizing domain proportions, and using entropy measures to streamline mixture construction.

5.1 EXTRAPOLATING LOSSES ON SCALED-UP DATA

  • Mean relative error remains below 0.2% on both Pile and SlimPajama, while the worst domain error stays below 1.0%.The worst case is reported for the DoReMi mixture on the Pile.Source: §5.1 · p. 7

5.2 ESTIMATING DATA MIXTURES WITHOUT TRAINING

  • BIMIX can evaluate candidate mixtures prospectively from limited mixture-training observations, helping prioritize configurations before costly large-scale training.The fitted law predicts validation losses for mixtures such as Baseline and DoReMi without directly training each candidate.Source: §5.2 · pp. 8–9
  • High mean R2 values indicate that BIMIX generalizes across new data mixtures, with better fit on SlimPajama than on the Pile.The comparison follows the same dataset-level pattern observed in loss extrapolation.Source: §5.2 · p. 9, Table 2 · p. 9

5.3 OPTIMIZING DOMAIN PROPORTIONS FOR IMPROVED PERFORMANCE

  • Optimized mixtures derived from smaller models give performance advantages throughout training for larger models, while RegMix achieves comparable performance on the reported comparison.The method also supplies a mathematical model of mixing behavior rather than only optimized proportions.Source: §5.3 · p. 9, Figure 4 · p. 10

5.4 ENTROPY MEASURES AS EFFICIENT MIXING PROXIES

  • Entropy-driven mixtures achieve lower log-perplexity than the baseline, and conditional entropy consistently performs best among the tested proxies.These measures are used to collect fitting observations and support streamlined initial dataset construction.Source: §5.3 · p. 9, §5.4 · p. 10, Figure 5 · p. 10

6 DISCUSSION AND FUTURE WORK

BIMIX is supported within the studied range, while extreme-scale behavior and generalization to new domains remain open questions. The authors connect the framework to resource-efficient AI and future multimodal extensions.

6 DISCUSSION AND FUTURE WORK

  • BIMIX’s applicability under extreme conditions is not guaranteed because experiments covered domain proportions from 0.0007 to 0.7256 and up to approximately 100B tokens.The study maintains domain inclusion during training and evaluation, while larger-scale predictability is suggested by prior work rather than established here.Source: §6 · p. 10
  • Generalization to new domains depends on the model’s generalization capability and the correlation between new and training domains.The authors identify this extension beyond basic mixing laws as requiring dedicated exploration.Source: §6 · pp. 10–11
  • BIMIX findings can assist computational resource allocation and support more economical and environmentally friendly AI development.The discussion also identifies multimodal data mixing as a future opportunity for improving training efficiency and performance.Source: §6 · p. 11

7 CONCLUSION

BIMIX models the joint scaling of domain proportions and training volume, supports loss extrapolation across mixtures, and enables domain-proportion optimization. Entropy-based measures provide lightweight proxies for data mixing.

7 CONCLUSION

  • BIMIX accurately models the joint scaling behavior of domain proportions and training volume, enabling loss extrapolation and generalization across different mixtures.The conclusion presents this modeling capability as the paper’s central contribution.Source: §7 · p. 11
  • BIMIX optimization of domain proportions outperforms existing methods, while entropy-based measures provide efficient proxies for lightweight data mixing.The conclusion frames these results as practical tools for improving large-scale language-model training efficiency.Source: §7 · p. 11

A ENTROPY PROXIES

The entropy-proxy appendix defines token-level, sequential, conditional, and von Neumann measures for representing domain diversity and predictability. These measures are computed from token statistics or embedding-based similarity structure.

A ENTROPY PROXIES

  • Entropy proxies are computed from tokenized, equal-length domain sequences, while von Neumann entropy uses FastText embeddings and pairwise similarities.The preprocessing records unigram and bigram frequencies for the token-based measures.Source: A ENTROPY PROXIES · p. 15
  • Shannon entropy measures expected information content from token frequencies and serves as an indicator of corpus diversity.For domain Di, P(x) denotes the probability of observing token x.Source: A ENTROPY PROXIES · p. 15
  • Joint entropy measures uncertainty in consecutive token pairs and highlights sequential dependencies within a domain.The joint probability is estimated from observing token x followed by token x′ at adjacent positions.Source: A ENTROPY PROXIES · p. 15
  • Conditional entropy measures surprise when predicting the next token given the current token, capturing text predictability and linguistic structure.It uses P(x′ | x) for the probability of observing x′ at position t + 1 given x at position t.Source: A ENTROPY PROXIES · p. 15
  • Von Neumann entropy extends entropy to embedding-derived density matrices, with eigenvalues representing probability distributions analogous to quantum states.The density matrix is constructed from a positive semidefinite kernel over FastText embedding vectors, and entropy uses its trace and matrix logarithm.Source: A ENTROPY PROXIES · p. 15

B DOWNSTREAM TASK PERFORMANCE

Downstream evaluations compare 1B models trained with varied mixtures on the Pile and SlimPajama datasets. BIMIX mixtures generally perform best across tasks, despite variability on WebQuestions and LAMBADA.

B DOWNSTREAM TASK PERFORMANCE

C COMPLEXITY ANALYSIS

BiMix models validation loss jointly over domain proportions and training steps while requiring substantially fewer fitting coefficients than the composite exponential law. This lower complexity reduces the observations needed for fitting and supports efficient mixture optimization.

C COMPLEXITY ANALYSIS

  • BiMix incorporates both domain proportions and training steps, while the exponential law models domain proportions without training-step variation.Both laws model validation loss for multidomain language modeling.Source: C COMPLEXITY ANALYSIS · p. 17
  • For an individual domain at fixed training steps, BiMix requires two coefficients, compared with m + 2 coefficients for the exponential law.The two BiMix coefficients are a scaling factor and an exponent.Source: C COMPLEXITY ANALYSIS · p. 17
  • Across all m domains, BiMix maintains an order of magnitude fewer coefficients than the competing mixing law.Both methods scale their coefficient requirements with the number of domains, but BiMix remains substantially smaller.Source: C COMPLEXITY ANALYSIS · p. 17
  • Across multiple training-step targets, the exponential law requires (m^2 + 2m)n coefficients, while BiMix shares coefficients across steps and requires 5m for all domains.BiMix needs five coefficients for one domain across different training steps.Source: C COMPLEXITY ANALYSIS · p. 17
  • Fewer coefficients enable BiMix to be fit with potentially two candidate mixtures, whereas the exponential law requires tens of mixtures.The authors connect this reduction to lower computational, economic, and environmental resource use.Source: C COMPLEXITY ANALYSIS · p. 17

D COMPARISION WITH RECENT MIXING LAW

On SlimPajama, BIMIX- and Ye et al.-optimized mixtures both accelerate convergence over the default mixture, while BIMIX additionally improves downstream performance. The section also provides the candidate mixture recipes used for the Pile and SlimPajama evaluations.

D COMPARISION WITH RECENT MIXING LAW

  • The comparison included Ye et al.'s optimal SlimPajama mixture, while the exponential law faces scalability challenges on the 22-domain Pile dataset.The challenge is attributed to the law's previously discussed quadratic complexity.Source: D COMPARISION WITH RECENT MIXING LAW · p. 17
  • BIMIX achieved Baseline-equivalent log-perplexity in 80,000 steps, compared with 160,000 steps for Ye et al.'s optimized mixture.Both optimized mixtures accelerated convergence relative to the default Baseline mixture.Source: D COMPARISION WITH RECENT MIXING LAW · p. 17, Figure 8 · p. 17
  • The BIMIX-optimized mixture showed substantial downstream-task advantages, whereas Ye et al.'s optimized mixture performed comparably to the Baseline.The comparison concerns the 1B model trained on SlimPajama.Source: D COMPARISION WITH RECENT MIXING LAW · p. 18

E MIXTURE RECIPES

Loading 2405.14908v4…