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

Sparse Coding with Multi-layer Decoders using Variance Regularization

Katrina Evtimova, Yann LeCun

Abstract

Sparse representations of images are useful in many computer vision applications. Sparse coding with an $l_1$ penalty and a learned linear dictionary requires regularization of the dictionary to prevent a collapse in the $l_1$ norms of the codes. Typically, this regularization entails bounding the Euclidean norms of the dictionary's elements. In this work, we propose a novel sparse coding protocol which prevents a collapse in the codes without the need to regularize the decoder. Our method regularizes the codes directly so that each latent code component has variance greater than a fixed threshold over a set of sparse representations for a given set of inputs. Furthermore, we explore ways to effectively train sparse coding systems with multi-layer decoders since they can model more complex relationships than linear dictionaries. In our experiments with MNIST and natural image patches, we show that decoders learned with our approach have interpretable features both in the linear and multi-layer case. Moreover, we show that sparse autoencoders with multi-layer decoders trained using our variance regularization method produce higher quality reconstructions with sparser representations when compared to autoencoders with linear dictionaries. Additionally, sparse representations obtained with our variance regularization approach are useful in the downstream tasks of denoising and classification in the low-data regime.

Introduction

Traditional sparse coding aims to represent data as a linear combination of a few active features from a dictionary. A persistent challenge in training these models is "code collapse," where the latent codes $z$ shrink toward zero while the dictionary weights grow unbounded to satisfy sparsity requirements. To mitigate this, researchers typically constrain the dictionary's weights, such as by normalizing its columns. However, this weight-normalization strategy is difficult to apply when the decoder is a deep, non-linear neural network. This paper addresses this by proposing a shift in perspective: regularizing the latent codes directly rather than the decoder architecture.

Methods

The core innovation of this work is Variance-Regularized Dictionary Learning (VDL). Instead of constraining the decoder $\mathcal{D}$, the authors introduce a variance-based regularization term into the energy function used during inference. This term, implemented as a hinge loss, encourages the variance of each latent code component across a mini-batch to stay above a fixed threshold. This prevents code collapse regardless of the decoder's complexity.

The proposed sparse coding protocol: (a) inference of sparse code $z$ and (b) learning of encoder $\mathcal{E}$ and decoder $\mathcal{D}$.

By decoupling regularization from the decoder's architecture, the framework allows for the use of multi-layer decoders with non-linear activations (e.g., ReLU). These models can capture more complex data relationships than standard linear dictionaries. To make the system computationally efficient, the authors employ amortized inference. Alongside the decoder, they train a LISTA-inspired encoder $\mathcal{E}$ that learns to predict sparse codes in a single forward pass, providing a fast and deterministic alternative to iterative optimization at test time.

Results

The researchers evaluated VDL on MNIST and natural image patches from ImageNet, yielding several key insights:

  • Superior Reconstruction: Multi-layer VDL models (VDL-NL) consistently achieve higher Peak Signal-to-Noise Ratio (PSNR) at high sparsity levels compared to standard linear dictionary learning (SDL). They represent images more accurately with fewer active neurons.
  • Interpretability: Despite the added non-linearity, the learned features remain interpretable. Activating single latent units in a non-linear decoder still produces recognizable "atoms," such as strokes for digits and Gabor-like filters for natural images.
  • Robustness and Utility: VDL models excel in downstream tasks. They act as effective denoisers by forcing codes onto a learned data manifold. Furthermore, in low-data regimes (e.g., 1 to 10 labeled examples per class), linear classifiers trained on VDL-NL features outperform those trained on raw pixels or standard sparse coding features, indicating highly discriminative learned representations.

Conclusion

Variance regularization provides a flexible way to integrate deep learning architectures into sparse coding frameworks. By moving the anti-collapse constraint to the latent space, the decoder becomes an architectural "black box" that can be optimized for performance. Future work will explore scaling these methods to deep convolutional decoders and refining the dependency on mini-batch statistics during training.

Summary updated

BibTeX
@article{evtimova2022sparse,
  author = {Katrina Evtimova and Yann LeCun},
  title = {{Sparse Coding with Multi-layer Decoders using Variance Regularization}},
  journal = {Accepted by TMLR},
  year = {2022},
  url = {https://openreview.net/forum?id=4GuIi1jJ74},
}
Figure