Attention Based Machine Learning Methods for Data Reduction with Guaranteed Error Bounds

Xiao Li, Jaemoon Lee, Anand Rangarajan, Sanjay RankaarXiv 2024

TL;DR

This paper introduces a novel hierarchical machine learning framework for scientific data compression that combines self-attention autoencoders with a PCA-based post-processing step. By capturing both long-range spatiotemporal and short-range inter-variable correlations, the method achieves up to an 8× higher compression ratio than state-of-the-art tools like SZ3 while mathematically guaranteeing user-defined error bounds.

What Problem Does This Paper Address?

Modern scientific simulations—such as those in climate science, quantum plasma physics, and turbulent combustion—generate massive multi-dimensional datasets at extreme velocities. Storing and transferring these terabyte-scale datasets has become a massive bottleneck.

While lossy data compression is essential to tackle this challenge, scientific applications demand two strict properties that traditional machine learning compressors fail to provide:

  1. Guaranteed Error Bounds: Scientists cannot trust compressed data if the reconstruction error deviates unpredictably from the ground truth. Most neural network-based compressors lack strict error-bounding mechanisms.
  2. Complex Correlation Capture: Scientific data often consists of multi-dimensional meshes where each grid point contains a tensor of tightly coupled variables (e.g., dozens of chemical species concentrations). Compressors must efficiently exploit both long-range spatiotemporal patterns and short-range inter-variable relationships.

Methods

The authors propose a coarse-to-fine hierarchical framework that breaks data down into hyper-blocks, blocks, and vectors.

Fig. 1: Method Overview: The original data is divided into hyper-blocks. An attention-based autoencoder is employed to capture inter-block correlations within these hyper-blocks. The residual data from the hyper-block Autoencoder is then processed block by block using a block-wise autoencoder for finer reconstruction. Finally, the reconstructed data undergoes a PCA-based method to ensure the error of each data patch is within guaranteed bounds.

The pipeline consists of three main stages:

  1. Hyper-Block Autoencoder (HBAE): Multiple spatiotemporal blocks are grouped into a "hyper-block." The HBAE utilizes a self-attention mechanism to dynamically weigh and capture long-range dependencies across these blocks, compressing them into a shared latent vector.
  2. Block-Wise Residual Autoencoder (BAE): Because the HBAE prioritizes shared global features, it can lose block-specific details. The residual (the difference between the original data and HBAE reconstruction) is passed through a second, simpler block-wise autoencoder (without attention) to capture fine-grained local information.
  3. Error Bound Guarantee (GAE): To enforce strict mathematical error controls, the final residuals undergo Principal Component Analysis (PCA) at the block level. The framework projects the residuals onto a PCA basis matrix and dynamically selects the minimum number of leading coefficients required to bring the $\ell_2$-norm error below a user-specified threshold ($\tau$).

To minimize storage overhead, latent spaces are quantized and Huffman-encoded, while the PCA indices are compressed using a binary sequence prefix method combined with the ZSTD lossless compressor.

Datasets

The framework was evaluated on three distinct scientific simulation datasets:

  • S3D Dataset: A 4D turbulent combustion simulation tracking 58 chemical species over 50 timesteps across a $640 \times 640$ spatial grid.
  • E3SM Dataset: Climate data from the Energy Exascale Earth System Model, specifically evaluating the single sea-level pressure (PSL) variable over a $720 \times 240 \times 1440$ grid.
  • XGC Dataset: A gyrokinetic plasma fusion simulation tracking a particle distribution function (F-data) across 8 toroidal cross-sections and $16,395$ mesh nodes.

Key Insights and Ideas

  • Hybridizing ML with Linear Algebra: Pure neural network approaches struggle with hard constraints like error bounds. By treating the neural network as a coarse/fine feature extractor and using PCA as a deterministic "clean-up" step for the remaining residual, the authors achieve the best of both worlds: high compression ratios and strict mathematical guarantees.
  • Strategic Attention Placement: Self-attention has a quadratic computational complexity ($O(n^2)$), making it too expensive to apply at a granular pixel or vector level. Restricting self-attention to the high-level hyper-block stage allows the model to capture long-range dependencies efficiently without blowing up the computational budget.
  • Asymmetric Quantization Sensitivity: The ablation studies revealed that the global Hyper-Block Autoencoder (HBAE) is significantly more sensitive to latent space quantization than the local Block-Wise Autoencoder (BAE). Consequently, choosing a tighter quantization bin size for the HBAE is critical to maintaining low reconstruction errors.

Key Results

The proposed method was compared against state-of-the-art scientific compressors, including SZ3 and ZFP, as well as other block-based neural network compressors (GBAE, GAETC).

  • S3D (Multi-variable): Achieved up to an 8× higher compression ratio compared to SZ3 within the Normalized Root Mean Square Error (NRMSE) range of $10^{-3}$ to $10^{-4}$.
  • E3SM & XGC (Single-variable): Demonstrated up to 3× and 2× higher compression ratios, respectively, compared to SZ3 at equivalent error levels.
  • Visual Fidelity: At a fixed compression ratio of approximately 100, the proposed method yielded the lowest NRMSE and noticeably fewer visual distortions in critical regions compared to SZ3 and ZFP.

Limitations and Future Work

  • Training Overhead: The authors note that larger latent dimensions yield better compression performance but result in significantly longer training times and reduced model stability during training.
  • Computational Cost: Due to the quadratic scaling of the self-attention mechanism with sequence length, the hyper-block size must be carefully managed to prevent excessive computational overhead during the initial encoding phase.
  • Future Work: While not explicitly detailed, optimizing the training pipeline for faster convergence and exploring sub-quadratic attention mechanisms could further scale this approach.

Summary updated

BibTeX
@misc{li2024attention,
  author = {Xiao Li and Jaemoon Lee and Anand Rangarajan and Sanjay Ranka},
  title = {{Attention Based Machine Learning Methods for Data Reduction with Guaranteed Error Bounds}},
  year = {2024},
  eprint = {2409.05357},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2409.05357},
}

Loading related content...

Figure