Morphing-Based Compression for Data-Centric ML Pipelines

Sebastian Baunsgaard, Matthias Boehm

TL;DR

BWARE is a holistic compression framework that "pushes" lossless compression through the entire machine learning pipeline, from raw data loading to feature engineering and model training. By introducing a novel "morphing" technique, it allows data to be transformed and re-organized into workload-optimized compressed formats without ever undergoing expensive full decompression, reducing execution times from days to hours.

What Problem Does This Paper Address?

Modern machine learning is increasingly "data-centric," meaning a huge portion of the workload is spent on iterative pre-processing: data cleaning, augmentation, and feature engineering (like one-hot encoding or binning).

While these steps are essential for model accuracy, they are computationally expensive and create massive amounts of data redundancy. For example, one-hot encoding a single categorical column creates many new, perfectly correlated binary columns. Existing matrix compression techniques usually try to "rediscover" this redundancy after the data has been transformed, which is slow and memory-intensive. The authors identify a gap: current systems treat data pre-processing and compressed linear algebra as separate stages, missing the opportunity to use the "structural knowledge" of the transformations to keep data compressed from the very start.

Methods

The authors introduce BWARE, an extension of the AWARE framework. Its core components include:

  • Compressed Frames (CFrame): Unlike standard data frames, CFrames use Dense Dictionary Compression (DDC) per column. This allows the system to handle heterogeneous data (strings, ints, floats) in a compressed state immediately upon ingestion.
  • Compressed Feature Transformations: BWARE performs operations like binning, recoding, and one-hot encoding directly on the compressed representation. For instance, one-hot encoding a compressed column becomes an $O(1)$ operation that simply re-points metadata rather than an $O(N)$ operation that allocates a massive new sparse matrix.
  • Morphing: This is the paper’s standout contribution. Morphing is a lightweight technique to change the underlying compressed format (e.g., merging two DDC columns into a "co-coded" group) to optimize for specific upcoming operations (like matrix-vector multiplication). It reuses existing index structures to avoid decompression.
  • Workload-Aware Compilation: An optimizing compiler analyzes the ML script at compile-time to inject "morph" instructions exactly where they will provide the most benefit, based on the predicted downstream operations.

Datasets

The authors evaluated BWARE using a diverse set of real-world and synthetic datasets commonly used in ML benchmarks:

  • Tabular/Classification: Adult, CatInDat (Cat), Criteo (up to 10^9 rows), Santander, HomeCredit.
  • Regression: Crypto, KDD98, Salaries.
  • NLP/Word Embeddings: AMiner V16 (abstracts from 4 million papers).

Key Insights and Ideas

  • Redundancy as an Asset: Instead of viewing feature engineering as a source of "bloat," BWARE treats it as a source of predictable redundancy. If the system knows a transformation created perfectly correlated columns, it doesn't have to spend CPU cycles searching for those correlations later.
  • Metadata-Only Operations: Many common ML pre-processing steps can be reduced to simple dictionary manipulations. By operating on the dictionary (which is small) rather than the rows (which are many), the complexity of feature engineering scales with the number of distinct values rather than the number of rows.
  • The Power of Morphing: Data layouts that are good for storage (like independent columns) aren't always good for linear algebra (which often prefers co-coded column groups). Morphing provides a "bridge" that allows the system to adapt the data layout dynamically as it moves through the pipeline.

Key Results

  • End-to-End Speedups: In a full data-centric pipeline (grid search over transformations and polynomials), BWARE reduced execution time on the KDD98 dataset by 1.8x compared to AWARE and significantly more compared to uncompressed baselines.
  • Scalability: On the massive Criteo dataset, BWARE was 11x faster than uncompressed systems at 10^8 rows.
  • Memory Efficiency: BWARE’s compressed frames achieved in-memory size reductions of 19x to 65x compared to raw string representations.
  • Word Embeddings: For NLP tasks, BWARE outperformed both TensorFlow 2.15 and uncompressed SystemDS, especially as the number of unique tokens (vocabulary size) increased.
  • Real-World Impact: The authors note that BWARE can reduce the execution time for training complex pipelines from "days to hours."

Limitations and Future Work

  • Dictionary Dependency: The current implementation of BWARE relies heavily on dictionary-based compression. While effective for categorical and low-cardinality data, it may be less beneficial for high-precision, unique floating-point data (though the authors use lossy quantization to mitigate this).
  • Transformation Scope: The paper focuses primarily on tabular and text transformations. The authors suggest that future work should extend these techniques to image data augmentation (e.g., rotations, flips) and specialized hardware accelerators.
  • Algorithm Support: While it covers major linear algebra operations, expanding the library of "compression-aware" kernels for more niche ML algorithms remains an ongoing task.

Summary updated

BibTeX
@article{baunsgaard2025morphing,
  author = {Sebastian Baunsgaard and Matthias Boehm},
  title = {{Morphing-Based Compression for Data-Centric ML Pipelines}},
  journal = {Proceedings of the VLDB Endowment},
  year = {2025},
  doi = {10.14778/3778092.3778104},
}
Figure