Most generative AI today runs on a handful of model designs. Transformer-based large language models produce text, multimodal models handle more than one kind of input or output, and diffusion models produce images. This lesson explains how each works at a high level, what a foundation model is, and where prompt engineering fits.
Transformers and large language models
A transformer is a type of neural network designed for sequences such as sentences. Its key idea is self-attention: when processing each token, the model weighs every other token in the input to decide which ones matter for its meaning. In "The bank raised its rates", attention links "bank" to "rates", so the model reads it as a financial bank, not a riverbank.
Older sequence models, such as recurrent neural networks, read text one token at a time and tended to forget details from far back. Transformers process the whole sequence at once, which makes training much faster on modern hardware and handles long passages better. That speed is what made it practical to train the very large models behind today's large language models (LLMs).
An LLM generates text by repeatedly predicting the most suitable next token, adding it, and predicting again, until the response is complete.
Foundation models
A foundation model (FM) is a large model pre-trained on a broad, general dataset, so it can be adapted to many tasks instead of being built for just one. The same FM can summarize a report, answer questions and draft an email. Building one costs a great deal of data and computing power, so most organizations use an existing FM, through a service such as Amazon Bedrock, and adapt it with prompts, retrieval or fine-tuning rather than training their own.
Multimodal models
A multimodal model works with more than one type of data, such as text, images, audio or video. It might take a photo and a question as input and answer in text, or take a text description and produce an image. Amazon Nova, for example, includes models that understand text, images and video, as well as models that generate images and video.
Diffusion models
Diffusion models are the main technique behind AI image generation. During training, the model is shown images that have had random noise added step by step until nothing recognizable is left, and it learns to reverse that process, removing a little noise at a time. To generate a new image, it starts from pure noise and removes noise over many steps, guided by a text prompt that steers the result toward the description. Stable Diffusion is a well-known example. It also works in a compressed version of the image, called latent space, which makes generation far less demanding on computing power.
Prompt engineering
Prompt engineering is the practice of designing the input you give a model, its instructions, context and examples, so the model produces the output you want. It's usually the first and cheapest way to improve results, because it needs no retraining. Domain 3 covers the techniques in detail.
On the exam
Match the model type to the output. Text generation and reasoning point to transformer-based LLMs, and image generation from a description points to diffusion models. Input that mixes images and text points to a multimodal model. If a question asks why transformers replaced older sequence models, the answer is parallel processing through attention, not a bigger dataset.