All Roads Lead to Rome? Exploring the Invariance of Transformers' Representations

Yuxin Ren, Qipeng Guo, Zhijing Jin, Shauli Ravfogel, Mrinmaya Sachan +2 more
5/23/2023
cs.CLcs.AIcs.LG

Official code: twinkle0331/BERT-similarity (7 stars, MIT, last commit 2023-05-25).

Abstract

Transformer models bring propelling advances in various NLP tasks, thus inducing lots of interpretability research on the learned representations of the models. However, we raise a fundamental question regarding the reliability of the representations. Specifically, we investigate whether transformers learn essentially isomorphic representation spaces, or those that are sensitive to the random seeds in their pretraining process. In this work, we formulate the Bijection Hypothesis, which suggests the use of bijective methods to align different models' representation spaces. We propose a model based on invertible neural networks, BERT-INN, to learn the bijection more effectively than other existing bijective methods such as the canonical correlation analysis (CCA). We show the advantage of BERT-INN both theoretically and through extensive experiments, and apply it to align the reproduced BERT embeddings to draw insights that are meaningful to the interpretability research. Our code is at https://github.com/twinkle0331/BERT-similarity.

View on arXivView PDF

Code Implementations(1)

MIT

Code for paper "All Roads Lead to Rome? Exploring the Invariance of Transformers' Representations"(https://arxiv.org/abs/2305.14555)

72PythonFeb 12, 20233 years agoMIT

Similar Papers

Cite this paper

@article{ren2023roads,
  title  = {All Roads Lead to Rome? Exploring the Invariance of Transformers' Representations},
  author = {Yuxin Ren and Qipeng Guo and Zhijing Jin and Shauli Ravfogel and Mrinmaya Sachan and Bernhard Schölkopf and Ryan Cotterell},
  year   = {2023},
  eprint = {2305.14555},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2305.14555v1}
}

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/2305.14555.svg)](https://codeofpaper.com/paper/2305.14555)

Discussion