Generation
Generation is the computational production of outputs from supplied inputs or context, often by applying a model to produce predictions or new content.
Learn Generative AI with PyTorch
A language-modeling task in which new text is produced without conditioning on a specific task label, here using a generic or empty prompt.
- How it is used
- Uses generic-prompt text generation to sample a trained language model and check whether its output copies training passages.
- How deep it goes
- Works through token-index sampling and output comparison; requires a placeholder because the generation function rejects an empty prompt.
- Examples
- Compares repeated `UNK`-prompt passages from Hemingway-style models trained for 20 and 40 epochs.
- What you can do after
- Practice/perform generic-prompt generation with a trained GPT-style model and inspect its output for copied training text.
Read how Learn Generative AI with PyTorch explains generation →
Deep Learning with Python, Third Edition
The process of producing new text token by token from a trained language model, often by feeding previous outputs back as inputs.
- How it is used
- Extends a prompt into new text by repeatedly turning a language model’s next-token prediction into its next input.
- How deep it goes
- Works through prompt priming, explicit GRU state, token-by-token inference, and sampling choices, without deriving the model’s probability calculations.
- Examples
- Uses a Shakespeare-style character continuation and a GPT-style advice prompt to compare greedy, random, and top-K outputs.
- What you can do after
- Build it from scratch as a prompt-conditioned generation loop and apply Keras sampling functions to vary token selection.
Read how Deep Learning with Python, Third Edition explains generation →
Natural Language Processing in Action, Second Edition
Natural language generation, or text generation, is the computational production of human-readable natural-language text.
- How it is used
- Composes readable responses, summaries, completions, and code within NLP applications.
- How deep it goes
- Explains decoding and iterative next-word probabilities, with temperature as a selection control; leaves detailed model implementation aside.
- Examples
- Uses chatbot replies, search summaries, TypeScript code suggestions, and a Python bigram-autocomplete exercise.
- What you can do after
- Build it from scratch as a bigram autocomplete exercise, then evaluate/understand it against LLM completions and factual-grounding limits.
Read how Natural Language Processing in Action, Second Edition explains generation →
Generative AI in Action
Natural language generation is the computational production of human-readable language from structured or unstructured inputs.
- How it is used
- Uses generation to create requested text, from business drafts to application responses.
- How deep it goes
- Explains iterative next-token generation and completion API responses without deriving the model’s mathematics.
- Examples
- Demonstrates a launch-email prompt, pet-salon name ideas, and a completion API response.
- What you can do after
- Apply it via a completion API to request text, inspect the response, and manage token use.
Build a Reasoning Model (From Scratch)
The process of producing new textual output from a language model given prior context or instructions.
- How it is used
- Deploys pretrained language models to generate responses from prompts and support later evaluation and reasoning workflows.
- How deep it goes
- Explains token preparation, logits, argmax, streaming, and KV caching, while deferring attention and architectural internals.
- Examples
- Demonstrates a Berlin completion, streamed decoded output, a cached generation function, and a reusable generation wrapper.
- What you can do after
- Build it from scratch using tokenization, autoregressive decoding, streaming, end-of-sequence handling, and KV-cache optimization.
Read how Build a Reasoning Model (From Scratch) explains generation →
Deep Learning with R, Third Edition
The computational generation of natural-language text by a model.
- How it is used
- Produces new text by extending a prompt one token at a time; also offers a possible source of text-augmentation examples.
- How deep it goes
- Works through next-token selection and an R generation loop, then addresses compilation and fixed input shapes without detailing cached generation.
- Examples
- Shows a miniature GPT continuing “A piece of advice” and compares simple and fixed-length generation functions.
- What you can do after
- Build it from scratch with a miniature GPT generation loop, then apply Keras `predict()` with fixed-length inputs to improve speed.
Read how Deep Learning with R, Third Edition explains generation →
Deep Learning with PyTorch, Second Edition
The task of producing a token sequence as output, conditioned on preceding input or context.
- How it is used
- Uses next-token prediction to produce new text sequences rather than classify or regress over existing data.
- How deep it goes
- Works through character-level training and sampling, then extends the next-token model to causal attention and a transformer decoder.
- Examples
- Shows generated names from a character-level model and a GPT-style decoder.
- What you can do after
- Build it from scratch in PyTorch: train a next-character model and sample names by feeding predictions back as input.
Read how Deep Learning with PyTorch, Second Edition explains generation →
Grokking AI Algorithms, Second Edition
Language generation is the computational production of natural-language text from learned patterns or supplied information.
- How it is used
- Uses language generation to turn prompts or supplied information into draft text that a person can guide and refine.
- How deep it goes
- Explains next-word prediction through autocomplete and names Transformer components, but does not work through a text-generation algorithm.
- Examples
- Illustrates next-word suggestions with mobile autocomplete and practical drafting with product descriptions, ad copy, and learning materials.
- What you can do after
- Apply it via an LLM to create first drafts from prompts or specifications, then review and refine them.
Read how Grokking AI Algorithms, Second Edition explains generation →
Statistics Every Programmer Needs
Prediction is the process of estimating an outcome from patterns or information in input data without necessarily modeling its temporal ordering.
- How it is used
- Uses learned relationships, temporal patterns, or simulated uncertainty to estimate outcomes for decisions and evaluation.
- How deep it goes
- Explains method selection, implementation, comparison with observations, and limitations, but does not develop formal statistical proofs.
- Examples
- Demonstrates decision-tree labels, linear-regression responses, ARIMA stock forecasts, and Monte Carlo stock-price trajectories.
- What you can do after
- Apply it via Python models to generate predictions, compare them with observed values, and interpret accuracy alongside uncertainty and volatility.
Read how Statistics Every Programmer Needs explains generation →
Math and Architectures of Deep Learning
A modeling approach that learns a data distribution so new samples resembling the training data can be generated.
- How it is used
- Models data distributions to generate samples and evaluate how probable new instances are.
- How deep it goes
- Descends from distribution properties through Bayesian parameter estimation, including priors, likelihoods, posteriors, and conjugate families.
- Examples
- Uses cat-image sampling, face-probability estimation, smooth density heat maps, and comparisons with irregular decision boundaries.
- What you can do after
- Apply distribution models to generate samples or estimate probabilities for new data instances.
Read how Math and Architectures of Deep Learning explains generation →
Sutskever's List
A model that learns a data distribution and can sample new data from it.
- How it is used
- Uses learned text distributions to produce new sentences, paragraphs, and multiturn conversations.
- How deep it goes
- Explains conditional token prediction, next-token training, and causal masking without detailing sampling procedures.
- Examples
- Contrasts plausible, grammatically broken, and semantically odd sentences to show how models reflect syntax and meaning.
- What you can do after
- Understand how autoregressive models generate text and how next-token prediction trains them.
Causal AI
A generative model is a model that represents a process for generating observations, typically by specifying a joint or conditional probability distribution.
- How it is used
- Uses latent-variable models to generate observations and produce counterfactual media after interventions.
- How deep it goes
- Explains latent variables, assignment functions, and abduction-action-prediction, then demonstrates sampling without deriving model identification.
- Examples
- Demonstrates gaming outcomes, femur-length height inference, and semantic image editing with generated counterfactual artifacts.
- What you can do after
- Builds counterfactual generators with Pyro or graphical models and evaluates generated outcomes against interventional distributions.
Statistics Slam Dunk
The predict() function is an R function that generates predictions from a fitted model for supplied data, optionally returning interval estimates.
- How it is used
- Applies fitted regression models to test data and evaluates predicted outcomes against observed sports results.
- How deep it goes
- Explains required arguments, confidence intervals, response probabilities, thresholding, and downstream evaluation with errors and classification metrics.
- Examples
- Demonstrates regular-season win forecasts and playoff-qualification probabilities using train-test sports data.
- What you can do after
- Apply it via base R to generate numeric predictions, confidence intervals, or response probabilities for new observations.
Build AI-Enhanced Web Apps
The production of natural-language text by a computational model from an input or context.
- How it is used
- Supports web application features including content creation, marketing copy, conversational agents, customer support, and personalized responses.
- How deep it goes
- Explains the generation workflow and transformer foundations but stops short of implementation code, training procedures, and detailed model internals.
- Examples
- Uses marketing copy, product descriptions, customer-support chatbots, feedback responses, and conversational follow-up as examples.
- What you can do after
- Build it into web applications by routing user prompts through backend services and language-model APIs to deliver generated content.
Digital Twins in Action
Generative AI is a class of artificial-intelligence models that produces new content or data from learned patterns.
- How it is used
- Uses generative AI for natural-language twin queries, simulation-scenario generation, synthetic data, and equipment-specific analysis.
- How deep it goes
- Explains why twin context grounds LLM responses and supports specialized analysis, without detailing model training or an implementation.
- Examples
- Uses a pump-pressure question and a turbine-bearing diagnostic report to illustrate answers grounded in asset and operating data.
- What you can do after
- Evaluate/understand it by judging whether an LLM answer has the asset-specific context needed to avoid a generic response.
Domain-Specific Small Language Models
The task of producing output sequences from a model given an input context or prompt, here applied to proteins rather than natural language.
- How it is used
- Generates protein sequences for novel design and engineering, while framing inference through speed, accuracy, and compute cost.
- How deep it goes
- Explains next-token generation, prompting, model scale, and runtime tradeoffs, but stops short of detailed quality evaluation.
- Examples
- Demonstrates ProtGPT2 prompts, batches of ten generated sequences, and a Transformers inference pipeline.
- What you can do after
- Apply it via Transformers to generate protein sequences from prompts and adjust batch-generation settings.
Read how Domain-Specific Small Language Models explains generation →
Transformers in Action
Natural language generation is the computational production of human-readable language from learned representations or structured information.
- How it is used
- Supports applications such as chatbots, story generation, translation, and other tasks requiring context-sensitive language output.
- How deep it goes
- Descends from sequence-level intuition to causal masking, tokenization, transformer blocks, and decoding strategies.
- Examples
- Uses translation, chatbot responses, story generation, GPT-2-style BPE encoding, and masked-attention code.
- What you can do after
- Evaluate generation pipelines by relating architecture, masking, tokenization, decoding, sampling, and prompting choices to output quality.
AI-Powered Search
A generative model is a model that produces new data or content according to patterns learned from its training data.
- How it is used
- Generates synthesized answers, summaries, and multimodal content directly from queries or analyzed search results.
- How deep it goes
- Defines the paradigm and illustrates its progression and risks, but does not provide implementation steps or model internals.
- Examples
- Uses a preference-based Paris itinerary and generated text, image, audio, and video as concrete examples.
- What you can do after
- Evaluate how generated search responses improve information access while introducing bias, censorship, propaganda, and safety risks.
Build an AI Agent (From Scratch)
A task response is a standardized A2A message returned by an agent server with the result of processing a task request.
- How it is used
- Coordinates the standardized result exchange between A2A clients and agent servers after task execution.
- How deep it goes
- Explains the request-response flow and HTTP role but does not detail the response schema or server implementation.
- Examples
- Uses a math expert agent card and a client-server flow showing discovery, task submission, execution, and result return.
- What you can do after
- Understand how to trace an A2A task from agent discovery through server execution to the returned response.
Read how Build an AI Agent (From Scratch) explains generation →
Learn Go with Pocket-Sized Projects
A response message is a Protobuf message containing the output data for an API operation.
- How it is used
- Structures gRPC endpoint outputs so API changes remain compatible with existing clients.
- How deep it goes
- Explains dedicated message declarations and compatibility rationale, stopping short of generated implementation details.
- Examples
- Uses the CreateHabit endpoint with CreateHabitRequest and CreateHabitResponse containing a Habit field.
- What you can do after
- Build it from scratch by declaring version-tolerant Protobuf responses for gRPC endpoints.
Read how Learn Go with Pocket-Sized Projects explains generation →
Related concepts
- language modelproduced by · A language model is a computational model that represents patterns in linguistic tokens to estimate sequence probabilities and predict or generate language from context.
- variational autoencoderincludes · A variational autoencoder is a generative neural network that learns a probabilistic latent representation of data and decodes samples from it to reconstruct or generate data.
- retrieval-augmented generationpart of · Retrieval-augmented generation is a technique that retrieves relevant information from external sources and supplies it as context to a generative model when producing an output.
- Model Servingequivalent to · A model-serving platform is software infrastructure that hosts trained models and exposes inference by accepting requests and returning model outputs.
- labelcontrasts with · A label is a value or annotation associated with an item that identifies its target category, outcome, or reference answer for learning or evaluation.
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.



















