White-Box Transformers via Sparse Rate Reduction

Yaodong Yu, Sam Buchanan, Druv Pai, Tianzhe Chu, Ziyang Wu, Shengbang Tong, Benjamin D. Haeffele, Yi Ma

TL;DR

This paper proposes "CRATE," a novel white-box transformer architecture derived from a unified objective called "sparse rate reduction." CRATE offers a mathematically interpretable framework for representation learning, demonstrating that standard transformer components like multi-head self-attention and MLPs can be seen as steps in optimizing this objective, achieving competitive performance on large-scale vision tasks.

What Problem Does This Paper Address?

Deep learning models, particularly transformers, have achieved remarkable success, but their internal workings often remain opaque "black boxes." This lack of interpretability hinders our understanding of why they work, making it difficult to debug, improve, or design new architectures. Existing representation learning methods either focus on specific tasks (like classification) or lack rigorous mathematical grounding for their architecture design. The authors aim to bridge this gap by proposing a unified theoretical framework for representation learning that leads to both interpretable architectures and strong empirical performance. They contend that the goal of representation learning is to compress data into a mixture of low-dimensional Gaussian distributions on incoherent subspaces, and they propose "sparse rate reduction" as a metric for this.

Methods

The core of CRATE lies in its derivation from the "sparse rate reduction" objective. This objective combines two goals:

  1. Compression: Minimizing the lossy coding rate of token representations, aiming to make them fit into low-dimensional Gaussian distributions supported on incoherent subspaces.
  2. Sparsification: Encouraging sparsity in the final token representations.

CRATE achieves this through an iterative, layer-wise optimization process. Each layer of CRATE is designed to perform one step of this optimization:

  • Multi-Head Subspace Self-Attention (MSSA): This block is derived as a gradient descent step to minimize the coding rate part of the objective. It can be interpreted as compressing token sets by finding their correlations within learned subspaces.
  • Sparse Coding Proximal Step (ISTA): This block is derived from optimizing the sparsification part of the objective. It's framed as an unrolled iterative shrinkage-thresholding algorithm (ISTA) for sparse coding, effectively sparsifying the compressed representations.

The authors emphasize that this "white-box" design allows for mathematical interpretability, where each layer's function is directly tied to optimizing the sparse rate reduction objective.

Datasets

  • Training and Evaluation: ImageNet-1K
  • Transfer Learning Evaluation: CIFAR10, CIFAR100, Oxford Flowers-102, Oxford-IIIT-Pets, ImageNet Real.
  • Pre-training: ImageNet-21K was also used for pre-training in some experiments.

Key Insights and Ideas

  • Transformers as Optimization Iterations: The paper provides a compelling theoretical justification for viewing standard transformer blocks (self-attention + MLP) as iterative steps in optimizing a unified representation learning objective (sparse rate reduction).
  • Interpretability through Objective Alignment: By deriving architectural components directly from a well-defined objective, CRATE offers a high degree of interpretability. The authors show that layers indeed learn to optimize their intended compression and sparsification goals.
  • Unified Framework: CRATE unifies seemingly disparate concepts like denoising, score matching, sparse coding, and rate reduction under a single representation learning objective, leading to a principled architecture design.
  • Simplicity and Effectiveness: Despite using arguably the simplest possible implementations for each component, CRATE achieves performance competitive with heavily engineered transformers like ViT.

Key Results

  • Competitive Performance: CRATE models achieved performance on par with ViT on ImageNet-1K, despite having a simpler, interpretable design. For example, CRATE-Base (22.08M parameters) achieved 70.8% top-1 accuracy on ImageNet, comparable to ViT-Small (22.05M parameters).
  • Layer-wise Optimization: Layer-wise analysis showed that both the compression (coding rate) and sparsity terms consistently improved as the layer index increased, confirming that CRATE layers learn to optimize their designed objectives.
  • Scalability: The architecture demonstrated promising scaling behavior, with larger models generally achieving better performance.
  • Pre-training on ImageNet-21K: CRATE-Base pre-trained on ImageNet-21K achieved 80.2% top-1 accuracy on ImageNet, comparable to ViT-Base (86M parameters, 83.9%) with significantly fewer parameters.

Limitations and Future Work

  • Simplest Choices: The authors acknowledge that they made the "simplest possible choices" for each component (e.g., linear projections, specific optimization steps). They suggest that more complex approximations or alternative operators could lead to improved performance.
  • Theoretical Justification for Variants: While the paper provides a mathematical justification for the ISTA block, further theoretical exploration of alternative architectures and assumptions (e.g., beyond orthogonal dictionaries, handling non-orthogonal features) is suggested.
  • Beyond Classification: While CRATE performs well on classification, the authors believe its applicability extends to other tasks, particularly those requiring semantically meaningful representations, and suggest exploring self-supervised learning methods for training.
  • More Complex Architectures: The paper hints at potential for more complex architectures by exploring variations in the attention mechanism and sparsification step, suggesting that further architectural exploration could yield even better results.

Summary updated

BibTeX
@inproceedings{yu2023white,
  author = {Yaodong Yu and Sam Buchanan and Druv Pai and Tianzhe Chu and Ziyang Wu and Shengbang Tong and Benjamin D. Haeffele and Yi Ma},
  title = {{White-Box Transformers via Sparse Rate Reduction}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=THfl8hdVxH},
}
Figure