NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Exact Instance Compression for Convex Empirical Risk Minimization via Color Refinement

Bryan Zhu, Ziang ChenNeurIPS 2026

TL;DR

Training classic machine learning models—like logistic regression or kernel ridge regression—on massive datasets can still bring standard solvers to a crawl. Instead of trading accuracy for speed using approximations, this paper shows how to use an old graph-theory algorithm to spot hidden redundancies in your data and shrink the optimization problem losslessly. You solve a much smaller version of the problem, and mathematically lift the result back to get the exact same optimal model you would have gotten from the full dataset.

What Problem Does This Paper Address?

Empirical Risk Minimization (ERM) is the mathematical backbone of everyday machine learning—think linear models, logistic regression, and kernel methods. Even when these problems are nicely convex (meaning there's one global valley to find, no tricky local minima), standard solvers scale poorly as datasets balloon in samples and features.

Usually, if you want to shrink a dataset before training, you reach for approximate tools like subsampling, coresets, or randomized sketching. Those are great, if you are okay with controlled error. On the exact side, researchers previously figured out how to losslessly compress Linear Programs (LPs) and Quadratic Programs (QPs) by grouping redundant variables together, or by exploiting explicit permutation symmetries. However, general convex ML objectives—like logistic loss, elastic-net penalties, or kernelized losses—aren't simple LPs or QPs, and real-world data rarely has neat, explicit symmetries even when lots of samples or features behave identically. This paper bridges that gap, bringing exact, lossless compression to general differentiable convex ERM.

Methods

The secret sauce here is color refinement (specifically, the Weisfeiler-Leman algorithm), borrowed from graph isomorphism theory.

Imagine representing your data matrix as a bipartite graph: samples are nodes on the left, features are nodes on the right, and matrix entries are weighted edges between them. Color refinement iteratively groups nodes into "colors" based on their connections. It converges on what's called an equitable partition—meaning if you look at the submatrix between any sample color group and any feature color group, the row sums are all identical and the column sums are all identical.

What is novel here is extending this matrix-partitioning trick to general differentiable convex programs via a Reduction Coloring theorem:

  1. Seed and Refine: Depending on the specific ML loss (e.g., logistic or ridge), the authors initialize the colors using label and weight interactions (like grouping features that share the exact same dot product with the target vector $y$), and then run color refinement on the data or kernel matrix—taking $O(\text{nnz}(A)(\log m + \log n))$ time for sparse matrices.
  2. Aggregate: Variables and samples sharing a color behave identically under gradients. So, you collapse each color class into a single representative variable (averaging them) to form a smaller, reduced optimization problem.
  3. Solve and Lift: You train your model on the shrunken dataset, then copy the learned weights back out to all original features sharing that color.

The authors build concrete recipes for linear/polynomial regression, binary and multiclass logistic regression, elastic-net regularization (using Jensen's inequality to handle the non-differentiable $\ell_1$ kink!), and kernel ridge/logistic regression.

Datasets

No new benchmarks were introduced. The authors evaluated their compression on three public datasets via OpenML:

  • Titanic: One-hot encoded categorical features and mean-imputed missing numerical values (for binary logistic regression).
  • MNIST: Pixel values were binarized to preserve spatial sparsity while increasing exact structural redundancies (for multiclass logistic regression).
  • UCI Adult: One-hot encoded and binarized for primal/kernel binary logistic regression (predicting income >$50k) and primal/kernel ridge regression (predicting age; subsampled to 4,000 rows for kernel runs).

Key Insights and Ideas

  • Beyond Strict Symmetry: You don't need two features or samples to be literal clones (permutation symmetry) to merge them. Color refinement captures equivalence under aggregated interactions, yielding strictly stronger compression than symmetry-group methods.
  • Standardize After You Compress: If you run StandardScaler on your raw data first, slight differences in variance will shatter your exact equivalences and ruin the compression. Instead, the authors show how to compress the raw data first, standardize the reduced matrix for numerical stability during training, and algebraically transform the weights back so the final model is still 100% exact.
  • Exact + Approximate = Friends: Exact compression isn't competing with coresets or sketching. Because it strips out pure structural redundancy without losing optimality, you can run this first and apply approximate sketching to the shrunken problem afterward.

Key Results

Across all experiments, predictive performance was identical to training on the unreduced data (up to solver tolerance).

  • Compression: On structured/categorical data like UCI Adult, primal models shrank sample counts down to ~27–30% of the original size, and kernel matrices shrank to ~55–59% in both rows and dimensions. Binarized MNIST saw modest feature reduction (~92% retained) and virtually no sample compression.
  • End-to-End Speedups (Compression + Training Time):
  • Titanic (Logistic): Total runtime dropped to ~20–25% of baseline training time (~4x speedup).
  • Adult (Kernel Ridge & Kernel Logistic): Total runtime dropped to ~78–88% of baseline.
  • When Overhead Bites: On Adult (Primal Ridge), solving the original linear system was already so fast that the C++ color-refinement step blew up total runtime to 687% of baseline! Similarly, Adult (Primal Logistic) hovered just above break-even (~108%).

Limitations and Future Work

  • Exact Means Exact: The method relies on strict equality, not "close enough." On generic, dense, continuous, or noisy data (like raw continuous targets $y$), exact structural redundancy almost never happens, so you'll get zero compression. It shines specifically on sparse, categorical, one-hot, or quantized data.
  • Bespoke Recipes Required: There is no magic, automatic compiler for arbitrary convex losses yet; every new objective family requires deriving custom initialization rules for the coloring.
  • Kernel Bottlenecks: For kernel methods, color refinement requires the kernel matrix $K$ to already be materialized in memory—so while it speeds up the solver, it doesn't save you from the initial $O(n^2)$ memory and compute cost of building $K$. Future work wasn't explicitly laid out, though automating coloring constructions and tackling approximate/noisy regimes are natural open frontiers.

Summary updated

BibTeX
@inproceedings{zhu2026exact,
  author = {Bryan Zhu and Ziang Chen},
  title = {{Exact Instance Compression for Convex Empirical Risk Minimization via Color Refinement}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=JM5piPXaA4},
}
Figure