Abstract
The rapidly growing demand for high-quality data in Large Language Models (LLMs) has intensified the need for scalable, reliable, and semantically rich data preparation pipelines. However, current practices remain dominated by ad-hoc scripts and loosely specified workflows, which lack principled abstractions, hinder reproducibility, and offer limited support for model-in-the-loop data generation. To address these challenges, we present DataFlow, a unified and extensible LLM-driven data preparation framework. DataFlow is designed with system-level abstractions that enable modular, reusable, and composable data transformations, and provides a PyTorch-style pipeline construction API for building debuggable and optimizable dataflows. The framework consists of nearly 200 reusable operators and six domain-general pipelines spanning text, mathematical reasoning, code, Text-to-SQL, agentic RAG, and large-scale knowledge extraction. To further improve usability, we introduce DataFlow-Agent, which automatically translates natural-language specifications into executable pipelines via operator synthesis, pipeline planning, and iterative verification. Across six representative use cases, DataFlow consistently improves downstream LLM performance. Our math, code, and text pipelines outperform curated human datasets and specialized synthetic baselines, achieving up to +3% execution accuracy in Text-to-SQL over SynSQL, +7% average improvements on code benchmarks, and 1–3 point gains on MATH, GSM8K, and AIME. Moreover, a unified 10K-sample dataset produced by DataFlow enables base models to surpass counterparts trained on 1M Infinity-Instruct data. These results demonstrate that DataFlow provides a practical and high-performance substrate for reliable, reproducible, and scalable LLM data preparation, and establishes a system-level foundation for future data-centric AI development.
Introduction
In the era of "Data-Centric AI," the performance of Large Language Models (LLMs) is increasingly dictated by data quality rather than just model size. However, the process of preparing this data remains fragmented and largely unstandardized. Most researchers rely on a "spaghetti code" of ad-hoc scripts and loosely defined workflows that are difficult to reproduce, scale, or extend.
Existing tools like NeMo Curator or Data-Juicer excel at cleaning and filtering massive web crawls, but they are not primarily designed for the modern "model-in-the-loop" era. Today’s high-performance data is not just found; it is synthesized, evaluated, and iteratively refined by LLMs themselves. DataFlow addresses this gap by providing a system-level foundation for this new paradigm, shifting the focus from simple filtering to LLM-driven synthesis and refinement.
The DataFlow Framework
DataFlow is built on four architectural pillars designed to standardize data preparation into a repeatable engineering process:
- System-Level Abstractions: The framework utilizes a global tabular storage layer and a unified LLM serving API (supporting engines like vLLM and SGLang). This decouples the logic of data transformation from the underlying hardware and storage plumbing.
- PyTorch-like Programming Interface: Adopting a familiar
run()andforward()syntax, DataFlow allows developers to build "Dataflows" as modular, debuggable, and optimizable pipelines, similar to how PyTorch handles neural networks. - Standardized Operator Zoo: The framework includes nearly 200 reusable operators categorized into four functional types: Generate (adding data), Evaluate (scoring data), Filter (removing low-quality samples), and Refine (editing existing samples).
- DataFlow-Agent: This agentic orchestration layer, built on LangGraph, allows users to provide natural-language specifications. The agent then automatically synthesizes, plans, and debugs the necessary pipeline, lowering the barrier to entry for complex data tasks.
Experimental Results
The paper validates DataFlow across six domain-general pipelines, including Text, Math, Code, Text-to-SQL, Agentic RAG, and Knowledge Extraction.
Performance Gains
- Math & Code: DataFlow pipelines yielded 1–3 point gains on MATH and GSM8K benchmarks and a +7% average improvement on code benchmarks compared to specialized synthetic baselines.
- Text-to-SQL: The framework achieved a +3% execution accuracy boost over SynSQL while requiring significantly less training data.
- Knowledge Extraction: In medical QA tasks, DataFlow-generated data provided absolute accuracy gains of 15–20% over zero-shot and RAG-based baselines.
The Efficiency of High-Quality Data
A striking insight from the study is that 10K high-quality samples can outperform 1M mediocre ones. Models trained on the DataFlow-Instruct-10K dataset—produced entirely through the framework—outperformed counterparts trained on 1,000,000 samples from the Infinity-Instruct dataset. This demonstrates that DataFlow effectively turns data preparation into an optimization loop where quality is prioritized over sheer volume.
Conclusion and Future Work
DataFlow establishes a practical substrate for reliable and scalable LLM data preparation. While the DataFlow-Agent demonstrates strong alignment with user intent (scoring 0.80), challenges remain in consistent code implementation (scoring 0.49), which the authors aim to address in future iterations. Future development will also expand the ecosystem to include new modalities (Table, Graph, Multimodal) and specialized variants for science and industry applications.
Summary updated