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

Sample Compression Hypernetworks: From Generalization Bounds to Meta-Learning

Benjamin Leblanc, Mathieu Bazinet, Nathaniel D'Amours, Alexandre Drouin, Pascal Germain

TL;DR

This paper bridges sample compression theory and modern deep learning by turning the theoretical "reconstruction function" into a trainable neural hypernetwork within a meta-learning setup. To support end-to-end backpropagation, the authors prove a novel PAC-Bayesian sample compression generalization bound for continuous (real-valued) messages. The resulting architecture compresses a dataset into a handful of representative points plus a compact message vector, generating downstream classifiers equipped with rigorous, non-vacuous generalization guarantees.

What Problem Does This Paper Address?

In machine learning theory, sample compression provides some of the tightest generalization bounds: if a model can be faithfully reconstructed using only a tiny subset of training examples (the compression set) and a short auxiliary string (the message), it is statistically guaranteed to generalize well.

Historically, however, sample compression methods like Set Covering Machines relied on fixed, handcrafted reconstruction algorithms and discrete messages. Because the reconstruction process was not differentiable, designing compression-based learning algorithms required discrete optimization schemes. This paper addresses two core hurdles:

  1. Differentiable reconstruction: Can we learn the reconstruction function itself as a parameterized neural network?
  2. Continuous messages: Standard compression bounds require discrete messages. How do we derive valid statistical guarantees when messages are continuous, real-valued vectors suitable for backpropagation?

Methods

The authors introduce an end-to-end meta-learning architecture and a companion theoretical bound:

  • PAC-Bayesian Bound for Continuous Messages (Theorem 3): Combining sample compression with PAC-Bayes techniques, the authors define a data-independent prior $P_\Sigma$ (e.g., an isotropic Gaussian $\mathcal{N}(0, \mathbf{I})$) and a data-dependent posterior $Q_\Sigma = \mathcal{N}(\boldsymbol{\sigma}, \mathbf{I})$ over real-valued message vectors. The bound penalizes the discrepancy between empirical complement-set risk and true risk via the Kullback–Leibler (KL) divergence $\mathrm{KL}(Q_\Sigma \parallel P_\Sigma)$.
  • Sample Compression Hypernetwork Architecture:
  • Sample Compressor ($C_\phi$): Uses attention mechanisms over dataset embeddings (via a permutation-invariant Shared Transformation and Pool [STP] module) to select a discrete subset of $c$ training points.
  • Message Compressor ($M_\psi$): Encodes the dataset into a fixed $b$-dimensional vector $\boldsymbol{\sigma}$, outputting either discrete tokens (via $\mathrm{sign}$ and Straight-Through Estimators) or continuous values (via $\tanh$).
  • Reconstruction Hypernetwork ($R_\theta$): Takes the $c$ compression points and the message $\boldsymbol{\sigma}$, then directly outputs the weights $\boldsymbol{\gamma}$ of a downstream neural predictor $h_{\boldsymbol{\gamma}}$.
  • Meta-Learning Protocol: The hypernetwork is trained across meta-training tasks. At meta-test time, a new task's predictor is built solely from the compression set and message. Because the hypernetwork weights are frozen, the unused examples act as an uncontaminated test sample, enabling the computation of valid, task-specific generalization bounds.

Datasets

The authors evaluate their approach on a synthetic 2D binary classification benchmark:

  • Transformed "Moons" (Scikit-learn): Two interleaving half-circles with Gaussian noise, transformed across tasks by random rotations ($[0, 360^\circ]$), translations ($[-10, 10]^2$), and scalings ($[0.2, 5]$).
  • Setup: 300 meta-training tasks and 100 meta-test tasks, each containing 200 samples evenly split into support and query sets.

Key Insights and Ideas

  • Reconstruction as an Autoencoder: Sample compression can be viewed as an asymmetric autoencoder where the encoder splits into dual branches—one selecting raw input instances ($C_\phi$) and one compressing residual context ($M_\psi$)—while the decoder ($R_\theta$) synthesizes a functional predictor rather than reconstructing raw data.
  • Continuous vs. Discrete Trade-off: Continuous messages allow smooth gradient-based optimization, driving downstream test classification error lower than discrete messages. However, discrete messages yield tighter generalization certificates because they avoid the continuous bound's KL divergence penalty.
  • The Sweet Spot of Compression: Both test error and generalization bounds exhibit an accuracy–complexity trade-off. Choosing $c$ (number of points) or $b$ (message size) too small starves the hypernetwork of information, but setting both too large degrades performance and loosens the theoretical bound.

Key Results

  • Test Performance: On the synthetic moons meta-test set, the continuous model achieved near-optimal test error (as low as 0.11% with $c=2, b=2$ and 0.14% with $c=0, b=2$).
  • Generalization Bounds ($\delta = 5\%$):
  • Discrete messages achieved bounds as tight as 8.74% error ($c=1, b=3$) and 9.83% ($c=0, b=2$).
  • Continuous messages yielded bounds around 15.29% ($c=2, b=0$) and 17.63% ($c=3, b=0$), where bound tightness was primarily limited by the KL divergence term.
  • Qualitative Compression: With just $c=3$ and no message ($b=0$), the sample compressor routinely isolated three widely separated boundary points, enabling the hypernetwork to recover nearly flawless decision boundaries across diverse task orientations.

Limitations and Future Work

  • Toy Benchmark: Experiments were limited to a synthetic 2D binary classification problem; the framework has not yet been demonstrated on high-dimensional data or complex real-world datasets.
  • Sub-optimal Continuous Bounds: The current continuous formulation incurs a noticeable penalty from $\mathrm{KL}(Q_\Sigma \parallel P_\Sigma)$. The authors suggest explicitly regularizing the meta-objective with this KL term to tighten practical bounds.
  • Future Directions: Scaling the architecture to real-world meta-learning tasks, higher-dimensional inputs, and continuous regression settings.

Summary updated

BibTeX
@inproceedings{leblanc2024sample,
  author = {Benjamin Leblanc and Mathieu Bazinet and Nathaniel D'Amours and Alexandre Drouin and Pascal Germain},
  title = {{Sample Compression Hypernetworks: From Generalization Bounds to Meta-Learning}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  doi = {10.48550/arxiv.2410.13577},
}
Figure