TL;DR
Training large language models (LLMs) isn't just about model architecture—it's also about data-centric training: dynamically selecting, mixing, and reweighting data as the model learns. Until now, every new data-centric algorithm shipped in its own isolated codebase, making fair comparisons nearly impossible. DataFlex solves this by unifying ten representative algorithms under a single, reproducible benchmark and evaluation platform built on LLaMA-Factory, revealing head-to-head insights about what actually works—and why.
What Problem Does This Paper Address?
If you've ever tried to compare two data-centric LLM training methods, you know the pain: one lives in an outdated repository pinned to an old transformers version, another only runs on a single GPU, and a third uses completely different data splits and evaluation metrics. Because of this fragmentation, the community has had no reliable way to tell whether a new method's gains come from a genuinely better algorithm or just lucky engineering quirks.
On top of that, data-centric methods aren't passive data loaders—they need to peek inside the training loop to grab model-dependent signals like sample embeddings, per-sample losses, or full-rank gradients. Scaling those operations to modern distributed setups (like DeepSpeed ZeRO-3, where parameters and gradients are sharded across GPUs) is an engineering headache most research prototypes simply skip. DataFlex tackles both problems at once: standardized benchmarking and scalable system infrastructure.
Methods
DataFlex is designed as a drop-in replacement for the training layer of LLaMA-Factory, meaning researchers can run any integrated method just by appending a short dataflex block to an existing YAML config.
It uses a clean three-layer architecture:
- Base Layer: Inherited from LLaMA-Factory, handling model management, data processing, optimizers, and distributed training (DeepSpeed/FSDP).
- Trainer Layer: Replaces the standard trainer with three unified abstractions:
Select Trainer(picks high-value subsets),Mix Trainer(adjusts domain proportions), andWeight Trainer(modulates per-sample gradient contributions). - Component Layer: Pluggable selectors, mixers, and weighters registered through a centralized interface.
Under this umbrella, DataFlex unifies ten algorithms: six for data selection (LESS, NICE, Loss, Delta Loss, NEAR, TSDS), three for data mixture (DoReMi, ODM, MoE-SFT), and one for data reweighting (Loss Reweight). Notably, the authors extend LESS from an offline method (using a fixed reference model) to an online one that recomputes projected gradients as the model evolves.
To make all of this work at scale, DataFlex introduces system-level primitives—most notably full-rank gradient acquisition under DeepSpeed ZeRO-3—alongside engineering optimizations like cached gradient projections and overlapped dataloader rebuilds.
Datasets
The benchmark spans two major training regimes and several standard evaluation suites:
- Instruction Tuning (Selection & Reweighting): A 100k-example subset of Open-Hermes-2.5, evaluated primarily on MMLU (with larger-scale checks on ARC-C, ARC-E, MATH-500, GSM8K, IFEval, and BBH).
- Pretraining (Data Mixture): SlimPajama at 6B and 30B token scales (preserving natural proportions across CC, C4, GitHub, Book, ArXiv, Wikipedia, and StackExchange), evaluated via MMLU (5-shot) and per-domain log perplexity.
- MoE Fine-Tuning: Four instruction-tuning domains (code, math, ShareGPT, Orca), evaluated on MMLU, BBH, QA, and MBPP.
Key Insights and Ideas
Running everything under identical seeds, splits, and hardware surfaced several patterns no single paper could show on its own:
- Dynamic beats static: Across selection, mixture, and reweighting, dynamic data-centric methods consistently outperformed static full-data training on MMLU in the evaluated settings.
- Offline and online methods are complementary, not strictly ranked: In data selection, offline methods (NEAR, TSDS) were competitive on Mistral-7B but fell roughly 8+ points behind online methods on Llama-3.2-3B. In data mixture, offline DoReMi and online ODM traded blows: at 6B tokens, DoReMi excelled on high-resource domains (CC, C4) while ODM won minority domains (StackExchange, ArXiv, Book). At 30B tokens, ODM achieved the best overall perplexity while DoReMi achieved the highest MMLU.
- Backbone sensitivity matters as much as algorithm choice: The gap between the best dynamic method and the static baseline was 5.8 points on Mistral-7B, but jumped to 13.4 points on Llama-3.2-3B—a spread comparable to the difference between the best and worst dynamic methods.
- Shared infrastructure is a benchmark primitive: The 1–7% equal-resource speedups (and 57% multi-GPU speedup) came from shared system primitives rather than algorithmic tweaks, proving that reproducible benchmarking and scalable deployment are two sides of the same coin.
Key Results
- Data Selection & Reweighting: On Mistral-7B, online LESS hit 0.452 MMLU (+5.8 points over the 0.394 static baseline). On Llama-3.2-3B, Reweight reached 0.453 (+13.4 points over the 0.319 baseline), with LESS (0.450) and Delta Loss (0.434) close behind. Gains also held on larger models: on Qwen3-14B, TSDS improved MATH-500 by 5.60 points over Random, and on Llama-3.1-70B, LESS improved all six evaluated benchmarks.
- Data Mixture: Pretraining Qwen2.5-1.5B on SlimPajama-6B, ODM achieved the highest MMLU (26.04% vs. 25.27% baseline) while DoReMi achieved the lowest overall log perplexity (4.134 vs. 4.217). At 30B tokens, DoReMi led MMLU (25.97% vs. 25.51%) and ODM led log perplexity (3.429 vs. 3.584, winning 6 of 7 domains). These exact orderings replicated on Llama-3.2-3B.
- System Efficiency: DataFlex's re-engineered implementations were consistently faster than the original codebases: single-GPU LESS runtime dropped by 3.72%–7.09% (and 57.13% when scaled to 8×H20 GPUs, from 30,239s to 12,965s); TSDS ran 1–5% faster across scaling regimes; and MoE-SFT ran 4.5% faster (18,919s → 18,062s) with a slightly higher average score (35.15 vs. 34.84).
Limitations and Future Work
The authors are careful to note that while "dynamic > static" held across all their tested setups, it should be viewed as an empirical regularity within these evaluated settings rather than a universal law across every possible training stage or domain. Additionally, Data Reweighting was omitted from the system-efficiency comparison against original codebases simply because no widely adopted reference implementation exists yet. By open-sourcing DataFlex, its configurations, and preprocessing scripts, the authors aim to give the community a living, extensible substrate for future data-centric research.
Summary updated