Generative AI creates text, images, audio and video with large models pre-trained on broad data. These sections cover how those models work, how to steer their output and where they go wrong.
Foundation models and LLMs
A foundation model (FM) is a large model pre-trained on broad data that you adapt to many tasks instead of training a new model per task. Large language models (LLMs) are the FMs that work with language.
How it works
- Pre-training: the model reads huge amounts of unlabeled data and learns to predict the next item, creating its own labels (self-supervised learning).
- Architecture: LLMs use transformers, whose self-attention weighs every word against every other word in parallel.
- Use: you prompt the model for a task, or customize it further with your data.
| Model type | How it generates | Typical use |
|---|---|---|
| Transformer (LLM) | Predicts the next token | Text, code, chat |
| Diffusion | Removes noise step by step | Images |
| GAN | Generator vs discriminator | Synthetic data, images |
| VAE | Encodes and decodes variations | Images, speech |
Exam cues
- If the question says one model, many tasks, adapted with prompts, think foundation model.
- If the question says images generated from noise, think diffusion model.
- If the question says generator and discriminator, think GAN.
- If the question says self-attention or contextual embeddings, think transformer.
Remember
- FMs learn with self-supervised learning on unlabeled data.
- LLMs are a subset of FMs.
- Transformers process sequences in parallel; RNNs process them step by step.
Trap: Fine-tuning an FM uses labeled data, but pre-training it doesn’t; don’t answer “supervised learning” for how FMs are pre-trained.
Da documentação da AWS (10)
- A foundation model (FM) is an AI model with a large number of parameters, trained on a massive amount of diverse data, that can serve a wide range of use cases; FMs can generate text or images and convert input into embeddings.
- Foundation models use self-supervised learning, creating their own labels from the input data, and in general learn to predict the next item in a sequence.
- A unique feature of foundation models is adaptability; they perform many different tasks, such as question answering, NLP and image classification, from prompts, and serve as base models for more specialized applications.
- Building a foundation model from scratch costs millions of dollars and can take months, so using a pre-trained FM is faster and cheaper than training a new model.
- Large language models (LLMs) are one class of FMs, focused on language tasks such as summarization, text generation, classification, conversation and information extraction.
- LLMs are built on the transformer, neural networks with an encoder and a decoder and self-attention; unlike recurrent neural networks (RNNs), transformers process whole sequences in parallel.
- BERT (Bidirectional Encoder Representations from Transformers), released in 2018, was one of the first foundation models; it analyzes the context of the complete sequence before making a prediction.
- Diffusion models create data by adding controlled noise to a sample over several steps and then reversing the process, removing noise until a new sample emerges.
- A generative adversarial network (GAN) trains two networks against each other, a generator that creates fake samples and a discriminator that tries to tell them from real data.
- Variational autoencoders (VAEs), from 2013, were the first deep generative models that could generate realistic images and speech.
Tokens, prompts and embeddings
Models don’t see words; they see tokens, and they compare meaning with embeddings. Both drive cost and quality: you pay per token, and embeddings power semantic search and retrieval augmented generation.
How it works
- Text in a prompt is split into tokens; the model predicts the response one token at a time (inference).
- An embedding model turns text or images into vectors of numbers.
- Vectors with similar meaning are close together, so a vector database can find related content by distance.
Exam cues
- If the question says pricing or limits counted in units of text, think tokens.
- If the question says semantic similarity, vector search or a vector database, think embeddings.
- If the question says change the model’s behavior permanently, think customization of model parameters, not the prompt.
Remember
- Token: unit of text. Embedding: vector of numbers that captures meaning.
- Inference: prompt in, response out.
- Context window: the most tokens one call can hold.
Trap: A token is not always a whole word. Parts of words and punctuation are tokens too, so token counts are usually higher than word counts.
Da documentação da AWS (7)
- A token is a sequence of characters that a model reads or predicts as one unit of meaning, such as a word, part of a word ("-ed"), a punctuation mark or a common phrase.
- A prompt is the input given to a model to guide its response; it can hold instructions, task context, examples of outputs or text for the model to use.
- Model inference is the process of a foundation model generating an output (response) from a given input (prompt).
- An embedding turns input into a vector of numbers so that objects can be compared for similarity, such as two sentences with similar meaning or an image and a caption.
- LLMs represent words as multi-dimensional vectors (word embeddings), so words with similar meanings sit close together and the model can capture relationships between words.
- Model parameters are values that define a model and how it interprets input and generates responses; providers control them, and model customization updates them to create a new model.
- The context window is the maximum amount of text, measured in tokens, that an LLM can process in a single inference call; exceeding it causes inference failures.
Inference parameters
Inference parameters are dials you set per request. Temperature, Top K and Top P control how adventurous the model is when picking each next token; length settings cap how much it writes.
How it works
- The model scores every possible next token with a probability.
- Top K keeps a fixed number of the best candidates; Top P keeps the smallest set covering a share of the probability.
- Temperature reshapes the probabilities: low sharpens them toward the top choice, high flattens them.
- The model samples one token and repeats until it hits a stop condition or the length limit.
| Parameter | Lower value | Higher value |
|---|---|---|
| Temperature | More predictable | More random, creative |
| Top K | Fewer candidates | More candidates |
| Top P | Smaller share of the distribution | Larger share |
| Max length | Shorter, cheaper output | Longer output |
Exam cues
- If the question says consistent, deterministic or factual answers, think lower temperature.
- If the question says creative or varied output, think higher temperature or Top P.
- If the question says a count of candidate tokens, think Top K; a percentage, think Top P.
- If the question says limit cost or response size, think maximum length (tokens).
- If the question says stop generation at a specific marker, think stop sequences.
Remember
- Low temperature = more deterministic; high = more random.
- Defaults and ranges differ by model.
Trap: Lower temperature doesn’t stop hallucinations; it makes the model consistently pick the likeliest tokens, which can still be wrong. Grounding (RAG) addresses accuracy.
Da documentação da AWS (7)
- For each next token, a model computes a probability distribution and samples from it; inference parameters adjust that distribution or limit the response.
- A lower temperature makes the model pick higher-probability tokens and respond more deterministically; a higher temperature makes lower-probability tokens likelier and responses more random.
- Top K is the number of most-likely candidate tokens the model considers for the next token; with Top K of 50 it picks from the 50 most probable tokens.
- Top P is the share of the cumulative probability distribution the model considers; with Top P of 0.8 it picks from tokens in the top 80% of the distribution.
- Response length parameters set the minimum or maximum number of tokens to return, and penalties discourage long responses or repeated tokens.
- Inference parameter defaults and ranges depend on the model.
- Stop sequences are character sequences that make the model stop generating once it produces one of them.
GenAI lifecycle and choosing a model
A generative AI project starts with scoping the problem, then picking and adapting a model, integrating it, deploying it and improving it with feedback. Model choice is a cost and quality trade-off you revisit as new models appear.
How it works
- Scoping: is generative AI the right tool? Define risks, costs and success metrics.
- Model selection: compare modality, size, accuracy, price, context window and latency.
- Model customization: prompt engineering, RAG, agents, fine-tuning or distillation, cheapest first.
- Development and integration: connect the model to data, tools, guardrails and a user interface.
- Deployment: release with CI/CD and infrastructure as code.
- Continuous improvement: monitor quality, collect feedback, update.
| Selection factor | Question to ask |
|---|---|
| Modality | Text, image, audio, video, multimodal? |
| Cost | Price per input and output token |
| Latency | Fast enough for real-time use? |
| Context window | Fits the documents and conversation? |
| Languages | Supports the users’ languages? |
| Customization | Can it be fine-tuned if needed? |
Exam cues
- If the question says choose between models that both meet the bar, think the smaller, cheaper one, because it saves cost, latency and energy.
- If the question says mix of simple and complex requests, think routing by complexity (intelligent prompt routing).
- If the question says sustainability or environmental impact of model choice, think smaller models and distillation.
Remember
- Lifecycle: scoping, model selection, customization, integration, deployment, continuous improvement.
- Start small and scale up only as needed.
Trap: The biggest model isn’t the safe default. It costs more per token and responds slower, and a smaller tuned model often matches it on one task.
Da documentação da AWS (8)
- The Generative AI Lens lifecycle phases are scoping, model selection, model customization, development and integration, deployment, and continuous improvement.
- Scoping defines the business problem, asks whether generative AI is relevant to it, weighs risks and costs, and sets the success metrics.
- Model selection weighs factors such as modality, size, accuracy, training data, pricing, context window, inference latency and compatibility with existing infrastructure, as well as the hosting provider's data usage policies.
- Model customization fits a pre-trained model to the use case with techniques such as prompt engineering, RAG, agents, fine-tuning, continued pre-training, model distillation and human feedback alignment.
- Continuous improvement monitors metrics such as accuracy, toxicity and coherence of outputs, gathers user feedback, and updates data and models over time.
- To optimize cost, test the smallest model first and move to larger ones only until one meets the minimum performance bar; newer and larger models often cost more per token.
- Routing simple requests to smaller, cheaper models and complex ones to larger models keeps quality while lowering cost; Amazon Bedrock offers intelligent prompt routing for this.
- Smaller models, distillation, quantization and pruning reduce compute, cost and carbon footprint, and a fine-tuned smaller model can often match a large general-purpose model for a specific task.
What generative AI does well and where it fails
Generative AI is flexible: one model writes, summarizes, translates and chats. The same flexibility makes it unreliable in ways that matter: it can invent facts, answer differently each time and repeat the bias in its data.
How it works
| Advantages | Disadvantages |
|---|---|
| Adapts to many tasks from a prompt | Hallucinations: confident but wrong output |
| Natural conversation | Nondeterminism: different answers to the same prompt |
| Fast content generation | Bias and toxicity learned from data |
| Summaries and translation at scale | Hard to interpret why it answered |
- Hallucinations come from predicting likely text, not looking up facts; grounding with RAG and output checks reduce them.
- Nondeterminism comes from sampling; lower temperature reduces variation.
- Bias comes from training data; curated data, guardrails and evaluation reduce it.
Exam cues
- If the question says made-up but plausible facts, think hallucination.
- If the question says same input, different output, think nondeterminism.
- If the question says decisions must be explained to regulators, think limited interpretability; prefer an explainable model.
Remember
- Hallucination = inconsistent, incorrect or off-prompt output.
- RAG grounds answers; lower temperature makes them consistent.
Trap: Lowering temperature makes answers consistent, not true. A model can repeat the same hallucination every time.
Da documentação da AWS (8)
- Foundation models adapt to a wide range of tasks from input prompts, such as question answering, language processing and image classification.
- Common generative AI uses include customer support, language translation, content generation and copywriting.
- A hallucination is output from a generative AI model that is inconsistent, factually incorrect or unrelated to the input prompt.
- Foundation models can give unreliable answers that are inappropriate, toxic or incorrect, and can pick up bias from their training data.
- Generative AI can produce inaccurate or misleading information because it relies on patterns in its training data, and it can reflect biases or inaccuracies in that data.
- A model samples each next token from a probability distribution, so the same prompt can produce different responses; a lower temperature makes responses more deterministic.
- Model interpretability is the ability to understand and explain the reasoning behind a model's outputs.
- Retrieval augmented generation (RAG) grounds a model's output in documents retrieved for the request, which helps reduce hallucination.
Choosing an AWS generative AI service
AWS offers generative AI at three levels: ready-made assistants, a managed platform to build your own apps and agents, and infrastructure to host or train models yourself. Pick the most managed option that meets the need.
How it works
| Need | Start with |
|---|---|
| Employees want answers, content or analysis across company data | Amazon Quick Suite |
| Developers want an agentic coding assistant | Kiro |
| Build your own generative AI app on a hosted model | Amazon Bedrock |
| Build and run AI agents | Amazon Bedrock AgentCore |
| Host, customize or train a model Bedrock doesn’t offer | Amazon SageMaker AI |
| Full control of the serving stack | Self-managed on EC2, EKS or ECS |
- Check first whether an AWS service you use already has the generative AI feature built in.
- Prefer Bedrock for inference on available models: per-token pricing and no infrastructure.
- Move to SageMaker AI or self-managed hosting only for models, customization or control Bedrock lacks.
Exam cues
- If the question says no infrastructure, choice of models through one API, think Amazon Bedrock.
- If the question says custom training, open-weight model hosting or control of instances, think Amazon SageMaker AI.
- If the question says spiky traffic and no idle cost, think Bedrock on-demand (per token).
- If the question says business users need an assistant over company data, think Amazon Quick Suite.
Remember
- Bedrock has the lowest operational burden; self-managed has the highest.
- Amazon Q Business closed to new customers on July 31, 2026; Quick Suite succeeds it.
Trap: Instance-based hosting isn’t cheaper by default. It bills for idle time and only wins at sustained, high utilization.
Da documentação da AWS (7)
- Employee productivity and software development help point to an AI assistant such as Amazon Quick Suite or Kiro; building your own application or agent points to Amazon Bedrock and Amazon Bedrock AgentCore; hosting, customizing or training models yourself points to Amazon SageMaker AI, SageMaker HyperPod or self-managed infrastructure.
- For inference on available models, Amazon Bedrock is the default starting point; it is fully managed and serverless, with models from Amazon and leading providers through a single API.
- Amazon SageMaker AI fits when you need a model that Amazon Bedrock doesn't offer, customization beyond what Bedrock supports, or control over how the model is served.
- Amazon Bedrock on-demand inference charges per token with no idle cost, which suits variable or spiky traffic; instance-based options charge for compute whether or not it's used and pay off only at sustained high utilization.
- Amazon Bedrock has the lowest operational burden, SageMaker AI manages instances while you manage the model stack, and self-managed EC2, EKS or ECS gives full control and full responsibility; choose the most managed option that gives the control you need.
- Many AWS services include built-in generative AI features, such as AI recommendations for agents in Amazon Connect; if an existing service already has the capability, start there.
- Amazon Q Business stopped accepting new customers on July 31, 2026; Amazon Quick Suite is its next evolution, and existing customers can keep using Q Business.
Flashcards
Nada para revisar aqui agora. Escolha outros tópicos ou outro filtro.
·
Todos os 40 flashcards em lista
What makes a foundation model different from a traditional ML model built for one task?
It's pre-trained on massive, diverse data and adapts to many tasks through prompts or fine-tuning, instead of being trained for a single task.
How are foundation models pre-trained without human-labeled data?
Self-supervised learning. The model creates its own labels from the input, such as predicting the next word in a sequence.
Which neural network architecture are LLMs built on, and what lets it train faster than an RNN?
The transformer. Its self-attention processes whole sequences in parallel, while an RNN reads inputs one step at a time.
Which generative model type creates images by adding noise to data and then learning to remove it step by step?
A diffusion model.
A team needs realistic synthetic data and picks a model with a generator and a discriminator trained against each other. What is it?
A generative adversarial network (GAN).
Is an LLM the same thing as a foundation model?
An LLM is one kind of FM, the kind focused on language.
FMs also include image, multimodal and embedding models.
A startup wants a model for customer support summaries. Why start from a pre-trained foundation model instead of training one from scratch?
Training an FM from scratch costs millions of dollars and months of compute; adapting a pre-trained FM is faster and cheaper.
Which early foundation model reads text bidirectionally, using the context on both sides of a word?
BERT (Bidirectional Encoder Representations from Transformers).
What is a token in a large language model?
A unit of text the model reads or predicts, such as a word, part of a word, a punctuation mark or a common phrase.
A search team wants to find documents with similar meaning even when they share no keywords. What representation makes this possible?
Embeddings, numeric vectors where similar meanings sit close together, so similarity becomes a distance between vectors.
What is the difference between a token and an embedding?
A token is a unit of text the model processes.
An embedding is a vector of numbers that represents the meaning of text (or images) for comparison.
What is "inference" for a foundation model?
The model generating an output (response) from an input (prompt).
Can you change a foundation model's parameters by editing your prompt?
No. Parameters (weights) change only through model customization, such as fine-tuning, which creates a new custom model.
Prompts only steer one response.
A model must read a 400-page contract in one request. Which model property decides whether it fits?
The context window, the maximum number of tokens the model can process in one call.
A legal team wants consistent, factual answers from an LLM with little variation between runs. How should it set temperature?
Low (close to 0). A lower temperature favors the most probable tokens, giving more deterministic responses.
A marketing team wants more creative, varied slogans from the same prompt. Which inference parameter should it raise?
Temperature (or Top P / Top K), which lets the model pick lower-probability tokens.
Which inference parameter sets a fixed number of most-likely tokens to choose from?
Top K. Top P instead uses a share of the cumulative probability.
Which inference parameter influences the percentage of most-likely candidates the model considers for the next token?
Top P.
Responses from a model are too long and cost too much. Which inference parameter helps directly?
The response length (maximum tokens) parameter, which caps the number of tokens returned.
Does setting temperature to 0 retrain the model to be more accurate?
No. Inference parameters only change how one response is sampled; the model's parameters stay the same.
It makes output more consistent, not more correct.
An application wants the model to stop writing as soon as it outputs the text "END". Which inference parameter does this?
A stop sequence. When the model generates a specified stop sequence, it stops generating more tokens.
Two foundation models both meet a support bot's quality bar; one is much larger. Which should the company pick, and why?
The smaller one. It meets the requirements with lower token cost, lower latency and less energy per request.
Name four factors to compare when selecting a foundation model.
Any four of: modality, model size, accuracy, cost (token pricing), context window, latency, language support, customization options, data usage policy.
In the generative AI lifecycle, which phase decides whether generative AI is relevant to the problem and how success is measured?
Scoping, the first phase.
An app sends both simple FAQ lookups and complex reasoning questions to the same large model. How can it cut cost without hurting quality?
Route simple requests to a smaller model and complex ones to a larger model, for example with Amazon Bedrock intelligent prompt routing.
Which practices make a generative AI workload more sustainable?
Choosing the smallest adequate model, model distillation, quantization and pruning, which all cut compute and energy.
Which lifecycle phase tracks output accuracy, toxicity and user feedback after launch?
Continuous improvement.
Is the newest, largest foundation model always the right choice?
No. Pick the smallest model that meets the requirements; bigger models cost more per token and add latency.
A chatbot confidently cites a company policy that doesn't exist. What is this called?
A hallucination, output that is factually incorrect or not grounded in the input.
Users notice the same question to an LLM gets different answers each time. Why?
LLMs are nondeterministic; they sample each token from a probability distribution. A lower temperature makes answers more consistent.
Which technique reduces hallucinations by giving the model relevant company documents with each request?
Retrieval augmented generation (RAG), which grounds responses in retrieved content.
Name three advantages of generative AI for a business.
Any three of: adaptability to many tasks, conversational interaction, fast content generation (text, images, code), translation and summarization at scale.
Name three disadvantages of generative AI solutions.
Any three of: hallucinations (inaccuracy), nondeterministic output, bias from training data, toxic or inappropriate output, limited interpretability.
A bank must explain exactly why each loan was denied, to satisfy regulators. Is a large generative model a good fit for the decision?
Not on its own. LLMs have limited interpretability, so a simpler, explainable model (or rules) fits regulated decisions better.
A company wants to add a generative AI feature to its own app using a hosted model, with no servers to manage. Which AWS service is the default starting point?
Amazon Bedrock, which serves foundation models from several providers through one serverless API.
A team needs an open-weight model that isn't in Amazon Bedrock and wants control over the serving stack. Which service fits?
Amazon SageMaker AI, which hosts, customizes and trains models when Bedrock doesn't offer the model or the control needed.
A generative AI app has unpredictable, spiky traffic and long idle periods. Which pricing model avoids paying for idle capacity?
Amazon Bedrock on-demand inference, billed per token with no cost when idle.
Employees want an AI assistant to answer questions across company data, without building anything. Which AWS offering fits?
Amazon Quick Suite, an AI-powered workspace for employee productivity.
Rank Amazon Bedrock, SageMaker AI and self-managed EC2 from least to most operational work for hosting a model.
Amazon Bedrock, then SageMaker AI, then self-managed EC2 (full control, full responsibility).
Which AWS service is a managed starting point for building a generative AI application with available models from multiple providers?
Amazon Bedrock provides serverless access to models from Amazon and other providers.