liveBook · Manning

Sequence prediction

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

A prediction task in which a model generates or estimates elements of an ordered sequence.

Sequence prediction estimates or generates ordered elements one at a time. Unlike single-output prediction, it produces a sequence whose later steps depend on earlier context, such as tokens in translation or image patches in generation. section 2.1.2 section 1.7

A transformer sequence-prediction pipeline typically proceeds as follows:

  • Encode the input sequence into representations that capture its meaning or cross-element relationships. section 2.1.2 section 2.1
  • Condition the decoder on the encoded input and the tokens already generated. section 2.1.2
  • Predict the next element, append it to the input sequence, and repeat until an end-of-sequence token appears. section 2.1.2

German-to-English translation

Given “Wie geht es dir,” the decoder begins with BOS, predicts “How,” then uses BOS How to predict the next token. It stops when it predicts EOS. section 2.1.2

Text-to-image generation

A text-to-image model can treat an image as a sequence of patches, predicting patches from top-left to bottom-right. A DALL-E-style system instead encodes text, predicts image tokens autoregressively, and reconstructs them into image patches. section 1.7 section 12.1.1

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

How deep it goes
Explains iterative decoding, BOS and EOS tokens, attention, and multimodal pipelines, but stops short of training equations.
Examples
Uses German-to-English translation, image patches, and DALL-E-style text-to-image generation as concrete sequence-prediction examples.
What it assumes
Assumes familiarity with tokens and transformers while illustrating sequence generation through translation and image-generation examples.
What you can do after
Evaluate how models generate translations or images by tracing encoded inputs, prior outputs, next-element predictions, and stopping conditions.
How it connects
Connects sequence prediction to transformers, attention, autoregressive decoding, machine translation, and multimodal generative models.

Also explained in

Compare how 3 books explain sequence prediction →

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.