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

Modeling Sparse Deviations for Compressed Sensing using Generative Models

Manik Dhar, Aditya Grover, Stefano Ermon

Introduction

In Compressed Sensing (CS), the goal is to reconstruct a high-dimensional signal, such as an image, from a very small number of linear measurements. To achieve this, researchers rely on a "prior"—an underlying assumption about the structure of the signal.

Traditionally, the dominant prior has been sparsity, which assumes that most values of the signal in some basis are zero. This concept forms the foundation of methods like LASSO. While flexible, sparsity-based methods typically require a relatively high number of measurements to perform well.

Recently, Deep Generative Models (such as VAEs or GANs) have emerged as powerful alternative priors. Because these models "know" the underlying distribution of a dataset (e.g., what a human face or a handwritten digit looks like), they can reconstruct signals from a tiny fraction of the data. However, generative models suffer from a "representation error" problem: they can only reconstruct signals that fall exactly within their learned latent space. If a real-world signal contains a unique detail the model hasn't seen, or if it is slightly out-of-distribution, the reconstruction error will never reach zero—no matter how many measurements are taken.

Researchers from Stanford have developed Sparse-Gen, a novel framework that bridges this gap by combining the strengths of deep generative models with traditional sparsity constraints.

The Sparse-Gen Framework

To overcome the limitations of pure generative models, the authors propose a hybrid approach. Instead of assuming the target signal $x$ is strictly the output of a generator $G(z)$, Sparse-Gen models the signal as:

$$x = G(z) + \nu$$

Here, $G(z)$ is the output of a pre-trained generative model, and $\nu$ is a sparse deviation vector.

Geometric comparison of LASSO, Generative models, and Sparse-Gen.

Key Innovations

  1. The Objective Function: To recover the signal, the framework solves an optimization problem that minimizes the $\ell_1$ norm of the deviation $\nu$ while ensuring the total reconstructed signal matches the actual measurements.
  2. Unconstrained Optimization: The hard constraints are relaxed into a Lagrangian form: $$\min_{z, \nu} \|\nu\|_1 + \lambda \|A(G(z) + \nu) - y\|_2^2$$ This formulation allows the use of standard gradient-based optimization techniques (like Adam) to simultaneously find the optimal latent code $z$ and the sparse correction $\nu$.

  3. Theoretical Guarantees: The paper provides rigorous proofs demonstrating that the number of measurements required scales roughly as $O(k + l)$, where $k$ is the dimension of the latent space and $l$ is the sparsity of the deviation. Interestingly, LASSO is shown to be a special case of Sparse-Gen where the generator $G(z)$ always outputs zero.

Key Insights and Results

The authors evaluated Sparse-Gen on standard image reconstruction benchmarks, including MNIST, Omniglot, and CelebA. The results highlight several major advantages of the hybrid approach.

Best of Both Worlds: Sparse-Gen acts like a generative model when measurements are scarce, relying heavily on the learned prior. However, when measurements are plentiful, it behaves like LASSO, using the sparse term to correct any representation errors left by the generator.

Breaking the Saturation Floor: Pure generative methods "saturate"—their error stops decreasing even as more measurements are added because they cannot model out-of-distribution details. Sparse-Gen breaks this performance ceiling. As measurements increase, the sparse term $\nu$ picks up the slack, driving the reconstruction error toward zero.

Reconstruction error on MNIST showing Sparse-Gen breaking the saturation floor of pure generative models.

Robustness to Distribution Shift: The framework excels in "Transfer Compressed Sensing," where a model trained on one dataset is used to sense signals from another. For instance, when using a model trained on MNIST digits to reconstruct Omniglot characters, standard VAE recovery fails by forcing the character to look like a digit. Sparse-Gen, however, uses the "digit-ness" as a base and allows the sparse term to accurately draw in the unique strokes of the new character.

Superior Efficiency: On both MNIST and Omniglot, Sparse-Gen consistently achieved lower reconstruction errors ($\ell_1, \ell_2,$ and $\ell_\infty$ norms) than both LASSO and pure VAE-based recovery. It reached these low error rates with significantly fewer measurements. On MNIST, Sparse-Gen with just 100 measurements outperformed LASSO with 300.

Limitations and Future Work

While highly effective, the framework has a few limitations. Because deep generators are non-linear, the optimization landscape is non-convex, meaning gradient descent could theoretically get stuck in local minima (though it performed well in practice).

Currently, the work assumes deviations are sparse in the canonical pixel basis. Future research could explore deviations that are sparse in other domains, such as wavelets. Additionally, exploring "structured" deviations—where the errors themselves follow a pattern learnable by a secondary model—could further enhance the framework's capabilities.

Summary updated

BibTeX
@inproceedings{dhar2018modeling,
  author = {Manik Dhar and Aditya Grover and Stefano Ermon},
  title = {{Modeling Sparse Deviations for Compressed Sensing using Generative Models}},
  booktitle = {International Conference on Machine Learning},
  year = {2018},
  url = {https://openreview.net/forum?id=rkWInoZOWS},
}
Figure