liveBook · Manning

BART

As explained in Build a Text-to-Image Generator (from Scratch)

BART is a denoising sequence-to-sequence transformer model whose encoder is bidirectional and whose decoder is autoregressive.

BART is a sequence-to-sequence transformer that combines a bidirectional encoder for full prompt context with an autoregressive decoder for token generation. This combines strengths associated with BERT-style understanding and GPT-style decoding. section 12.1.1 section 1.2

A text-to-image pipeline assigns BART these sequential roles:

  • Tokenize the prompt and pass it through the pretrained BART encoder, producing dense text representations. section 12.0 section 12.1.1
  • Condition the BART decoder on those representations and autoregressively predict a sequence of image tokens. section 1.2.2 section 12.1.1
  • Pass the predicted tokens to a VQGAN decoder, which reconstructs image patches and produces the complete image. section 12.1.1

Prompt-to-image generation

For “panda with a top hat reading a book,” BART encodes the prompt and generates image tokens sequentially. VQGAN decodes those tokens into the resulting image, which can be viewed as it develops through 32, 64, 128, and eventually 256 patches. section 12.0 section 1.2

Figure 1.5 How DALL-E mini is trained to generate an image based on a text prompt

The training diagram traces image encoding, BART encoding and decoding, token alignment, and image reconstruction in DALL-E mini. section 1.2.2

How Build a Text-to-Image Generator (from Scratch) covers it

How deep it goes
Explains encoder-decoder roles, token flow, training alignment, and autoregressive prediction, stopping short of internal layer implementation.
Examples
Uses paired image-caption data, discrete image tokens, and the prompt “panda with a top hat reading a book.”
What you can do after
Build it from scratch as a text-to-image pipeline that encodes prompts, predicts image tokens, and reconstructs images.
How it connects
Connects bidirectional encoding with BERT, autoregressive decoding with GPT, and image reconstruction with VQGAN.

Also explained in

Compare how 2 books explain BART →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build a Text-to-Image Generator (from Scratch). The section links point to the parts of the book it draws on.