DataFlow Documentation

repository·main·Indexed 27 days ago

https://github.com/opendcai/dataflow

A modern data-centric AI system for Large Language Models designed to generate, clean, and prepare high-quality training data. It features an operator-based pipeline architecture, a visual WebUI for pipeline construction, and a high-performance orchestration layer called RayOrch. The system includes specialized pipelines for text, reasoning, Text2SQL, and knowledge base cleaning, as well as CLI tools for managing 'pdf2model' and 'text2model' workflows.

Tokens
4.8K
Snippets
13
Records
30
Agent score
93%

What's inside DataFlow

  1. Overview of DataFlow-Instruct-10K Dataset

    main

    DataFlow-Instruct-10K is a unified multi-domain instruction dataset generated using the DataFlow framework. It is constructed through automated data preparation pipelines covering mathematical reasoning, code, and general text instructions.

    Each pipeline follows a “generate-evaluate-filter-refine” workflow to synthesize high-quality "instruction-response" pairs. The dataset contains approximately 10K samples designed to enable base models to achieve performance levels comparable to full-scale instruction-tuned models with significantly fewer training samples.

  2. Overview of DataFlow

    main

    DataFlow is a data preparation and training system designed to generate, refine, evaluate, and filter high-quality AI data from noisy sources such as PDFs, plain text, and low-quality QA pairs. It is used to improve Large Language Model (LLM) performance in specialized domains like medical, finance, legal, and academic research through targeted training (pre-training, SFT, RL) or RAG systems.

    Key capabilities include:

    • Data Synthesis & Cleaning: Generating text, math, and code data, as well as structured data extraction (e.g., PDF to QA).
    • Flexible Orchestration: A plugin-based design using an operator-based architecture to build reproducible and reusable pipelines.
    • Data-Centric AI: Encapsulating data governance algorithms as pipelines to allow for reproducible research and easy swapping of underlying LLMs to analyze the relationship between model performance and data quality.
  3. Available DataFlow Pipelines

    main

    DataFlow includes several ready-to-use pipelines for different data tasks:

    • Text Pipeline: Mines Q&A pairs from large-scale raw text for SFT and RL training.
    • Reasoning Pipeline: Enhances existing Q&A pairs with Chain-of-Thought (CoT), category labeling, and difficulty estimation.
    • Text2SQL Pipeline: Converts natural language questions into SQL queries with explanations and CoT reasoning.
    • Knowledge Base Cleaning Pipeline: Extracts and organizes knowledge from unstructured sources (Tables, PDF, Word) for RAG or QA generation.
    • Agentic RAG Pipeline: Mines Q&A pairs that require external knowledge to answer, used for training Agentic RAG models.
  4. DataFlow Pipeline Types and Experimental Results

    main

    DataFlow supports several specialized pipelines for different data tasks, as demonstrated by the following experimental categories:

    • Text Pipelines: Includes Pre-training Data Filtering (e.g., filtering SlimPajama-627B) and SFT (Supervised Fine-Tuning) Data Filtering & Synthesis (using Condor Generator and Condor Refiner).
    • Mathematical Pipelines: Focused on reasoning tasks (e.g., GSM8K, AIME, Olympiad).
    • Code Pipelines: Produces refined code instruction datasets (e.g., DataFlow-Code-1K, DataFlow-Code-5K, DataFlow-Code-10K) from sources like Ling-Coder-SFT.
    • Dialogue Synthesis Pipelines: Generates conversational datasets (e.g., DataFlow-Chat-15K).
    • Reasoning Pipelines: Uses high-quality seed sets (like NuminaMath) to build reasoning datasets (e.g., DataFlow-Reasoning-10K).
  5. Explore the DataFlow Suite components

    main

    The DataFlow ecosystem consists of four integrated layers:

    • DataFlow-Skills: A collection of skills and tutorials for operator development, pipeline construction, and best practices.
    • DataFlow-WebUI: A visual and AI Agent-assisted workspace for building, managing, and running pipelines via drag-and-drop and natural language.
    • DataFlow-Ecosystem: A modular distribution layer that standardizes operator registration, allowing domain-specific modules (like DataFlow-MM or DataFlow-AI4S) to contribute libraries.
    • RayOrch: A high-performance orchestration layer built on Ray, providing distributed compute scheduling and resource management for massive-scale data tasks.
  6. DataFlow Pipeline Capabilities

    main

    The DataFlow framework provides several specialized pipelines for data processing and synthesis:

    • Text Pipeline: Includes pre-training data filtering (e.g., for SlimPajama corpora) and SFT (Supervised Fine-Tuning) data filtering and synthesis using the Condor Generator and Condor Refiner pipelines.
    • Math Benchmarks/Pipelines: Specialized workflows for mathematical reasoning data.
    • Code Pipeline: Curates code instruction datasets (e.g., DataFlow-Code-1K, DataFlow-Code-5K, DataFlow-Code-10K) from sources like Ling-Coder-SFT.
    • Conversation Synthesis Pipeline: Generates conversational datasets like DataFlow-Chat-15K.
    • Reasoning Pipeline: Constructs reasoning-focused datasets like DataFlow-Reasoning-10K using seed datasets like NuminaMath.
  7. Available Ready-to-Use Pipelines

    main

    DataFlow provides several pre-configured pipelines for common data tasks:

    • Text Pipeline: Mines question-answer pairs from large-scale plain-text data for SFT and RL training.
    • Reasoning Pipeline: Enhances QA pairs with extended chain-of-thought, category classification, and difficulty estimation.
    • Text2SQL Pipeline: Translates natural language questions into SQL queries with explanations and reasoning.
    • Knowledge Base Cleaning Pipeline: Extracts and structures knowledge from tables, PDFs, and Word documents for RAG or QA generation.
    • Agentic RAG Pipeline: Identifies and extracts QA pairs from existing datasets that require external knowledge.
    • DataFlow Agent: An intelligent assistant that performs data analysis, writes custom operators, and orchestrates pipelines automatically.
  8. Create a DataFlow extension repository

    main
    If you want to build new features or extensions for the DataFlow ecosystem, you can create an extension repository using the DataFlow-CLI. Detailed guidance for this process is available in the official documentation.
  9. Install DataFlow using Docker

    main

    For easy deployment, you can use a pre-built Docker image or build your own from the provided Dockerfile. The Docker image includes CUDA 12.4.1 and vLLM pre-installed. Ensure you have the NVIDIA Container Toolkit installed for GPU support.

    Option 1: Use Pre-built Docker Image

    # Pull the pre-built image
    docker pull molyheci/dataflow:cu124
    
    # Run the container with GPU support
    docker run --gpus all -it molyheci/dataflow:cu124

    Option 2: Build from Dockerfile

    # Clone the repository
    git clone https://github.com/OpenDCAI/DataFlow.git
    cd DataFlow
    
    # Build the Docker image
    docker build -t dataflow:custom .
    
    # Run the container
    docker run --gpus all -it dataflow:custom
    docker pull molyheci/dataflow:cu124