TL;DR
This paper introduces Data-Prep-Kit (DPK), an open-source toolkit designed to simplify and scale data preparation for Large Language Model (LLM) development. DPK offers a flexible, extensible, and user-friendly platform that allows users to prepare data from their local machines to large clusters, supporting both natural language and code data.
What Problem Does This Paper Address?
Developing LLMs is heavily reliant on high-quality data, yet data preparation remains a significant bottleneck. This process is often complex, time-consuming, and compute-intensive, especially with the ever-increasing scale of datasets. Existing tools may lack flexibility, extensibility, or the ability to scale efficiently across different computational environments. Furthermore, the iterative nature of data and model debugging, coupled with the need for specialized software engineering skills for industrial LLM projects, amplifies these challenges. This paper aims to bridge this gap by providing a unified, scalable, and accessible solution for data preparation.
Methods
DPK is built around a three-component architecture: Data Access, Transformation, and Runtime.
- Data Access: This component provides a standardized framework for identifying, selecting, reading, and writing data across various storage mechanisms (local file systems, S3-compatible storage). It supports checkpointing to resume interrupted processing, minimizing rework.
- Transformation: DPK defines a flexible transformation system with base classes like
AbstractBinaryTransformandAbstractTableTransform. These allow for various data transformations (1:1, 1:N, N:1, N:M) and can be extended to handle specific file types. Transforms are configured via dictionaries, making them adaptable. - Runtime: DPK offers multiple runtime implementations (Pure Python, Ray, Spark) that enable users to execute data preparation pipelines on diverse compute facilities, from a single laptop to large Kubernetes clusters. This abstraction layer allows users to leverage distributed computing frameworks without deep expertise.
A key innovation is the extendibility of DPK. Users can easily create new transforms by extending the provided base classes, and the toolkit abstracts away the complexities of Ray and Spark. Additionally, DPK integrates with Kubeflow Pipelines (KFP) for automation, enabling no-code pipeline execution and management, which is crucial for reproducibility and scalability.
Datasets
The paper mentions that modules from DPK have been used for the preparation of Granite Models [1] [2]. For experimental evaluation, they used common crawl snapshots and datasets of varying sizes, including those reaching terabytes.
Key Insights and Ideas
- Unified Data Preparation: DPK provides a consistent interface for data preparation across different modalities (natural language and code) and computational environments.
- Scalability is Paramount: The toolkit is designed from the ground up to scale from a local machine to thousands of CPU cores, addressing the massive data requirements of LLMs.
- Extensibility for Customization: The ease with which users can create and integrate their own transforms is a core strength, allowing for tailored data preparation pipelines.
- Automation via KFP: Leveraging Kubeflow Pipelines significantly simplifies the deployment and management of data preparation workflows, making them accessible to a wider range of users.
- Persona-Agnostic Design: DPK aims to be usable by data scientists, data engineers, and application developers, abstracting away complex distributed computing details.
Key Results
- Performance Consistency: DPK maintains high performance across diverse settings, from small-scale experiments on a single node to large-scale clusters.
- Scalability Demonstrated: Experiments showed that DPK transforms perform well in low-resource environments and scale effectively with increased resources. For instance, execution time per terabyte of data saw an average of ~40% reduction when CPU cores doubled.
- Transform Complexity Impact: The complexity of transform logic directly influences execution time, with I/O-bound transforms showing less impact on scalability compared to those requiring model inference.
- Robustness: DPK demonstrated consistent performance in facilitating data removal (e.g., Exact and Fuzzy Dedup) regardless of input data size or available resources.
Limitations and Future Work
- Future Plans: The authors plan to expand DPK's capabilities by supporting new data modalities, additional scalable runtimes, and more readily usable transforms.
- Implicit Limitation: While DPK aims to abstract away complexity, users still need to understand the underlying concepts of data preparation and the specific transforms they are using. The "sleep time" for the noop transform in the single-node experiments suggests that default configurations might require tuning.
Summary updated