Of Non-Linearity and Commutativity in BERT

By Sumu Zhao, Damian Pascual, Gino Brunner, Roger Wattenhofer. 2021

20 citations recorded by the source corpus.

In this work we provide new insights into the transformer architecture, and in particular, its best-known variant, BERT. First, we propose a method to measure the degree of non-linearity of different elements of transformers. Next, we focus our investigation on the feed-forward networks (FFN) inside transformers, which contain two thirds of the model parameters and have so far not received much attention. We find that FFNs are an inefficient yet important architectural element and that they cannot simply be replaced by attention blocks without a degradation in performance. Moreover, we study the interactions between layers in BERT and show that, while the layers exhibit some hierarchical structure, they extract features in a fuzzy manner. Our results suggest that BERT has an inductive bias towards layer commutativity, which we find is mainly due to the skip connections. This provides a justification for the strong performance of recurrent and weight-shared transformer models.

Subfields: Natural Language Processing, Model Architectures

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Natural Language Processing

  1. David Bau
  2. Asli Celikyilmaz
  3. Yonatan Belinkov
  4. Alex Andonian
  5. Kevin Meng
  6. Mona T. Diab
  7. Marjan Ghazvininejad
  8. Badr AlKhamissi

In Model Architectures

  1. David Bau
  2. Kevin Meng
  3. Mona T. Diab
  4. Asli Celikyilmaz
  5. Badr AlKhamissi
  6. Yonatan Belinkov
  7. Millicent Li
  8. Marjan Ghazvininejad

Citations in the corpus