Matrix Information Theory for Self-Supervised Learning

Yifan Zhang, Zhiquan Tan, Jingqin Yang, Weiran Huang, Yang Yuan

Overview

This paper introduces Matrix-SSL, a novel self-supervised learning (SSL) framework that leverages matrix information theory to unify contrastive and non-contrastive learning paradigms. By extending classical concepts like cross-entropy to positive semi-definite matrices, the authors seamlessly combine "matrix uniformity" and "matrix alignment" losses. This approach yields richer representation learning, achieving state-of-the-art results on ImageNet and MS-COCO, and even improving mathematical reasoning when fine-tuning Large Language Models (LLMs).

The Problem: Unifying SSL Paradigms

In self-supervised learning, models learn representations from unlabeled data by comparing different augmented views of the same input.

  • Contrastive learning (e.g., SimCLR) relies on two forces: alignment (pulling views of the same image together) and uniformity (pushing views of different images apart so features evenly distribute across the latent space).
  • Non-contrastive learning (e.g., BYOL, Barlow Twins, MEC) drops the negative samples. Recent theories show these methods primarily rely on maximizing information (uniformity) via frameworks like Maximum Entropy Coding (MEC).

However, the MEC framework doesn't explicitly differentiate between feature matrices from different branches, making it difficult to integrate a principled "alignment" loss. The authors ask: Can we build a unified mathematical framework that harmonizes the virtues of both contrastive (alignment + uniformity) and non-contrastive (uniformity) paradigms?

Methods: Matrix Information Theory

The authors tackle this by introducing Matrix Information Theory. They extend classical Shannon information theory concepts—like entropy, Kullback-Leibler (KL) divergence, and cross-entropy—to positive semi-definite matrices.

Matrix-SSL Architecture
  1. Theoretical Link: They mathematically prove that the Total Coding Rate (TCR) loss used in MEC is equivalent to the Matrix Cross-Entropy (MCE) between the feature covariance matrix and a scaled identity matrix. This acts as the Matrix-Uniformity loss.
  2. Matrix-SSL: To improve upon this, they propose a combined loss function: Matrix-Uniformity + Matrix-Alignment.
  3. Matrix-Alignment: Instead of just aligning individual feature vectors (like the MSE loss in BYOL), Matrix-SSL directly aligns the auto-covariance matrices of the two augmented branches using MCE.
  4. LLM Extension: The authors extend this beyond vision. They apply Matrix Cross-Entropy to fine-tune Large Language Models (LLMs) by treating token embeddings as matrices. This allows the loss function to account for similarities between synonymous or polysemous words, which standard cross-entropy ignores.

Key Insights

  • Covariance Alignment is Richer: Aligning covariance matrices provides a much richer training signal than standard vector alignment. Even if two different models achieve the exact same vector alignment score, their matrix alignment scores can vary significantly, capturing deeper structural information about the data distribution.
  • Explaining the "Stop-Gradient" Trick: In methods like SimSiam, a "stop-gradient" operation is famously required to prevent the model from collapsing. The authors show that applying a stop-gradient while optimizing Matrix Cross-Entropy is mathematically equivalent to optimizing Matrix KL divergence, providing a rigorous theoretical justification for why the trick works.
  • Understanding Dimensional Collapse: The paper proves a closed-form relationship between a matrix's "effective rank" and Matrix KL divergence. This perfectly explains the "rank-increasing phenomenon" observed in non-contrastive learning, showing exactly why these methods naturally resist dimensional collapse.

Key Results

Matrix-SSL was evaluated across vision and language tasks, demonstrating strong performance improvements:

  • ImageNet Linear Probing: Matrix-SSL outperforms existing baselines. With just 100 epochs of pre-training on a ResNet-50, it achieves 71.1% Top-1 accuracy, beating SimCLR (66.5%), BYOL (66.5%), and MEC (70.6%).
  • Transfer Learning (MS-COCO): Matrix-SSL pre-trained for only 400 epochs outperformed previous state-of-the-art methods (MoCo v2 and BYOL) that were pre-trained for 800 epochs, showing up to a 3.3% improvement in object detection and instance segmentation metrics.
Object Detection Results on MS-COCO
  • LLM Fine-Tuning: When fine-tuning a 7B parameter math model (Llemma) using Matrix Cross-Entropy instead of standard Cross-Entropy, the model scored 72.3% on GSM8K (a solid +3.1% margin over the baseline) and 30.2% on MATH (+0.2%).

Limitations and Future Work

Implementing matrix logarithms (required for calculating matrix entropy) in neural networks relies on Taylor series expansions. This introduces an expansion order hyperparameter that requires tuning (the authors found an order of 4 worked best for their vision tasks).

For future work, the authors suggest exploring an auto-covariance uniformity loss as an alternative to the cross-covariance approach used in this paper. They also believe matrix information theory can act as a broader catalyst for designing robust algorithms across various machine learning domains, well beyond standard SSL.

Summary updated

BibTeX
@inproceedings{zhang2024matrix,
  author = {Yifan Zhang and Zhiquan Tan and Jingqin Yang and Weiran Huang and Yang Yuan},
  title = {{Matrix Information Theory for Self-Supervised Learning}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=wleAlsklEh},
}
Figure