Skip to content

DataFlex is a data-centric training framework that enhances model performance by either selecting the most influential samples, optimizing their weights, or adjusting their mixing ratios.

Notifications You must be signed in to change notification settings

OpenDCAI/DataFlex

Repository files navigation

DataFlex

Documents Ask DeepWiki

🎉 If you like our project, please give us a star ⭐ on GitHub for the latest update.

简体中文 | English

📰 1. News

  • [2025-12-23] 🎉 We’re excited to announce the first Data-Centric Training System DataFlex, is now released! Stay tuned for future updates.

🔍 2. Overview

DataFlex is an advanced dynamic training framework built on top of LLaMA-Factory.
It intelligently schedules data during training, supporting dynamic sample selection, domain ratio adjustment, and dynamic weighting, aiming to improve both training efficiency and final model performance.

DataFlex integrates seamlessly with LlamaFactory, offering researchers and developers more flexible and powerful training control, for goals and design philosophy, please refer to Dataflex-Doc.

  • Dynamic Select Trainer: Dynamically selects training samples according to a given strategy (e.g., focus on “hard” samples). The data selection algorithms are summarized as follows:
Method Category Requires Model-in-the-Loop?
LESS Gradient-Based ✅ Yes
NICE Gradient-Based ✅ Yes
Loss Loss-Based ✅ Yes
Delta Loss Loss-Based ✅ Yes
NEAR Data Distribution-Based ❌ No
TSDS Data Distribution-Based ❌ No
Static No Selection ❌ No
Random Random Sampling ❌ No
  • Dynamic Mix Trainer: Dynamically adjusts the ratio of data from different domains during training. The data mixture algorithms are summarized as follows:
Method Category Requires Model-in-the-Loop?
DOREMI Offline Mixture ✅ Yes
ODM Online Mixture ✅ Yes
  • Dynamic Weight Trainer: Dynamically adjusts sample weights during backpropagation to emphasize data preferred by the model. The data reweighting algorithms are summarized as follows:
Method Category Requires Model-in-the-Loop?
Loss Reweighting Loss-Based ✅ Yes
  • Full compatibility with LlamaFactory, drop-in replacement.

📌 3. Quick Start

Please use the following commands for environment setup and installation👇

git clone https://github.com/OpenDCAI/DataFlex.git
cd DataFlex
pip install -e .
pip install llamafactory==0.9.3

The launch command is similar to LLaMA-Factory. Below is an example using LESS :

FORCE_TORCHRUN=1 DISABLE_VERSION_CHECK=1 dataflex-cli train examples/train_lora/selectors/less.yaml

Unlike vanilla LlamaFactory, your .yaml config file must also include DataFlex-specific parameters, for details please refer to DataFlex-Doc.

📚 4. Experimental Results

Using DataFlex can improve performance over the default LLaMA-Factory training.

Data Selector & Reweightor Results

We use a subset of Open-Hermes-2.5 as the training dataset. The data selection algorithms and data reweighting algorithm outperform the random selector baseline on the MMLU benchmark subset relevant to the training dataset. For the Less and Nice algorithm, we set the validation set as the MMLU-Validation-Set, using a GPT-5-generated trajectory.

Data Mixture Results

We use a subset of SlimPajama-627B for data mixture。The data mixture algorithm also outperforms baselines (default data mixture) on the MMLU benchmark.

Dataset Baseline DoReMi ODM
MMLU 25.27 25.84 26.04

🤝 5. Acknowledgements

We thank LLaMA-Factory for offering an efficient and user-friendly framework for large model fine-tuning, which greatly facilitated rapid iteration in our training and experimentation workflows.
Our gratitude extends to all contributors in the open-source community—their efforts collectively drive the development of DataFlex.

🤝 6. Community & Support

We welcome contributions of new trainers and selectors! Please ensure code formatting is consistent with the existing style before submitting a PR.

We also welcome you to join the DataFlex and DataFlow open-source community to ask questions, share ideas, and collaborate with other developers!

• 📮 GitHub Issues: Report bugs or suggest features

• 🔧 GitHub Pull Requests: Contribute code improvements

• 💬 Join our community groups to connect with us and other contributors!

About

DataFlex is a data-centric training framework that enhances model performance by either selecting the most influential samples, optimizing their weights, or adjusting their mixing ratios.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 9

Languages