liveBook · Manning

Decode

Decoding is the process of transforming an encoded or internal representation into an interpretable or target-form output.

How 15 Manning books explain it

Build a Text-to-Image Generator (from Scratch)

A sequence decoder is a neural-network component that generates an output sequence from contextual representations and previously generated elements.

How it is used
Generates translations and captions token by token, or reconstructs images from compressed representations.
How deep it goes
Works through masked self-attention, cross-attention, training targets, and inference loops; uses a pretrained VAE rather than building its decoder.
Examples
Uses German-to-English translation, image-caption pairs, and comparisons of original versus VAE-reconstructed images.
What you can do after
Build it from scratch for translation or captioning, and apply a pretrained VAE decoder to reconstruct latent images.

Read how Build a Text-to-Image Generator (from Scratch) explains decode →

Learn Generative AI with PyTorch

How it is used
Turns latent image representations into reconstructions or generates translation tokens from an encoded sentence and earlier output.
How deep it goes
Works through training steps, PyTorch decoder layers, tensor shapes, and a Transformer decode method; treats denoising U-Net decoding more briefly.
Examples
Uses handwritten-digit reconstruction, sampled human-face generation, English-to-French translation, and image denoising.
What you can do after
Build it from scratch: implement image decoders and an encoder–decoder Transformer, then use trained models to reconstruct images or translate phrases.

Read how Learn Generative AI with PyTorch explains decode →

Causal AI

A neural decoder is a neural network component that maps a latent or compressed representation to an output representation.

How it is used
Models nonlinear causal Markov kernels for images and supplies distribution parameters in VAE-inspired causal models.
How deep it goes
Works through a PyTorch decoder, variational training, evaluation, and a pretrained counterfactual application; flags assumptions needed beyond simple images.
Examples
Uses labeled digit reconstruction, randomly generated images, dSprites shape changes, and engagement and purchase distribution models.
What you can do after
Build it from scratch with PyTorch and Pyro for labeled-image generation, then evaluate reconstructions and generated images.

Read how Causal AI explains decode →

Deep Learning with Python, Third Edition

The part of an autoencoder or variational autoencoder that maps a latent representation back into an output space such as images.

How it is used
Maps latent points back to images for autoencoder reconstruction and VAE image generation.
How deep it goes
Works through a Keras decoder architecture, VAE sampling, training, and a latent-space grid rather than stopping at a definition.
Examples
Uses an MNIST digit VAE and a grid of two-dimensional latent points decoded into images.
What you can do after
Build it from scratch in Keras to reconstruct MNIST digits and generate images from sampled latent points.

Read how Deep Learning with Python, Third Edition explains decode →

Deep Learning with R, Third Edition

A decoder network is a neural-network component that maps a latent representation back to an output such as a reconstructed image.

How it is used
Turns encoded source sentences into target tokens for translation, or latent points into reconstructed images in an autoencoder.
How deep it goes
Works through GRU-based translation decoding and a convolutional VAE decoder, including architecture, training, and generation examples.
Examples
Uses English-to-Spanish translation and MNIST digits generated from a grid of two-dimensional latent points.
What you can do after
Build it from scratch with R/Keras to generate translations or decode latent points into MNIST digit images.

Read how Deep Learning with R, Third Edition explains decode →

Math and Architectures of Deep Learning

The reverse mapping that reconstructs data from a reduced representation.

How it is used
Reconstructs inputs from compact latent representations in PCA, autoencoders, and variational autoencoders.
How deep it goes
Defines decoding geometrically and procedurally, then implements convolutional decoders and VAE reconstruction losses in PyTorch.
Examples
Uses reduced 3D PCA data, 32×32 convolutional image reconstruction, and MNIST autoencoder and VAE reconstructions.
What you can do after
Apply it via PyTorch to construct transposed-convolution decoders and train reconstructed outputs against input images.

Read how Math and Architectures of Deep Learning explains decode →

Optimization Algorithms: AI techniques for design, planning, and control problems

A decoder is a neural-network component that generates an output sequence from prior outputs, hidden states, and encoded input information.

How it is used
Generates ordered selections of input points for a pointer-network convex hull and extracts information from graph embeddings.
How deep it goes
Explains recurrent decoder inputs, attention scores, softmax pointers, and context vectors, then shows training and testing without implementing the decoder from scratch.
Examples
Uses a four-point hull sequence and a ConvexNet experiment on random 2D points, checked against SciPy’s ConvexHull.
What you can do after
Apply it via PyTorch ConvexNet to predict convex-hull vertices and assess pointer accuracy and hull overlap across input sizes.

Read how Optimization Algorithms: AI techniques for design, planning, and control problems explains decode →

Grokking AI Algorithms, Second Edition

Text decoding is the conversion of a model's internal numerical representations into human-readable language.

How it is used
Converts an LLM’s internal numerical representations into next-token predictions that support generated text.
How deep it goes
Explains decoding’s place after self-attention and its probability-distribution output, without detailing how a token is selected.
Examples
Uses a single-paragraph training setup to trace the workflow while noting its limited ability to produce intelligent results.
What you can do after
Evaluate/understand where next-token predictions arise in a Transformer and distinguish text decoding from U-Net image reconstruction.

Read how Grokking AI Algorithms, Second Edition explains decode →

Transformers in Action

The component of a sequence model that generates an output sequence from encoded representations and contextual information.

How it is used
Generates an output sequence from encoded input context in sequence-to-sequence translation.
How deep it goes
Explains decoder roles across RNNs and transformers at the component level, without supplying a standalone decoder implementation.
Examples
Uses an English-to-French sentence translation to contrast recurrent and transformer decoding.
What you can do after
Evaluate/understand how RNN and transformer decoders turn encoded input information into a translated sequence.

Read how Transformers in Action explains decode →

Learn Go with Pocket-Sized Projects

Decode is a JSON decoder method that reads JSON input and stores the decoded result in a supplied Go value.

How it is used
Parses a JSON file into Go structures while loading bookworm data.
How deep it goes
Explains JSON tags, exported fields, slice destinations, pointer passing, and errors, while deferring explicit streaming.
Examples
Uses bookworms.json, Bookworm and Book structures, loadBookworms(), and printed decoded records.
What you can do after
Apply it via encoding/json to decode a file into a typed slice and return or report errors.

Read how Learn Go with Pocket-Sized Projects explains decode →

Deep Learning with PyTorch, Second Edition

A tokenizer function that converts numeric token representations back into text.

How it is used
Provides tokenizer-side text reconstruction alongside encode in a custom dataset and model-training workflow.
How deep it goes
Defines decode and demonstrates binding tokenizer.decode, but does not detail the reconstruction rules or implementation internals.
Examples
Uses a WordLevel tokenizer trained on The Odyssey and pairs decode with encoded ID sequences used for language-model training.
What you can do after
Apply it via the tokenizers library to expose text reconstruction from a trained tokenizer.

Read how Deep Learning with PyTorch, Second Edition explains decode →

How Large Language Models Work

Decoding is the process of converting a model’s internal representation or token distribution into output tokens or text.

How it is used
Uses token selection to turn an LLM’s internal representation into generated text and to constrain its output format.
How deep it goes
Explains unembedding, probability-based sampling, autoregressive repetition, stopping conditions, and format checks without deriving the underlying mathematics.
Examples
Uses “I love to eat” completions and invalid Python formatting to illustrate selection and constrained generation.
What you can do after
Evaluate how LLMs generate text token by token and apply format checks or regeneration during output.

Read how How Large Language Models Work explains decode →

Generative AI in Action

A decoder is a neural-network component that generates or reconstructs output data from an internal representation or sampled latent state.

How it is used
Generates language-model completions or reconstructs and varies data from latent representations.
How deep it goes
Explains inputs, iterative token prediction, and latent-state reconstruction without deriving decoder internals mathematically.
Examples
Uses next-token text completion, image generation, reconstruction, inpainting, and varied outputs from sampled latent states.
What you can do after
Evaluate how language and image-generation systems transform representations into sequential or reconstructed outputs.

Read how Generative AI in Action explains decode →

Natural Language Processing in Action, Second Edition

Decoding is the transformation of a machine representation back into a human-interpretable or otherwise target-form output.

How it is used
Converts numerical model outputs into readable language during natural language generation.
How deep it goes
Explains decoding as inverse encoding and extends it to decoder layers, feedback, and token-selection algorithms.
Examples
Uses an NLG decoding diagram and Transformer diagrams showing decoder feedback and alternative output-token selection.
What you can do after
Evaluate/understand how generated numerical sequences become readable text and how Transformer decoders select successive tokens.

Read how Natural Language Processing in Action, Second Edition explains decode →

LLMs in Production

A decoder is a neural-network component that generates an output sequence from an internal representation and, typically, previously generated tokens.

How it is used
Uses decoders for natural language generation, including streaming chatbot and storytelling output.
How deep it goes
Explains next-token generation, shifted-right outputs, attention blocks, strengths, and hallucination risks without detailing training procedures.
Examples
Uses GPT for decoder-only generation and translation or summarization for encoder-decoder generation.
What you can do after
Evaluate decoder-based generation by relating next-token prediction, streaming, conditional tasks, and hallucination risks to use cases.

Read how LLMs in Production explains decode →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.