Skip to main content
QUICK REVIEW

[Paper Review] Language Modelling with Pixels

Phillip Rust, Jonas F. Lotz|arXiv (Cornell University)|Jul 14, 2022
Natural Language Processing TechniquesComputer Science101 references17 citations
TL;DR

This paper proposes pixel, a vision-based language model that bypasses the vocabulary bottleneck by rendering text as images and using a Vision Transformer to encode them, enabling cross-lingual transfer across diverse scripts without subword tokenization. It outperforms BERT on non-Latin scripts and shows robustness to orthographic noise and code-switching, though it lags slightly on Latin scripts and long syntactic dependencies.

ABSTRACT

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.

Motivation & Objective

  • To address the vocabulary bottleneck in pretrained language models, which limits cross-lingual generalization and causes trade-offs in embedding and output layer design.
  • To enable support for thousands of written languages, including non-Latin scripts, without relying on finite subword or character vocabularies.
  • To improve robustness to orthographic variations, noise, and code-switching by modeling language through visual representations.
  • To explore whether pixel-based encoding can achieve strong zero-shot and few-shot transfer performance across typologically diverse languages.

Proposed method

  • Text is rendered as fixed-size image patches using a font renderer, converting input sequences into visual tokens.
  • A Vision Transformer (ViT) encoder processes the image patches without a learnable token embedding layer, eliminating vocabulary constraints.
  • The model uses masked autoencoding: randomly masked image patches are reconstructed by a lightweight decoder during pretraining.
  • Pretraining is performed on the same English-only data as BERT, using the C4 dataset, to enable direct comparison.
  • Fine-tuning uses a classification head on top of the ViT encoder for downstream NLP tasks.
  • The model is evaluated on syntactic and semantic tasks across 32 languages spanning 14 scripts, including non-Latin ones like Thai, Vietnamese, and Arabic.

Experimental results

Research questions

  • RQ1Can a vision-based language model trained on English-only text generalize effectively to languages with non-Latin scripts?
  • RQ2How does pixel's performance compare to BERT and mBERT on syntactic and semantic tasks across typologically diverse languages?
  • RQ3To what extent does pixel improve robustness to orthographic noise and linguistic code-switching compared to subword-based models?
  • RQ4Does visual representation learning via pixel mitigate the vocabulary bottleneck in multilingual NLP?
  • RQ5How does dependency length affect performance differences between pixel and BERT in syntactic parsing?

Key findings

  • Pixel significantly outperforms BERT on syntactic and semantic tasks in non-Latin scripts, such as Thai (LAS: 50.2 vs. 35.7) and Chinese (LAS: 54.1 vs. 46.2).
  • On Latin scripts, pixel performs slightly worse than BERT, with a LAS gap of 6.5 points on English (77.2 vs. 83.7), indicating a trade-off in performance on familiar scripts.
  • Pixel shows superior robustness to orthographic attacks and code-switching, confirming the benefits of visual representation learning for noisy inputs.
  • The model exhibits strong zero-shot transfer to unseen fonts, achieving high performance without data augmentation, suggesting inherent visual generalization.
  • The performance gap between pixel and BERT increases with longer syntactic dependencies in English, indicating that pixel struggles more with long-range syntactic structures.
  • Despite being pretrained on only ~0.05% non-English text, pixel generalizes effectively to multilingual tasks, with consistent performance across scripts.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.