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

Sample Compression Unleashed: New Generalization Bounds for Real Valued Losses

Mathieu Bazinet, Valentina Zantedeschi, Pascal Germain

Abstract

The sample compression theory provides generalization guarantees for predictors that can be fully defined using a subset of the training dataset and a (short) message string, generally defined as a binary sequence. Previous works provided generalization bounds for the zero-one loss, which is restrictive notably when applied to deep learning approaches. In this paper, we present a general framework for deriving new sample compression bounds that hold for real-valued unbounded losses. Using the Pick-To-Learn (P2L) meta-algorithm, which transforms the training method of any machine-learning predictor to yield sample-compressed predictors, we empirically demonstrate the tightness of the bounds and their versatility by evaluating them on random forests and multiple types of neural networks.

Introduction

Generalization bounds—the mathematical guarantees that a model will perform well on unseen data—often struggle with modern deep learning. Traditional theories like VC-dimension fall apart when a model has millions more parameters than it has training points. Sample compression theory offers a clever way out: if a model can be "reconstructed" using only a tiny subset of the training data, it is guaranteed to generalize.

In this paper, researchers extend this theory beyond simple binary classification to the real-valued losses (like cross-entropy and MSE) used in almost all modern AI. This framework brings sample compression guarantees to real-valued and unbounded losses by bridging sample compression with PAC-Bayesian analysis.

Methods and the P2L Algorithm

The authors bridge the gap between two major fields: Sample Compression Theory and PAC-Bayesian Theory. They derive a new "master" theorem for sample compression that works with any "comparator function," allowing the use of sophisticated tools from PAC-Bayes literature. This yields specific bounds for bounded losses (using KL divergence) and unbounded losses (using sub-Gaussian assumptions).

To implement this theory, they utilize the Pick-To-Learn (P2L) meta-algorithm. Instead of training on the whole dataset, P2L iteratively finds the "hardest" examples (those with the highest loss), adds them to a "compression set," and retrains the model on just that subset. This ensures the model is "compressed" by design.

The KL bound typically decreases as the compression set size increases, eventually stabilizing as shown for MNIST49 and MNIST56.

Key Insights: Parameter Independence

The most striking insight is that these bounds do not depend on the number of learnable parameters. A DistilBERT model with 66 million parameters can have the same generalization guarantee as a tiny MLP, provided they are both reconstructed from a compression set of the same size. This reinforces the fundamental idea that learning is equivalent to finding a concise representation of the data. If you can "pick" the right 1% of your data to define your model, you've truly learned the underlying pattern.

Empirical Results

The authors evaluated their bounds across a diverse range of tasks, including image classification (MNIST), text classification (Amazon Polarity), and various regression tasks.

For the Amazon Polarity task, they achieved a non-vacuous bound of 13.91% error certificate for a model with 66M parameters. This is significant because most other theories would provide a bound much higher than 100% for a model of this size. On MNIST, CNNs trained with P2L achieved test errors as low as 0.25%, with theoretical certificates around 5%.

Experimental results for neural networks on MNIST sub-tasks, comparing actual test error with theoretical KL and P2L bounds.

Limitations and Future Work

While the bounds are remarkably tight for theoretical guarantees, a performance gap remains. Training with P2L on a subset sometimes results in slightly higher test error than standard training on the full dataset, representing a trade-off between maximum accuracy and provable generalization. Future work may explore more sophisticated selection heuristics—such as focusing on sample diversity—or incorporating "message strings" to further tighten the bounds.

Summary updated

BibTeX
@inproceedings{bazinet2025sample,
  author = {Mathieu Bazinet and Valentina Zantedeschi and Pascal Germain},
  title = {{Sample Compression Unleashed: New Generalization Bounds for Real Valued Losses}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2025},
  url = {https://openreview.net/forum?id=wHxqnZpRzc},
}
Figure