Abstract
We introduce and demonstrate how to effectively train multilingual machine translation models with pixel representations. We experiment with two different data settings with a variety of language and script coverage, demonstrating improved performance compared to subword embeddings. We explore various properties of pixel representations such as parameter sharing within and across scripts to better understand where they lead to positive transfer. We observe that these properties not only enable seamless cross-lingual transfer to unseen scripts, but make pixel representations more data-efficient than alternatives such as vocabulary expansion. We hope this work contributes to more extensible multilingual models for all languages and scripts.
Introduction
Traditional Natural Language Processing (NLP) models rely on a fixed vocabulary of subwords, typically generated through methods like Byte Pair Encoding (BPE). While effective for high-resource languages, this approach creates a significant "vocabulary bottleneck." Because the embedding matrix cannot be infinitely large, many languages and scripts are either under-represented or excluded entirely. When a model trained primarily on Latin text encounters a script like Arabic or Devanagari, it often fails due to a lack of corresponding tokens in its fixed vocabulary.
To address this, we propose the PIXEL model, which bypasses discrete vocabularies by "reading" text as an image. By rendering text into pixels, the model can leverage visual similarities across different languages and scripts, facilitating more robust multilingual translation and effective cross-lingual transfer.
The PIXEL Architecture
The core of our approach is the transformation of text into a visual format that can be processed by standard neural architectures. The PIXEL representation pipeline consists of four primary stages:
- Rendering: Source text is rendered into a grayscale image using the Google Noto Sans font, which provides extensive coverage for Unicode characters across hundreds of scripts.
- Tokenization: Instead of linguistic tokens, the image is sliced into fixed-size, overlapping patches (e.g., 24x24 pixels with a stride of 12).
- Convolutional Block: These patches are passed through a 2D convolutional layer followed by a linear projection to generate a sequence of "flat vectors."
- Transformer Encoder: These vectors serve as the input to a standard Transformer encoder.
Through empirical testing, we found that pixel-based models benefit from specific architectural adjustments. Specifically, we shifted from the traditional balanced 6-layer encoder/decoder setup to a deeper 12-layer encoder and a shallower 3-layer decoder. This configuration better handles the fine-grained visual information provided by the pixel patches.
Experimental Setup
We evaluated the PIXEL model across two primary datasets derived from TED talk transcripts:
- TED-7: A balanced dataset featuring seven languages (Arabic, German, French, Japanese, Korean, Russian, and Chinese) with approximately 150k–180k sentences each.
- TED-59: A highly imbalanced dataset of 59 languages totaling 5.1 million sentences. This dataset reflects real-world conditions where data availability varies drastically between languages.
Furthermore, we tested the model's zero-shot and few-shot transfer capabilities on "unseen" scripts, including Romanian, Polish, Farsi, Vietnamese, and Hebrew.
Results and Discussion
The PIXEL model demonstrated substantial performance gains over traditional subword (BPE) baselines. On the imbalanced TED-59 dataset, PIXEL achieved an average improvement of 4.6 BLEU. The gains were most pronounced for low-resource languages; for example, Belarusian (with only ~4,500 training examples) saw a staggering +10.2 BLEU improvement.
Visual Parameter Sharing and Transfer
The primary driver of these improvements is visual parameter sharing. In subword-based models, embeddings for related words in different scripts are often entirely disjoint. In contrast, a pixel model shares features at the character and stroke level. If a model learns to recognize Latin characters in English, that knowledge directly transfers to other Latin-script languages like Azerbaijani.
Our analysis indicates that performance improvements correlate more strongly with the total volume of data available for a specific script rather than the genetic language family. This suggests that the model is effectively learning a universal visual representation of text.
Addressing Representation Degeneration
Traditional models often suffer from "representation degeneration," where rare word embeddings cluster in a narrow region of the vector space, losing discriminative power. Because the PIXEL model's convolutional weights are updated with every batch—regardless of which specific words are present—it maintains a more robust and expressive representation for rare and low-resource terms.
Conclusion
PIXEL representations offer a promising path toward truly extensible multilingual models. By treating text as visual data, we can overcome the vocabulary bottleneck and enable seamless transfer to new scripts. While the approach introduces computational overhead due to the rendering process and results in longer input sequences, its data efficiency and superior performance in low-resource scenarios make it a compelling alternative to traditional subword-based NLP. Future work will explore "pixel-to-pixel" models that utilize visual representations for both the encoder and the decoder.
Summary updated