Lipschitz Normalization for Self-Attention Layers with Application to Graph Neural Networks

George Dasoulas, Kevin Scaman, Aladin Virmaux
3/8/2021
cs.LGstat.ML
transformer-attentiongnn

Official code: gdasoulas/LipschitzNorm (13 stars, Python, last commit 2022-01-24).

Abstract

Attention based neural networks are state of the art in a large range of applications. However, their performance tends to degrade when the number of layers increases.

Show full abstract

In this work, we show that enforcing Lipschitz continuity by normalizing the attention scores can significantly improve the performance of deep attention models. First, we show that, for deep graph attention networks (GAT), gradient explosion appears during training, leading to poor performance of gradient-based training algorithms. To address this issue, we derive a theoretical analysis of the Lipschitz continuity of attention modules and introduce LipschitzNorm, a simple and parameter-free normalization for self-attention mechanisms that enforces the model to be Lipschitz continuous. We then apply LipschitzNorm to GAT and Graph Transformers and show that their performance is substantially improved in the deep setting (10 to 30 layers). More specifically, we show that a deep GAT model with LipschitzNorm achieves state of the art results for node label prediction tasks that exhibit long-range dependencies, while showing consistent improvements over their unnormalized counterparts in benchmark node classification tasks.

View on arXivView PDF

Code Implementations(1)

Repository for the ICML 2021 paper: https://arxiv.org/abs/2103.04886

132Python, ShellSep 13, 20214 years ago

Similar Papers

Cite this paper

@article{dasoulas2021lipschitz,
  title  = {Lipschitz Normalization for Self-Attention Layers with Application to Graph Neural Networks},
  author = {George Dasoulas and Kevin Scaman and Aladin Virmaux},
  year   = {2021},
  eprint = {2103.04886},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2103.04886}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2103.04886.svg)](https://codeofpaper.com/paper/2103.04886)

Discussion