Skip to main content
QUICK REVIEW

[Paper Review] ContraNorm: A Contrastive Learning Perspective on Oversmoothing and Beyond

Xiaojun Guo, Yifei Wang|arXiv (Cornell University)|Mar 12, 2023
Advanced Graph Neural NetworksComputer Science10 citations
TL;DR

ContraNorm introduces a contrastive-uniformity inspired normalization layer to alleviate oversmoothing and dimensional collapse in GNNs and Transformers, with theoretical guarantees and broad empirical gains on BERT/ALBERT, DeiT, and GCN backbones.

ABSTRACT

Oversmoothing is a common phenomenon in a wide range of Graph Neural Networks (GNNs) and Transformers, where performance worsens as the number of layers increases. Instead of characterizing oversmoothing from the view of complete collapse in which representations converge to a single point, we dive into a more general perspective of dimensional collapse in which representations lie in a narrow cone. Accordingly, inspired by the effectiveness of contrastive learning in preventing dimensional collapse, we propose a novel normalization layer called ContraNorm. Intuitively, ContraNorm implicitly shatters representations in the embedding space, leading to a more uniform distribution and a slighter dimensional collapse. On the theoretical analysis, we prove that ContraNorm can alleviate both complete collapse and dimensional collapse under certain conditions. Our proposed normalization layer can be easily integrated into GNNs and Transformers with negligible parameter overhead. Experiments on various real-world datasets demonstrate the effectiveness of our proposed ContraNorm. Our implementation is available at https://github.com/PKU-ML/ContraNorm.

Motivation & Objective

  • Motivate and characterize oversmoothing beyond complete collapse in GNNs and Transformers, introducing dimensional collapse as a key issue.
  • Leverage insights from contrastive learning, particularly uniformity, to design a normalization mechanism that naturally prevents collapse.
  • Develop ContraNorm as an optimization-induced normalization with minimal parameter overhead and easy plug-in capability.
  • Provide theoretical guarantees showing ContraNorm mitigates both complete and dimensional collapse under conditions.
  • Empirically validate ContraNorm across NLP (BERT/ALBERT on GLUE), vision (DeiT on ImageNet), and graph learning (GCN on node classification).

Proposed method

  • Relate oversmoothing to dimensional collapse using effective rank (erank) as a diagnostic metric.
  • Transfer the uniformity loss from contrastive learning to an energy function acting on representations, then unfold its optimization as a forward-layer update.
  • Derive ContraNorm as a representation-update rule proportional to a softened self-attention term, with a stop-gradient variant to stabilize training.
  • Provide two practical instantiations: (i) ContraNorm with feature norm regularization or LayerNorm, and (ii) ContraNorm-D for scalable, large graphs.
  • Theoretically connect the update to a dimensional-collapse objective (erank) and prove conditions under which erank increases.
  • Offer a dual version (ContraNorm-D) inspired by decorrelation approaches like Barlow Twins for scalability.

Experimental results

Research questions

  • RQ1Does dimensional collapse (beyond complete collapse) capture oversmoothing in deep GNNs and Transformers, and how can it be measured?
  • RQ2Can a normalization layer inspired by contrastive uniformity mitigate dimensional collapse with minimal overhead?
  • RQ3What is the theoretical impact of ContraNorm on representation variance and effective rank, and under what conditions does it alleviate oversmoothing?
  • RQ4Can ContraNorm improve performance across diverse domains—NLP, vision, and graph learning—without extensive parameter tuning?
  • RQ5How does ContraNorm compare to existing normalization (e.g., LayerNorm, PairNorm) in preventing oversmoothing in practice?

Key findings

  • ContraNorm yields improvements over vanilla models on GLUE with BERT/ALBERT backbones (average scores rising from 82.59% to 83.39% for BERT and from 83.74% to 84.67% for ALBERT).
  • In vision, ContraNorm improves DeiT on ImageNet100 and ImageNet1k across depths, with notable gains (e.g., ImageNet100 showing consistent accuracy increases across 12/16/24 blocks).
  • For graph learning, ContraNorm outperforms vanilla GCN and competitors in several layer-depth regimes, demonstrating stronger resistance to deep-layer oversmoothing compared with LayerNorm and PairNorm (across Cora, Citeseer, Chameleon, and Squirrel datasets).
  • The approach is modular and can be plugged after representation layers with negligible parameter overhead, and a scalable variant (ContraNorm-D) adapts to large graphs.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.