An In-depth Investigation of Sparse Rate Reduction in Transformer-like Models

Yunzhe Hu, Difan Zou, Dong Xu

Abstract

Deep neural networks have long been criticized for being black-box. To unveil the inner workings of modern neural architectures, a recent work proposed an information-theoretic objective function called Sparse Rate Reduction (SRR) and interpreted its unrolled optimization as a Transformer-like model called Coding Rate Reduction Transformer (CRATE). However, the focus of the study was primarily on the basic implementation, and whether this objective is optimized in practice and its causal relationship to generalization remain elusive. Going beyond this study, we derive different implementations by analyzing layer-wise behaviors of CRATE, both theoretically and empirically. To reveal the predictive power of SRR on generalization, we collect a set of model variants induced by varied implementations and hyperparameters and evaluate SRR as a complexity measure based on its correlation with generalization. Surprisingly, we find out that SRR has a positive correlation coefficient and outperforms other baseline measures, such as path-norm and sharpness-based ones. Furthermore, we show that generalization can be improved using SRR as regularization on benchmark image classification datasets. We hope this paper can shed light on leveraging SRR to design principled models and study their generalization ability.

1. Introduction

The quest for interpretability in deep learning has led to the development of "white-box" architectures. One prominent example is the Coding Rate Reduction Transformer (CRATE), which replaces standard attention mechanisms with Multi-head Subspace Self-Attention (MSSA). This design is theoretically grounded in Sparse Rate Reduction (SRR), an information-theoretic objective that aims to compress data into low-dimensional subspaces while maintaining class discriminability. Despite its elegant derivation, the practical alignment between the CRATE architecture and the SRR objective—and the resulting impact on generalization—has remained under-explored. This study provides a rigorous audit of the CRATE framework, identifies mathematical discrepancies in its implementation, and establishes SRR as a potent predictor of model performance.

2. Auditing the CRATE Architecture

The original derivation of CRATE suggests that its attention layers perform gradient descent to minimize the coding rate. However, a mathematical audit via Taylor expansion reveals a significant artifact: the standard implementation actually discards the first-order term required for compression.

2.1 The Implementation Gap

Theoretical analysis shows that the MSSA operator, as originally formulated, tends to maximize (decompress) the coding rate rather than minimize it. Empirical "toy" experiments confirm that the attention mechanism alone can be counterproductive to the SRR objective. The model's overall success appears to rely on the subsequent ReLU non-linearity, which introduces sparsity and "rescues" the representation by forcing compression.

2.2 Architectural Variants

To address these findings, we introduce two variants:

  • CRATE-N (Negative): This version flips the sign of the attention operation to align with the gradient descent path for compression.
  • CRATE-T (Transpose): This version transposes the output matrix. While less theoretically "pure" than CRATE-N, it empirically bridges the performance gap between white-box models and standard Transformers.

3. SRR as a Complexity Measure

A central contribution of this work is evaluating SRR as a measure of model complexity. By training 64 distinct model configurations—varying hyperparameters like learning rates and batch sizes—we assessed how well SRR scores correlate with generalization on CIFAR-10 and CIFAR-100.

Using Kendall’s rank correlation coefficient ($\tau$), we found that SRR is a superior predictor of generalization compared to traditional metrics. SRR achieved a $\tau$ of 0.445, outperforming the inverse margin (0.415) and significantly surpassing path-norm and sharpness-based measures (PAC-Bayes), which often showed poor or even negative correlations in the context of Transformer-like architectures.

4. Improving Generalization via Regularization

Beyond its predictive power, SRR can be utilized directly during training. We integrated SRR as a penalty term in the loss function. To prevent interference between layers, we employed a StopGrad operator, ensuring each layer optimizes its own representation locally.

Experimental results demonstrate that SRR regularization consistently boosts accuracy. For instance, on CIFAR-10, the CRATE-N model's accuracy improved from 81.52% to 81.91%. Notably, applying this regularization only to the final layer is sufficient to achieve these gains, offering a computationally efficient path to improved performance.

5. Discussion and Limitations

While SRR provides a powerful lens for understanding CRATE, several challenges remain. The current definition of SRR relies on the tied weight structure (shared Q, K, and V matrices) inherent to CRATE, making its application to standard Transformers non-trivial. Furthermore, the empirical success of the CRATE-T variant suggests that existing SRR theory does not yet fully account for all architectural nuances of the Transformer.

6. Conclusion

This investigation moves the CRATE framework from a theoretical curiosity to a practical tool for model analysis. By identifying the "implementation gap" and establishing SRR as a robust complexity measure, we provide a foundation for designing more principled and interpretable neural architectures. Future work will focus on scaling these insights to larger datasets like ImageNet and extending the SRR framework to standard, unconstrained Transformer models.

Summary updated

BibTeX
@inproceedings{hu2024depth,
  author = {Yunzhe Hu and Difan Zou and Dong Xu},
  title = {{An In-depth Investigation of Sparse Rate Reduction in Transformer-like Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=CAC74VuMWX},
}
Figure