Manuscript Offprint

arXiv:2611.06006

Familiar letters, not related languages, let unseen languages into a shared space of meaning

Yuliang Liu, Xinyu Wang, Xiang Bai

Abstract

Hundreds of languages have written text but almost no translations, and whether a model learning one from untranslated text builds on a related language or familiar letters is unclear: they usually coincide. Here we show that familiar letters, not a related language, let an unseen language into a shared space of meaning. GlyphMind, a tokenizer-free vision transformer that reads text as pixels and lets any sentence be shown in any script, was pretrained to align translations across 27 writing systems. Adapted on untranslated Lao, a language and script it had never seen, it retrieved English translations seven times as often as the strongest simple baseline. Rewritten in unfamiliar letters, Lao did not enter although its close relative Thai was in pretraining; Santali, which had none, entered in Devanagari, familiar from Hindi, but not in its own script. Transliteration into familiar scripts may thus open multilingual models to languages without translations.

Of the more than 7,000 languages spoken in the world, only a small fraction is adequately supported by today's language models 1,2^{1,2}. These models are typically trained on large multilingual corpora, and prior work has found that they often map translations of the same sentence to nearby points in a shared representation space 3,4^{3,4}. This sharing is thought to underlie cross-lingual transfer, whereby a model fine-tuned on English examples can perform the same task in other languages 3,5^{3,5}. Such models acquire these shared representations either from large amounts of text in each language 5^{5} or from parallel corpora that pair sentences with their translations 6^{6}. However, hundreds of poorly supported languages have only a modest amount of untranslated text 1^{1}, and some are written in scripts of their own. It is therefore important to understand how existing multilingual models can be extended to such languages from this limited text alone, without parallel corpora.

Most language models read text through a subword tokenizer, whose vocabulary is learned from their pretraining corpora and therefore favours the languages already in them. As a result, text in rare or unseen languages is split into many more tokens 7,8^{7,8}, and letters absent from the vocabulary may become unknown tokens 9^{9}. Models perform worse on these languages 8,9^{8,9}, although writing them in the script of a related language can help 10^{10}. Whatever the script, a tokenizer-based model receives text only as numeric codes and never sees what the letters look like.

Pixel models instead read text rendered as images, so they need no tokenizer and accept any script that can be displayed 11−13^{11-13}. They also see the shapes of letters, and their transfer between languages has been linked to how similar the scripts look 14^{14}. Yet scripts that look alike often belong to related languages, so this link alone cannot show whether familiar letters themselves help a model adapt. Here we call a script familiar if the model saw it in pretraining or if it looks like a script the model saw. Because a pixel model can read the same sentences in any script, the letters can be changed while the language stays the same.

We developed GlyphMind, a vision transformer that reads each sentence only as a rendered image. We trained it from scratch on sentence pairs in 27 writing systems to place translations close together, so we know which scripts and languages it has read. We then chose two languages absent from pretraining. Lao has a close relative among the training languages, Thai, and the two scripts look alike. We also redrew Lao with the letter shapes of Vai, a script absent from pretraining. Santali has no close relative in training, and its own script, Ol Chiki, resembles no training script. Santali is also written in Devanagari, which the model reads from Hindi, so we transliterated its text into Devanagari. This gave four versions of two languages, each in familiar and in unfamiliar letters. We first tested whether ordinary Lao could join the shared space after adaptation on about one million untranslated lines. For each of the four versions, we then adapted the model on a matched budget of about 150,000 untranslated lines, mixed with translation pairs replayed from the training languages (Fig. 1). A version entered the shared space if the model then retrieved English translations of its sentences more often than both models adapted on other text and baselines that match sentences by length or ink. In GlyphMind, each language entered the shared space in familiar letters but not in unfamiliar ones. For these two languages, a close linguistic relative was therefore neither necessary nor sufficient for entry. For Santali, the advantage of familiar letters persisted after we removed digits and words shared with the training text. Even without a tokenizer, familiar letters decided whether this much untranslated text was enough.

Results

GlyphMind reads each sentence as a single line of rendered text, an image of 64 by 768 pixels (Fig. 1a; Extended Data Fig. 1). In pretraining, it learns from scratch to place translations close together, using 4.1 million groups of sentences that translate one another in 27 writing systems (Fig. 1b). Most experiments use GlyphMind-205M, which has 205 million parameters and also learns to predict the features of masked parts of each image (Extended Data Fig. 2a). GlyphMind-38M, with 38 million parameters, learns the translation task alone and is used in the one experiment that trains two models from scratch.

References (29)

  • The state and fate of linguistic diversity and inclusion in the NLP world
  • How multilingual is multilingual BERT?
  • The semantic hub hypothesis: Language models share semantic representations across languages and modalities
  • Unsupervised cross-lingual representation learning at scale
  • Massively multilingual sentence embeddings for zero-shot cross-lingual transfer and beyond
  • Language model tokenizers introduce unfairness between languages
  • Do all languages cost the same?
  • UNKs everywhere: Adapting multilingual language models to new scripts
  • When being unseen from mBERT is just the beginning: Handling new languages with multilingual language models
  • Language modelling with pixels
  • Multilingual pixel representations for translation and effective cross-lingual transfer
  • Multilingual pretraining for pixel language models
  • Seeing the unseen: Visual similarity for pixel language model adaptation
  • Parallel data, tools and interfaces in OPUS
  • The eBible corpus: Data and model benchmarks for Bible translation for low-resource languages (opens arXiv in a new tab)
  • NTREX-128 – news test references for MT evaluation of 128 languages
  • Findings of the 2019 conference on machine translation (WMT19)
  • No Language Left Behind: Scaling Human-Centered Machine Translation
  • The Flores-101 evaluation benchmark for low-resource and multilingual machine translation
  • The FLORES evaluation datasets for low-resource machine translation: Nepali–English and Sinhala–English
  • Attention is all you need
  • An image is worth 16x16 words: Transformers for image recognition at scale
  • Representation Learning with Contrastive Predictive Coding
  • A simple framework for contrastive learning of visual representations
  • data2vec: A general framework for self-supervised learning in speech, vision and language
  • Bootstrap your own latent – a new approach to self-supervised learning
  • IndicTrans2: Towards high-quality and accessible machine translation models for all 22 scheduled Indian languages
  • A generalized solution of the orthogonal Procrustes problem
  • Representational similarity analysis – connecting the branches of systems neuroscience