Hyperpolyglot LLMs: Cross-Lingual Interpretability in Token Embeddings

Andrea W Wen-Yi, David Mimno
11/29/2023
cs.CL

No official code found. Best implementation: andreawwenyi/hyperpolyglot (4 stars, MIT, last commit 2024-05-28).

Abstract

Cross-lingual transfer learning is an important property of multilingual large language models (LLMs). But how do LLMs represent relationships between languages? Every language model has an input layer that maps tokens to vectors. This ubiquitous layer of language models is often overlooked. We find that similarities between these input embeddings are highly interpretable and that the geometry of these embeddings differs between model families. In one case (XLM-RoBERTa), embeddings encode language: tokens in different writing systems can be linearly separated with an average of 99.2% accuracy. Another family (mT5) represents cross-lingual semantic similarity: the 50 nearest neighbors for any token represent an average of 7.61 writing systems, and are frequently translations. This result is surprising given that there is no explicit parallel cross-lingual training corpora and no explicit incentive for translations in pre-training objectives. Our research opens the door for investigations in 1) The effect of pre-training and model architectures on representations of languages and 2) The applications of cross-lingual representations embedded in language models.

View on arXivView PDF

Code Implementations(1)

MIT

Code for "Hyperpolyglot LLMs: Cross-Lingual Interpretability in Token Embeddings"

40Python, Jupyter NotebookNov 29, 20232 years agoMIT

Similar Papers

Cite this paper

@article{wenyi2023hyperpolyglot,
  title  = {Hyperpolyglot LLMs: Cross-Lingual Interpretability in Token Embeddings},
  author = {Andrea W Wen-Yi and David Mimno},
  year   = {2023},
  eprint = {2311.18034},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2311.18034v1}
}

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

Discussion