---
title: "Autoregressive Pre-Training on Pixels and Texts — Chai 2024"
description: "PixelGPT learns from images of written text, while DualGPT pairs those images with text tokens to improve language understanding."
canonical: "https://research.elamur.ai/free/en/papers/chai-2024-autoregressive-pre-training-pixels-texts/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/) · [Constitution](https://md.constitution.elamur.ai/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/chai-2024-autoregressive-pre-training-pixels-texts/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2024](https://md.research.elamur.ai/free/en/papers/2024/) / Autoregressive Pre-Training on Pixels and Texts

# Autoregressive Pre-Training on Pixels and Texts

Paper · 2024 · Yekun Chai, Qingyi Liu, Jingwu Xiao et al.

**Authors:** [Yekun Chai](https://md.research.elamur.ai/free/en/authors/yekun-chai/), Qingyi Liu, Jingwu Xiao, [Shuohuan Wang](https://md.research.elamur.ai/free/en/authors/shuohuan-wang/), [Yu Sun](https://md.research.elamur.ai/free/en/authors/yu-sun/) and Hua Wu · **Year:** 2024 · **Venue:** Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing · **Licence:** [CC BY 4.0 (ACL Anthology)](https://creativecommons.org/licenses/by/4.0/)

Cited by **5** papers in our library of more than 163,000 papers whose bibliographies we read · Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing · [licence](https://creativecommons.org/licenses/by/4.0/)

- [Publisher's page](https://aclanthology.org/2024.emnlp-main.182/)
- [PDF](https://aclanthology.org/2024.emnlp-main.182.pdf)
- [DOI 10.18653/v1/2024.emnlp-main.182](https://doi.org/10.18653/v1/2024.emnlp-main.182)

## Summary

When a document is converted to plain text, the words can survive while information carried by their appearance disappears. Color may distinguish one symbol from another, and the way characters are drawn can matter for reading across writing systems. Chai and colleagues ask whether a system can learn language directly from such visual input using the same broad training strategy that works for ordinary text. In their approach, a passage is rendered as a strip of small image patches. Given the patches that come before a particular position, the system learns to predict what the next patch should look like. The authors call the version trained exclusively this way PixelGPT. It reads the rendered passage without first converting the image into characters or looking up the words in a fixed vocabulary.

The paper also tests whether the image and text versions of a passage can help each other during training. In DualGPT, a shared sequence processor learns from images, ordinary text, and examples that place the image of a passage before the corresponding text. The training task depends on what comes next. For an image patch, the system estimates its pixel values. For a text token, it assigns probabilities to entries in a vocabulary. A separate configuration, MonoGPT, trains on both kinds of input while keeping the examples unpaired. That comparison helps distinguish learning from both formats from learning when the two versions of a passage occur together.

After task-specific training, PixelGPT scores 74.2 on the reported GLUE aggregate, close to the bidirectional pixel-based PIXEL at 74.1 and below the text-based GPT-2 at 75.6. On XNLI, a benchmark that asks how the meanings of two sentences are related, PixelGPT averages 63.2% accuracy when it can train for the task on English and translated examples. PIXEL reaches 62.8% and English-pretrained BERT reaches 63.9% under that protocol. The comparison looks different when task training is restricted to English. PixelGPT averages 39.8% on that evaluation, while the multilingual baseline XLM-R base reaches 76.2%. The ability to render many scripts gives PixelGPT a way to accept those inputs. Using them to make a correct inference is a separate capability.

The benefits of pairing also depend on which input the task uses. With text input, DualGPT scores 76.9 on the reported GLUE aggregate, ahead of TextGPT at 76.3 and MonoGPT at 75.4. With pixel input, DualGPT improves on MonoGPT but still trails the text version of DualGPT on the same aggregate. A separate emoji experiment finds higher hate-detection accuracy with color than with grayscale, giving a concrete example of information the visual route can preserve. Overall, the paper shows that next-patch training can support competitive language understanding in several settings. Its evidence is strongest for adapting a pretrained system to recognize labels, with open questions about training cost, transfer to unfamiliar languages, and reliable generation of readable text.

## Deep dive: Autoregressive Pre-Training on Pixels and Texts

PixelGPT learns from images of written text, while DualGPT pairs those images with text tokens to improve language understanding. · about 36 minutes to read

**In this deep dive**

1. [The problem and its context](#dd-the-problem-and-its-context)
2. [The method, step by step](#dd-the-method-step-by-step)
3. [Experiments and results](#dd-experiments-and-results)
4. [What the ablations show](#dd-what-the-ablations-show)
5. [Limitations](#dd-limitations)
6. [What came after](#dd-what-came-after)

### The problem and its context

#### What changes when a passage becomes an image

The paper starts with a difference between a document as it appears to a reader and the sequence of symbols a computer typically receives. A conventional text pipeline needs a character string before it can divide the material into units for prediction. For a PDF or another visual document, getting that string may require optical character recognition, or OCR. Recognition has to identify the characters in the first place. The resulting string can also leave behind aspects of the original presentation, even when character recognition succeeds. The authors point to this gap as a reason to study language directly in its visual form.

The implementation studies this problem through rendered text. A renderer starts with a string and draws it on a canvas. The learning system then receives the resulting pixels, without taking the source string as a second input in the pure visual configuration. Starting with strings gives the experiment a systematic way to produce visual training data while retaining control over the font and image format. It also defines the scope of the experiment. The visual inputs are designed examples of written language, with an orderly sequence of patches. Reading a complicated source document would bring additional questions about layout and sequence that this construction sets aside.

A second motivation concerns how text is divided into units. In a conventional system, a tokenizer assigns pieces of the input string to entries in a vocabulary. A sub-word vocabulary allows a word to be represented by several smaller pieces, with the same pieces available for reuse in other words. The paper describes a tradeoff between the granularity of those pieces and the cost of maintaining a vocabulary for prediction. That tradeoff becomes important across languages, where a single stock of units has to serve different writing systems and different patterns of spelling. The relevant operation is [subword tokenization](https://md.research.elamur.ai/free/en/concepts/subword-tokenization/).

Rendering moves the decision about units from the inventory of symbols to a geometric grid. The grid needs no entry for a particular word or character. A patch can carry a piece of an unfamiliar glyph as long as the renderer can draw it. A familiar glyph can likewise be represented in a new color or font using the same kind of input. Whether the training procedure gives those pixel patterns useful linguistic meaning remains an empirical question. This difference between accepting a written form and understanding it is particularly important for the multilingual experiments.

The authors give color a specific role in this account. RGB represents the red, green, and blue components of an image. A colored emoji or highlighted phrase can therefore retain distinctions that grayscale or a binary image would handle differently. Ordinary body text may use little of this extra information. The paper consequently treats color both as a general design choice for its renderer and as something whose value can be tested on examples where appearance carries part of the message. Its later comparisons distinguish the ability to process RGB from the question of whether a benchmark benefits from the additional channels.

#### What earlier approaches already offered

PIXEL had already shown how to train on images of written language. As described by Chai and colleagues, it renders text, divides the image into fixed patches, and trains an encoder to reconstruct missing parts. A masked patch supplies a target for learning. The surrounding visible patches can include information from both before and after the missing region. The paper associates this bidirectional approach with the masked image reconstruction method developed in [Masked Autoencoders Are Scalable Vision Learners](https://md.research.elamur.ai/free/en/papers/he-2021-masked-autoencoders-scalable-vision-learners/).

Other work expanded the range of what a visual representation could do. CLIPPO used a shared encoder for pictures and rendered text and trained it to bring related inputs into a common representation. Lotz and colleagues investigated how choices in drawing text affected pixel-based encoders. The paper also describes a translation approach in which a visual encoder reads the input while a causal decoder produces language. This arrangement puts the visual input and the generated text on different sides of the architecture. The point of departure for PixelGPT is to use a causal decoder for the visual sequence itself.

The document-understanding literature supplies a related motivation. DONUT learns from the document image and can generate structured information without running a separate OCR stage at its input. The paper distinguishes that application from its own investigation of how much general language pretraining can accomplish when the visual material is systematically rendered. Both approaches expose the learning system to written appearance, but the kinds of image and the questions asked of them differ. The document-understanding comparison comes from [DONUT](https://md.research.elamur.ai/free/en/papers/kim-2021-ocr-free-document-understanding-transformer/).

For causal learning on pixels, the authors describe approaches developed for ordinary images. Some first use vector quantization to turn image information into a sequence of discrete entries. Once those entries exist, a predictor can learn to guess the next entry much as it guesses the next token in text. Other approaches forecast image patches from an available visual context, which can itself be encoded bidirectionally before the forecast begins. The paper draws on this broader history while directing its own training towards pictures of writing. An earlier example of the discrete route is [Zero-Shot Text-to-Image Generation](https://md.research.elamur.ai/free/en/papers/ramesh-2021-zero-shot-text-image-generation/).

PIXAR is a particularly close comparison because it also uses causal training on images of text. Its visual input is binary and its objective treats reconstruction as classification with binary cross-entropy. PixelGPT instead predicts real-valued RGB intensities and scores the prediction with a regression loss. PIXEL also uses regression, but does so for masked regions in a bidirectional encoder and uses grayscale images. These relationships matter when interpreting the comparison. PixelGPT shares the direction of prediction with PIXAR and the broad type of pixel loss with PIXEL, while its color representation differs from both.

#### Why apply the same training direction to both formats?

In a text decoder, the training example is arranged as a sequence in which earlier units provide evidence for the next unit. Writing can also be arranged as a visual sequence, so the same rule for access to earlier positions can be applied to patches. This common structure gives the authors a way to share the main computation while changing the form of the input and the prediction. The text route retains a discrete vocabulary. The visual route needs a numerical estimate of what comes next on the canvas. The paper develops these two versions within the same [Transformer and attention](https://md.research.elamur.ai/free/en/concepts/transformer/) framework.

That shared design also makes it possible to ask a narrower question about joint training. Seeing pictures of words in some examples and conventional strings in others might provide useful experience with both, but independent samples give no direct instruction that a particular image depicts a particular string. A paired sequence places the relationship inside a single example. The experiment therefore distinguishes the feasibility of pure pixel prediction, the effect of exposure to both formats, and the value of supplying an explicit correspondence between them. Those distinctions carry through to evaluation, where the authors can give a jointly pretrained system text, pixels, or both.

### The method, step by step

#### From a string to a sequence of patches

The visual route begins with a paragraph or a pair of related segments. The renderer turns the material into an RGB strip, which is cut into squares of equal size. The strip is as tall as a single square, so the squares form a row. The system processes that row in the order laid out by the renderer. This is an adaptation of an image-processing method in which small regions are represented individually before attention combines information across them. The paper takes its patch-processing inspiration from the [Vision Transformer](https://md.research.elamur.ai/free/en/papers/dosovitskiy-2020-image-worth-16x16-words-transformers/).

The square is the unit of computation. It can cover part of a glyph, complete glyphs, or space, depending on how the writing falls on the canvas. The division does not depend on a dictionary or on a decision about where one word ends. At the same time, the input is still segmented. PixelGPT exchanges units defined by a vocabulary for regions defined by an image grid. Reading a word can require information from multiple patches, while a patch can carry evidence about more than one part of the written sequence.

The main renderer uses a white background and black text in GoNotoCurrent. Its configuration specifies 120 DPI, a font size of 8, and a padding size setting of 3. The RGB format has a 24-bit color depth and can represent colored emoji in addition to the default text color. The renderer also supports bidirectional writing and the ligatures needed by some scripts. A ligature is a written form in which characters are drawn together. Here the renderer is responsible for drawing that form, and the learning system sees the resulting pixels.

Length management occurs before or during rendering. The renderer can search for how much of a line will fit by testing how many words can be drawn within the width limit. The appendix describes this as a binary search, which narrows the range of possible lengths through repeated fit checks. This makes the available visual width the relevant constraint. The paper also describes truncation or segmentation when inputs run beyond the permitted length. A long passage can thus be divided into separate examples or cut at a limit, depending on how it is prepared.

A 16x16 black square is reserved as a separator and end-of-sequence marker. This distinguishes the end of the writing, or a boundary between segments, from a blank region inside the drawing. White patches after the terminal marker pad out the remaining space. The paper excludes the terminal marker from the pixel reconstruction loss, describes it as inactive for attention, and masks the padding from attention. These conventions tell the pipeline where sequence content ends without asking the next-patch objective to learn to reproduce the black end marker.

Pretraining on rendered passages and text The steps in order.

#### The image and text inputs

The paper denotes the visual input as a real-valued image array.

```
x ∈ ℝ^(H×W×C)
```

Here `x` is the rendered image, `∈` means it belongs to the specified space, and `ℝ` denotes real numbers. The parenthesized superscript specifies the array dimensions, with `×` separating their axes. `H` is the height of 16 pixels, `W` is the width of 16,384 pixels, and `C` is the channel count of 3 for RGB.

```
P = H
```

Here `P` is the length of one side of a square patch, `H` is the height of the image, and `=` expresses their equality. The patch dimensions are 16x16 pixels. Because a patch spans the full height of the strip, successive patches can be obtained by moving along the width.

```
N = W/P
```

Here `N` is the number of patches in the row, `W` is the width of the canvas, and `P` is the patch side length in pixels. The `/` indicates division and `=` gives the resulting patch count. The renderer configuration specifies 1024 patches at its maximum sequence length.

To send a patch into the decoder, the method flattens its pixel and channel values into a vector and applies a learned linear projection. Flattening gives the values a fixed order in a single list. The projection then mixes those values into a vector of width `D`, where `D` denotes the dimension expected by the decoder. The architecture has a hidden size of 1024. That number describes the vector width within the network and also happens to be the configured maximum number of positions. The width of an individual vector and the length of a sequence are different properties. The patch-processing description gives a compact shape whose patch axis omits a spatial dimension if read literally. The rendering dimensions and the stated flattening operation specify that the projection receives values from the entire square across its channels.

The text route starts from the string itself. It uses the tokenizer from Llama 2, which the paper describes as byte-level byte-pair encoding. As described in the analysis, a string can be decomposed into raw bytes when needed, offering a route to encode forms for which the tokenizer has no familiar larger piece. The vocabulary size is 32k. Each resulting unit indexes an embedding table, which supplies a learned vector for that entry. Where the image projection converts numerical intensities into a representation, the text lookup selects a representation using an identifier. Both routes produce vectors that can occupy positions in the same decoder. The tokenizer and decoder design are adapted from [Llama 2](https://md.research.elamur.ai/free/en/papers/touvron-2023-llama-2-open-foundation-fine/), and the paper discusses the sub-word method in connection with [byte-pair encoding](https://md.research.elamur.ai/free/en/papers/sennrich-2016-neural-machine-translation-rare-words/).

#### Shared processing with different predictions

Once the input has become a sequence of vectors, the same decoder can process it. Causal attention restricts the evidence for a prediction to the earlier context rather than allowing the system to look ahead at the target. For an example with an image prefix followed by text, this arrangement gives the text prediction access to preceding image positions. Earlier image predictions are made before the later text becomes available. The order of the pair thus matters to how the training example works. It embeds the visual version as context for the written sequence without making the two directions of prediction symmetric.

The decoder consists of 24 layers. Its components include RMSNorm before the sublayer computations, SwiGLU as the activation in the feed-forward part, rotary position embeddings, and grouped query attention. RMSNorm uses the magnitude of the hidden values to normalize them. The feed-forward activation contributes a nonlinear transformation within each layer. Rotary position embeddings bring positional information into attention, which matters when the same kind of patch or token can occur at different points. Grouped query attention shares key and value heads across groups of query heads. The setup uses 16 attention heads and 8 key-value heads, with an intermediate size of 2816 in the feed-forward part. The position and attention choices correspond to [RoFormer](https://md.research.elamur.ai/free/en/papers/su-2021-roformer-enhanced-transformer-rotary-position/) and [Grouped Query Attention](https://md.research.elamur.ai/free/en/papers/ainslie-2023-gqa-training-generalized-multi-query/).

The authors express next-patch prediction as a factorization of the whole patch sequence.

```
p(xₚ¹, xₚ², …, xₚᴺ) = ∏ₜ₌₁ᴺ p(xₚᵗ | xₚ¹, xₚ², …, xₚᵗ⁻¹)
```

Here `p` denotes the joint or conditional probability in the paper's description of the prediction task. `xₚᵗ` denotes the flattened visual patch at position `t`, with subscript `ₚ` marking the patch representation. The superscripts `¹`, `²`, and `ᴺ` identify the first, second, and final positions, and `ᵗ⁻¹` identifies the position immediately before `t`. `N` is the total number of patches. The product `∏ₜ₌₁ᴺ` runs over positions indexed by `t`, from `1` through `N`. The commas list patches, the ellipses stand for intervening positions, and `|` means that the prediction is conditioned on what follows the bar. `=` relates the whole-sequence expression on the left to the chain of conditional expressions on the right. At the first position the chain has no preceding patch.

The factorization describes the flow of information. The actual visual loss measures a numerical discrepancy. A regression head produces values for the patch being predicted. Training compares those outputs with normalized target patches using mean squared error, which squares the individual prediction errors and averages them. Squaring gives larger errors greater influence. The target is the appearance of the region, with the end marker excluded. A word is never supplied as a separate reconstruction label on the pure pixel route. Any information that later helps with a sentence-level task must be learned through the visual prediction objective and the subsequent task training.

Text predictions use a separate classification head. Its output describes how likely each vocabulary entry is to be the next token. Cross-entropy scores the probabilities assigned to the observed targets, penalizing low probability on the token that actually comes next. The text task uses teacher forcing. During training, the available text prefix comes from the original example, so an incorrect token guess at one step does not replace the actual token in the context for the next training prediction. This loss operates on discrete token identities, while the patch loss operates on continuous intensities.

Both heads provide training signals to representations computed by the decoder. The shared layers are the place where improvements from one format could carry over to the other. The input layers and output heads handle the parts specific to each format. In paired examples, the training sequence itself creates a connection between them by letting the text-side prediction draw on the preceding rendered passage. The verification of any gain occurs downstream. Neither the shared parameters nor the order of the pair alone guarantees that the resulting representation will help on a particular task.

#### What each training configuration sees

TextGPT learns exclusively from tokenized strings and their next-token targets. PixelGPT learns exclusively from rendered images and their next-patch targets. The two single-format conditions establish what the causal architecture can do with either input in isolation. On the visual route, the fixed text vocabulary disappears from the learning problem. The pipeline still relies on the renderer to supply the correct visual form of the source material.

MonoGPT combines both kinds of training example without joining the corresponding inputs. Some examples train it on patches and others train it on text, so both objectives contribute to the shared decoder. A given sequence does not explicitly show how its image corresponds to a string. DualGPT also sees standalone examples of each kind, with paired examples added to the mixture. It receives the image first and then its text, as a single concatenated sequence. This gives the decoder a chance to use the correspondence within the causal objective instead of having to discover it only from exposure to separate batches of material.

The distinction between those conditions is separate from the choice of representation at evaluation. A jointly pretrained system can be adapted with text alone or with rendered text alone. In some experiments the authors also supply both at that stage. For those examples the original sentence is appended after the rendered image. The image is padded on the right for alignment, and the attention mask blocks the intervening white padding. This arrangement prevents the blank filler between the image and the text from participating in attention. It lets the experiment ask whether the two representations add value even after pretraining has finished.

The training corpora are drawn differently for the two routes. The authors render peS2o, English Wikipedia, and C4 to build the visual collection of over 400 million document images. They describe peS2o as a processed collection of open-access academic papers, and C4 as a cleaned part of Common Crawl with language filtering and deduplication. The training images are made from the text of these sources. Their provenance in scholarly articles and webpages does not imply that the system sees the original PDF pages or website layouts.

The text collection is described in the appendix through Dolma, a corpus of 3 trillion tokens. It includes web and academic writing and draws on sources of code as well as books and encyclopedic content. The corpus breakdown also includes Project Gutenberg and the combined Wikipedia and Wikibooks material. This description sets the size and scope of the source collection. The number of units actually processed in an individual training run is a different quantity. The distinction is important for comparing how the visual and text routes use the available material. The source collection is documented in [Dolma](https://md.research.elamur.ai/free/en/papers/soldaini-2024-dolma-open-corpus-three-trillion/).

#### Training budgets and task adaptation

A total of 32 NVIDIA A100 GPUs were used for pretraining. For TextGPT and PixelGPT, the reported global batch size was 4 million, counted in tokens for the former and patches for the latter. MonoGPT used a global batch of 8 million, evenly divided between its two formats. DualGPT used 10 million with the documented 4:4:2 ratio for text, image, and paired data. The listed pretraining settings include AdamW, a maximum learning rate of 5e-4, 200 warmup steps, a linear schedule, and bfloat16 mixed precision. The shared setup makes the comparison informative about the training recipes. Adding a kind of example also changes the total batch and the relative exposure to each input.

To test language understanding, the authors replace the pretraining output with a task-specific prediction layer. For visual inputs, the appendix says that the label is predicted using the last patch position. Under causal attention, a final content representation can draw on earlier positions in the sequence. The benchmark target might be a class label or, in a similarity task, a score. The procedure asks whether the features acquired by learning to predict patches or tokens can be adapted to the new target, with supervised examples for the task. This task adaptation is [fine-tuning](https://md.research.elamur.ai/free/en/concepts/fine-tuning/).

The renderer is ordinarily kept the same during task adaptation for visual inputs. For sentence pairs on GLUE, the sentences are rendered separately and then concatenated with a black separator. This retains the order and boundary of the two pieces while giving the decoder a single sequence to process. The authors search settings for each task and input condition, including the learning rate, batch size, sequence length, and training duration. They report the best settings they found for the GLUE and XNLI evaluations. The paper also reports releasing the implementation, data, and checkpoints for its PixelGPT project, including the fine-tuning data used for language understanding and multilingual evaluation.

### Experiments and results

#### GLUE tests several kinds of language judgment

The main tests use labeled benchmarks after fine-tuning. GLUE contains nine tasks involving individual sentences or sentence pairs. They pose different demands, including classifying a sentence, deciding whether two expressions have similar meanings, and identifying a relation between a premise and a hypothesis. A patch system sees the writing that constitutes the input and produces a task prediction. This tests whether visual pretraining yields representations that can support the judgments with labeled examples. The benchmark is [GLUE](https://md.research.elamur.ai/free/en/papers/wang-2018-glue-multi-task-benchmark-analysis/).

The authors use accuracy for MNLI, QNLI, SST-2, RTE, and WNLI. Accuracy counts the share of examples given the correct answer. They use F1 for QQP and MRPC, where it balances precision and recall for the target class. CoLA is scored by Matthews correlation coefficient, reported as MCC, which summarizes how the predicted classes agree with the true classes using the full pattern of correct and incorrect assignments. STS-B uses Spearman correlation, which tests whether the prediction orders sentence pairs similarly to the reference judgments. A GLUE aggregate combines tasks with different metrics. Its numerical value should be read as the paper's summary score across tasks.

MNLI has matched and mismatched evaluations. The matched examples are drawn from sources represented during training, while the mismatched examples come from different sources. The paper keeps both scores in its task results, so the pair of values records performance under both conditions. WNLI also remains in the evaluation. The authors note that some previous work left it out because the training examples differ in distribution from validation and test examples. Keeping it makes WNLI part of the reported aggregate and allows readers to see how the pixel system behaves on that task separately.

The main comparison uses BERT and GPT-2 on the text side. BERT can represent context bidirectionally, while GPT-2 supplies a text-based causal comparison. On the visual side, PIXEL supplies the bidirectional reconstruction baseline, and PIXAR the autoregressive baseline with binary visual input. The comparison also includes CLIPPO and DONUT. Their objectives reflect different uses of image inputs, so they broaden the comparison beyond systems designed around exactly the same training task. The text-based bidirectional baseline is [BERT](https://md.research.elamur.ai/free/en/papers/devlin-2019-bert-pre-training-deep-bidirectional/).

Text and pixel systems on the reported GLUE aggregate PixelGPT narrowly leads the visual systems with reported aggregates and trails the text baselines.

**The numbers**

| System or setting | GLUE aggregate score |
| --- | --- |
| DONUT | 57.2 |
| PIXAR | 74.0 |
| PIXEL | 74.1 |
| PixelGPT (this paper) | 74.2 |
| GPT-2 | 75.6 |
| BERT | 80.0 |

PixelGPT's proximity to PIXEL on the aggregate establishes that predicting forward through a line of rendered text can support competitive performance relative to a system trained to reconstruct masked regions. The task rows show where the systems differ. On QQP, PixelGPT posts an F1 of 86.0 against PIXEL's 84.5. On RTE, PixelGPT reaches 63.9 accuracy and PIXEL reaches 60.5. WNLI also favors PixelGPT in the reported evaluation, at 59.2 accuracy against 53.8 for PIXEL. These are examples of the paper's claim that bidirectional pretraining is unnecessary for obtaining competitive results on some understanding tasks.

The same comparison favors PIXEL on other tasks. PixelGPT gets 84.6 F1 on MRPC, where PIXEL gets 88.2. On STS-B, the corresponding Spearman scores are 80.3 and 81.1. PixelGPT records 35.3 MCC on CoLA, while PIXEL records 38.4. The closeness of the aggregates therefore comes from results with different directions across the underlying tasks. The paper provides evidence for the viability of the causal training route while leaving room for each approach to have task-specific strengths.

The comparison with GPT-2 is similarly mixed. PixelGPT's 80.3 Spearman score on STS-B is higher than GPT-2's 74.9, and its 84.6 F1 on MRPC is higher than GPT-2's 71.5. On RTE, GPT-2 reports 52.0 accuracy, below PixelGPT's 63.9. Yet GPT-2 reaches 77.0 MCC on CoLA and 92.5 accuracy on SST-2, where PixelGPT reaches 35.3 and 90.1. The benchmark measures a range of behaviors, and the pattern provides a more precise account than calling the two systems equivalent on language understanding as a whole.

The baselines also differ in capacity. In the GLUE comparison, the PixelGPT result is for a system with 317M parameters, while PIXEL is listed at 86M and GPT-2 at 126M. BERT is listed at 110M. These are performance comparisons between trained systems, with size, objective, and input representation among the properties that differ. In particular, the near tie between PixelGPT and PIXEL says that the causal design is feasible at the settings used. An efficiency claim would require a comparison that accounts for their different sizes and training histories.

#### Multilingual inference with and without translated task training

XNLI takes a pair of sentences and asks whether one entails the other, contradicts it, or leaves the relationship neutral. Entailment means that the first sentence provides enough information to infer the second. Contradiction means the two claims conflict in the required judgment. A neutral pair gives too little information to infer either outcome. The benchmark extends MultiNLI across 15 languages. The validation and test material was translated by people, and the English training material was machine-translated for use in the other languages.

The paper evaluates two protocols. Translate-Train-All combines the English task training data with translated task examples in the other 14 languages. This gives the system the opportunity to learn from labeled examples in the writing systems and languages found at evaluation. In the cross-lingual transfer setting, task training uses English alone and the evaluation covers the multilingual test sets. The difference is consequential for a visual approach. A familiar rendering process can produce inputs for each language under either protocol, but the opportunities to learn how those inputs express the inference relation differ. The protocol follows the discussion of cross-lingual evaluation in [XLM-R](https://md.research.elamur.ai/free/en/papers/conneau-2020-unsupervised-cross-lingual-representation-learning/).

Average XNLI accuracy with Translate-Train-All fine-tuning PixelGPT edges ahead of PIXEL and approaches English-pretrained BERT, while multilingual pretraining leads the comparison.

**The numbers**

| System or setting | accuracy % |
| --- | --- |
| PIXEL | 62.8 |
| PixelGPT (this paper) | 63.2 |
| BERT | 63.9 |
| mBERT | 74.8 |
| XLM-R base | 79.1 |

The pretraining language counts help explain what these comparisons test. The paper lists 1 for PixelGPT, PIXEL, and BERT in this experiment. It lists 104 for mBERT and 100 for XLM-R base. Giving the English-pretrained systems translated task examples allows them to learn from those languages during adaptation. The multilingual systems have much broader pretraining exposure as well. The averages show how much stronger the latter systems are under the reported protocol. They also show that PixelGPT can come close to a text baseline with a comparable pretraining language count, given multilingual supervision for the task.

The comparison with English-pretrained BERT varies noticeably by language. On the Thai Translate-Train-All evaluation, PixelGPT records 47.0% accuracy, BERT 35.7%, and PIXEL 50.2%. On Chinese, PixelGPT records 50.5%, BERT 46.2%, and PIXEL 52.0%. Those results illustrate that PixelGPT's advantages over BERT can occur on scripts where the bidirectional pixel baseline is also helpful and still scores higher. In Arabic, PixelGPT has 55.4% accuracy, PIXEL 58.9%, and BERT 64.8%. The ability to draw a script without consulting a vocabulary opens a route to learning from the examples, while the outcomes still depend on the language and comparison.

Results in other languages explain some of PixelGPT's lead over PIXEL in the average. In the same Translate-Train-All setting, the French accuracies are 71.2% for PixelGPT and 69.4% for PIXEL. The Greek accuracies are 67.4% and 64.9%, and the Spanish accuracies are 71.4% and 70.3%. These differences occur under supervised exposure to the translated task data. They show that RGB next-patch training can give the decoder useful resources for multilingual adaptation, even though the resulting scores fall well below those of the multilingual text baselines in the overall comparison.

With English-only task training, the gap is more pronounced. The main cross-lingual transfer table gives PixelGPT 39.8% average accuracy and XLM-R base 76.2%. In that table, MonoGPT reaches 42.1% and DualGPT reaches 42.0%, both using pixel input. The results indicate a benefit from adding textual training when performance is averaged across languages in this setting. They also show how little separates the paired and unpaired versions on that particular comparison. The multilingual XLM-R baseline remains substantially ahead of both.

The English evaluations inside the same table provide a useful check on what the average represents. With English-only task training and pixel input, PixelGPT scores 75.1% on English, MonoGPT 67.1%, and DualGPT 71.0%. In French, those configurations reach 42.2%, 47.5%, and 47.2%. In Greek, they reach 37.0%, 44.2%, and 39.6%. An improvement in the average can therefore coexist with a decline on English and different rankings across the transfer languages. Including English in an overall multilingual average makes the language rows important to the interpretation.

#### Comparing the joint training configurations

The main comparison of TextGPT, MonoGPT, and DualGPT is designed around similar exposure to standalone text tokens, alongside differences in visual and paired training. The paper reports 40 billion text tokens for TextGPT, and 40 billion text tokens plus 40 billion image patches for MonoGPT. The DualGPT run is reported at 38.4 billion standalone text tokens, 48 billion patches, and 9.6 billion tokens of paired image-text data. These budgets describe what the systems encountered during the compared runs. An image patch and a text token cover text in different ways, so the counts describe sequential training units rather than equal quantities of linguistic content.

GLUE aggregate by pretraining recipe and fine-tuning input With text input, DualGPT has the highest aggregate, and with pixel input it improves on MonoGPT.

**The numbers**

| System or setting | GLUE aggregate score |
| --- | --- |
| TextGPT, text input | 76.3 |
| MonoGPT, text input | 75.4 |
| MonoGPT, pixel input | 64.8 |
| DualGPT, text input (this paper) | 76.9 |
| DualGPT, pixel input | 69.4 |

The text-input results show a benefit from the full DualGPT recipe. Exposure to separate text and images in MonoGPT produces a lower aggregate than TextGPT, while DualGPT with paired examples reaches the highest of the reported settings. The task results are more varied. On CoLA, the text-input scores are 47.3 MCC for TextGPT, 40.2 for MonoGPT, and 49.0 for DualGPT. On STS-B, the Spearman scores are 85.8, 83.8, and 85.4. The former supports a benefit from the DualGPT recipe over both alternatives on that task. The latter shows recovery relative to MonoGPT while leaving TextGPT ahead.

With pixel input, paired pretraining helps DualGPT relative to MonoGPT on several GLUE tasks. The reported QQP F1 goes from 78.9 in MonoGPT to 82.8 in DualGPT. STS-B moves from 73.2 to 80.2 on Spearman correlation, and RTE accuracy goes from 59.9 to 66.4. The RTE score also exceeds TextGPT's 63.5. On that task, using an image at fine-tuning can be compatible with the strongest score in the comparison. The wider GLUE average still favors text input. Both observations are necessary to describe the result accurately.

The XNLI comparison under Translate-Train-All looks different from GLUE. Table 5 gives TextGPT 62.3% average accuracy. With text input, MonoGPT reaches 61.9% and DualGPT reaches 62.7%. With pixel input, MonoGPT reaches 58.4% and DualGPT reaches 62.5%. The two input formats of DualGPT are close on this average, and the pixel condition is slightly ahead of TextGPT. A joint training strategy that gives different outcomes on the two benchmarks may be valuable for particular representations and tasks without yielding a single ranking that holds across all of them.

The language rows illustrate how that average is assembled. In the comparison using translated task training, DualGPT with pixel input reaches 71.7% in English, 67.6% in Bulgarian, and 68.4% in French. The corresponding TextGPT scores are 72.4%, 62.8%, and 65.0%. Using a visual input here changes how performance is distributed across languages. The experiment allows translated supervision during fine-tuning, so the observations concern the combination of pretraining, the chosen representation, and adaptation on labeled multilingual examples.

### What the ablations show

#### Pairing is more helpful than separate exposure in several settings

The progression from TextGPT to MonoGPT to DualGPT tests competing accounts of joint training. If separate exposure to both formats were sufficient for a general gain, MonoGPT would be expected to improve on TextGPT when evaluated on text. The main GLUE and Translate-Train-All XNLI aggregates go the other way for that comparison. DualGPT's text-input results recover the difference, and supplying paired data is also associated with a clearer improvement over MonoGPT when the downstream input is visual. The evidence therefore favors the configuration that repeatedly places the two versions of the same content together.

The authors interpret this as evidence that pairing can reduce competition between the visual and text objectives. In the architecture, one reason this is plausible is that a text prediction in a paired example can use earlier image information about the passage it is currently reading. In an unpaired text sequence, this opportunity never arises, even though the shared network also trains on images in other examples. The paired task supplies a reason to make visual features useful for the token head. The experiments measure the downstream consequence of this setup. They do not directly measure whether particular layers agree better across formats or whether the gradients from the two losses conflict less.

There are also multiple differences between the recipes. Batch size, the tally of standalone image patches, and the availability of pairs vary together. The authors supplement the comparison with curves at similar total volumes, which helps address whether DualGPT simply has more processed units at a particular point. Even there, equal totals can contain different mixtures. The most direct empirical reading is that the paired recipe often works better in the settings studied. The proposed explanation of reduced competition is an interpretation of that pattern instead of a separately measured mechanism.

#### Scaling changes the comparison

The authors trace GLUE performance over a range from 10 billion to 240B training tokens or patches. At 10B, the GLUE scores for the pixel-input variants are all under 55%, while the text-input variants are described as near 70%. That early separation is useful because it shows that the strength of PixelGPT at later evaluations was achieved after substantial training. A pixel system judged only at the early point would give a substantially different impression of the feasibility of next-patch learning.

As training volume increases, the pixel curves rise. PixelGPT overtakes the reference PIXEL score at around 200B in the GLUE plot and comes within the paper's reported less than 5-point differential of TextGPT. The picture is one of convergence over the observed range. The study does not locate a later point where pure pixel training establishes a sustained advantage over the text baselines. The curves also show that DualGPT is generally ahead of MonoGPT at comparable volumes, with the distinction more visible when the task is presented in pixels.

The authors find a related change on XNLI under Translate-Train-All. PixelGPT improves with more training and, at the 200B point described in the analysis, surpasses PIXEL and reaches a level the authors characterize as matching BERT. That description refers to the scaling analysis, while the main comparison table lists PixelGPT at 63.2% and BERT at 63.9%. Both accounts describe closeness under the translated-training protocol. The numerical result in the table and the reading of the training curve are different forms of evidence about that comparison.

The XNLI curve also shows a comparatively strong early effect for paired pretraining. At 10B tokens or patches, DualGPT with pixel input is reported at 55% accuracy, while MonoGPT with pixel input is at 45.8%. The authors say that the advantage tapers as training volume increases. Pairing may therefore help a decoder obtain useful visual features earlier, when separate experience with images and strings has had less time to accumulate. The gap at the start of training does not by itself tell how the two recipes compare at a much larger scale.

TextGPT also improves with volume. The authors report that it passes the BERT reference on the XNLI Translate-Train-All curve at approximately 100B text tokens. They offer the byte-level tokenizer and the diversity of the text corpus as possible reasons. That explanation bears on the interpretation of the visual results as well. A text baseline's behavior depends on which tokenizer and corpus it uses. The curves do not isolate the contribution of either change, so they support the reported outcome for TextGPT more directly than an account of why it outperforms BERT in that setting.

#### Giving the task both representations

The authors isolate a different choice at fine-tuning by comparing text input with a concatenated rendering and string for MonoGPT and DualGPT. This asks whether the image has value at task time after the shared decoder has already received visual training. The task label is the same whichever input is used. The paired version gives the system both ways to inspect the example, and the padding mask removes irrelevant blank positions between the two parts.

In the English-only fine-tuning comparison on XNLI, MonoGPT averages 39.5% with text input and 41.1% with both formats. For DualGPT the corresponding averages are 40.3% and 40.9%. In the same comparison, MonoGPT's English accuracy falls from 79.9% to 77.5%, while DualGPT's English accuracy falls from 79.1% to 75.2%. Thus the average goes up for both systems while the score for English alone falls. Using both forms can change the balance between English and the transfer languages, even when it improves the headline average.

The authors also report improvements in the combined-input comparison under Translate-Train-All. These experiments concern input at adaptation time, whereas the MonoGPT and DualGPT pretraining comparison concerns the examples from which the shared decoder initially learns. The two findings are compatible. Explicit correspondences can be valuable during pretraining, and supplying an image alongside text can add something during adaptation even for MonoGPT, which learned from the two formats independently. The experiments do not show that either contribution has the same size or direction for every language.

#### Batch size and font affect different parts of the pipeline

For visual tasks the authors observed that fine-tuning could be sensitive to the global batch size. They compare 64, 128, 256, and 512 on selected GLUE tasks, using QQP, CoLA, and STS-B to illustrate the behavior. Performance tends to improve as the batch grows in that analysis. Because a batch supplies the examples used for an update, a larger one can average over more variation in the input. The authors propose this as a reason that the visual runs appeared more stable with larger batches.

The observation can inform how the benchmark scores are understood. Some of the performance of a visual system depends on finding an adaptation setting that makes effective use of pretraining. A single setting applied uniformly might understate what a particular task can achieve, while a broad search makes the best score dependent on the search procedure. The reported trend concerns the selected datasets and batch sizes. The authors' suggested explanation about avoiding poorer solutions is a training interpretation alongside the measured performance trend.

The font experiment changes how the task data is drawn while keeping the pretrained starting point. GoNotoCurrent is the pretraining font. NotoSerif-Regular is described as relatively similar, while JournalDingbats1 depicts the text using symbols whose appearance differs substantially from the pretraining font. Using that last font is a stronger intervention than a change in the visual style of familiar letters. It tests whether the checkpoint can adapt to written forms that differ markedly from the ones on which it initially learned.

The authors test these fonts on CoLA, STS-B, MRPC, RTE, and WNLI. They describe performance as stable across fonts for the selected tasks except CoLA. That exception matters because the benchmark evaluates acceptability, a different judgment from the sentence relation and similarity tasks also examined. The observed stability concerns fine-tuning with the new renderings. Labeled training in the unfamiliar font gives the system an opportunity to adapt its representations. The experiment consequently supports adaptability to changes in typography, including a pronounced visual shift, under the given fine-tuning procedure.

#### Color has a clearer role when the task can use it

One rendering experiment compares adaptation in RGB, grayscale, and binary images on XNLI, starting from RGB pretraining. The authors first generate the RGB images. A grayscale conversion reduces the representation to a single intensity channel, and the binary conversion thresholds that intensity at 128 to obtain values of 0 or 255. For the single-channel versions, the authors initialize a compatible input projection by averaging the learned projection weights across the original channels. They then fine-tune that adapted system. This keeps the question focused on what happens when the downstream representation changes.

Under Translate-Train-All, the rendering comparison reports 63.2% average accuracy with RGB, 63.0% with binary images, and 62.0% with grayscale. Under the English-only transfer protocol in that comparison, the respective averages are 41.5%, 41.3%, and 41.2%. These values belong to the rendering study, which reports its own fine-tuning results alongside the main XNLI comparisons. They show that reducing the visual input to a single channel can retain much of the reported inference performance after adaptation. The RGB scores are highest in these averages, with different rankings possible for individual languages.

The color-specific hypothesis is tested on HatemojiBuild. Its 5,912 examples were constructed through an adversarial process involving people and a system, with emoji contributing to the meaning of potentially hateful messages. The experiment uses Apple Emoji for both conditions and compares fine-tuning on RGB with fine-tuning on grayscale. The reported accuracy is 61.4% for RGB, against 58.7% for grayscale. The paper illustrates the comparison with examples where the color and grayscale predictions differ. The proposed explanation is that the retained color provides information about how to interpret some of the emoji in context.

The emoji result puts the smaller XNLI differences in perspective. In XNLI, the target is a relation between written sentences and many examples can retain the relevant cues after their colors are removed. HatemojiBuild makes meaning carried by the visual symbols part of the judgment. The comparison shows a gain on that benchmark with that rendering setup. It gives the decision to retain color an empirical basis while leaving open how much color contributes to other tasks or to the quality of pretraining itself.

### Limitations

#### Limits the authors state

The authors describe the study as exploratory and identify capacity and training volume as constraints. The architecture uses 24 decoder layers, and they leave the behavior of configurations with 7B, 13B, 70B, or over 100B parameters untested. Their limitation statement describes the available compute in terms of runs on the order of 100 to 200 billion tokens or patches, while the scaling analysis gives a plotted span extending to 240B. They point to training on more than 1,000 billion units as a question for future work. The observed trends show improvement within their range and leave larger-scale behavior open.

The paper also identifies a gap between learning to predict patches and producing useful text. PixelGPT operates on visual input and forecasts visual output. If the desired output is a text string, another step must recognize the characters in the generated image. The authors point out that OCR at this stage can introduce errors and add complexity. This distinction affects how the paper's results should be used. An autoregressive training objective establishes how the sequence is learned. The downstream results principally evaluate classification and similarity judgments, which can use a task head without ever asking the system to render and transcribe a long continuation. The unresolved use case is [text generation](https://md.research.elamur.ai/free/en/topics/text-generation/).

Finally, the authors call for broader testing of the approach and discuss privacy and fairness considerations for multilingual visual text. They raise the possibility of training-data biases and the need to assess performance across languages and cultural settings. The language comparisons in XNLI identify differences in benchmark accuracy. A fairness assessment would address different questions about the affected populations, the data, and the consequences of errors. The paper presents those concerns as considerations for the approach, alongside its discussion of potential misuse.

#### Limits visible in the experimental setup

The strongest visual baseline comparisons change several things at once. PixelGPT's 317M parameters and PIXEL's 86M parameters illustrate the difference in capacity, and their direction of attention, input channels, and training objectives also differ. PIXAR is closer in training direction but uses binary input and a classification loss. It is therefore possible to say that the complete PixelGPT approach reaches competitive results with the settings used. Determining how much each design choice contributes would require a comparison holding the others fixed.

The same qualification applies when comparing pure pixel and pure text training. The underlying source collections have overlapping genres, but the paper describes a broader mix for the text route. Additionally, the token and patch counts measure different units. A patch can hold an incomplete glyph, while a sub-word unit has boundaries defined by the tokenizer. Equal totals do not establish equal reading exposure, and the plots describe training volume without providing a full comparison of elapsed time or total computation. They give evidence about how strongly scores depend on training progress, with efficiency across input types still an open question.

For the pairing analysis, standalone text exposure is similar in the comparison the authors highlight, and including DualGPT supplies a test of a realistic paired recipe. Its mixture and batch size also differ from MonoGPT's. It remains possible that both the alignment of corresponding examples and the change in the number and balance of units explain part of the gain. The comparison at similar training volumes strengthens the case for the recipe as a whole. The claim that modality competition is reduced reaches beyond the quantities directly measured by the benchmark.

The multilingual experiments likewise set conditions on the conclusions. Translate-Train-All allows training on task examples in the evaluation languages and is a test of how well the system adapts when such material is available. The lower English-only transfer scores show that a common image representation can coexist with large differences in language knowledge. The multilingual text baseline has a very different pretraining language count, which establishes the performance of a stronger reference under that protocol. It does not identify how a pixel approach would compare if pretrained on a similarly multilingual collection.

The images used to train PixelGPT were generated from strings with a consistent renderer and horizontal strip structure. That gives the system valuable access to the visible form of text, with tests for selected changes in font and color. It leaves open questions about pages where the reading order is ambiguous, where several layout regions compete for attention, or where the visual data comes from an imperfect scan. Likewise, the font and monochrome comparisons give access to the altered inputs during task training. They measure adaptation under those interventions. Immediate recognition without any adaptation would require a different evaluation.

The RGB comparisons also answer a narrower question than whether color is essential to pixel pretraining. The XNLI rendering experiment starts with an RGB-pretrained checkpoint and changes the downstream input and its projection. The emoji study shows a benefit from retaining color for that specific task. Evidence about the cost or value of color throughout pretraining would require tracking what changes when the entire training procedure starts from a different representation. The reported comparisons establish that preserving color can matter when the task draws on it and that an RGB checkpoint can adapt to reduced-channel inputs.

### What came after

There are no documented later works to trace. The paper itself points to larger-scale training and generation from visual sequences as open directions. It also leaves a specific question about the relationship between the two formats. Pairing improved several results when labeled task examples were available, while English-only transfer remained difficult. Whether broader multilingual pretraining can turn the shared patch representation into stronger transfer is unresolved by these experiments.

## Cite

Cite as Yekun Chai, Qingyi Liu, Jingwu Xiao, Shuohuan Wang, Yu Sun and Hua Wu. 2024. Autoregressive Pre-Training on Pixels and Texts. Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing.

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.18653/v1/2024.emnlp-main.182](https://doi.org/10.18653/v1/2024.emnlp-main.182)

```bibtex
@inproceedings{chai2024autoregressive,
  title = {{Autoregressive Pre-Training on Pixels and Texts}},
  author = {Yekun Chai, Qingyi Liu, Jingwu Xiao, Shuohuan Wang, Yu Sun and Hua Wu},
  booktitle = {Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.emnlp-main.182},
  url = {https://doi.org/10.18653/v1/2024.emnlp-main.182}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
