Language Modelling with Pixels

Language models are defined over a finite set of inputs, which creates a vocabulary bottleneck when we attempt to scale the number of supported languages. Tackling this bottleneck results in a trade-off between what can be represented in the embedding matrix and computational issues in the output layer. This paper introduces PIXEL, the Pixel-based Encoder of Language, which suffers from neither of these issues. PIXEL is a pretrained language model that renders text as images, making it possible to transfer representations across languages based on orthographic similarity or the co-activation of pixels. PIXEL is trained to reconstruct the pixels of masked patches instead of predicting a distribution over tokens. We pretrain the 86M parameter PIXEL model on the same English data as BERT and evaluate on syntactic and semantic tasks in typologically diverse languages, including various non-Latin scripts. We find that PIXEL substantially outperforms BERT on syntactic and semantic processing tasks on scripts that are not found in the pretraining data, but PIXEL is slightly weaker than BERT when working with Latin scripts. Furthermore, we find that PIXEL is more robust than BERT to orthographic attacks and linguistic code-switching, further confirming the benefits of modelling language with pixels.

PDF Abstract
Task Dataset Model Metric Name Metric Value Global Rank Result Benchmark
Named Entity Recognition (NER) MasakhaNER BERT ENG 92.9 # 1
Params 110M # 2
AMH 0 # 2
IBO 83.5 # 1
HAU 86.6 # 1
KIN 72.0 # 1
LUG 78.4 # 1
LUO 73.2 # 1
PCM 87.0 # 1
SWA 83.3 # 1
WOL 62.2 # 1
YOR 73.8 # 1
Named Entity Recognition (NER) MasakhaNER PIXEL ENG 89.5 # 2
Params 86M # 1
AMH 47.7 # 1
IBO 79.9 # 2
HAU 82.4 # 2
KIN 64.2 # 2
LUG 76.5 # 2
LUO 66.6 # 2
PCM 78.7 # 2
SWA 79.8 # 2
WOL 59.7 # 2
YOR 70.7 # 2

Methods