What's changed: In-scope coverage: added a generative AI development and agent in-scope services block to Ch2 §2 (Kiro/Strands Agents/Amazon Bedrock AgentCore)
2.1Fundamentals of Generative AI and Foundation Models
Understand the basics of generative AI: large language models (LLMs), tokens, prompts and completions, and foundation models.
Generative AI creates new content—text, images, code—from large training data. At its core is the foundation model.
2.1.1Prompts and completions
- Foundation model: a large model pretrained on vast data and reusable across tasks (e.g., Amazon Nova, Anthropic Claude, Amazon Titan, Meta Llama—all available via Amazon Bedrock); no rebuilding per task.
- Large language model (LLM): a foundation model that generates text by predicting the next token probabilistically (Transformer-based).
- Prompt: input (instruction/question); completion: output; token: the unit of text (basis for cost and context length).
- Multimodal: handles multiple types (text plus images, audio). Embeddings: turn text into numeric vectors to compare meaning (used in search and RAG).
You adapt a foundation model’s output in three escalating ways: (1) prompt engineering—the lightest, crafting instructions, examples, and roles (system prompt); (2) RAG (retrieval-augmented generation)—retrieve internal docs into the prompt to ground answers in fresh/specific info (reduces hallucination); (3) fine-tuning—the heaviest, retraining the model on extra data. AIF-C01 tests the order: "try prompting or RAG first; fine-tune only if those fall short."
| Term | Meaning |
|---|---|
| Foundation model | Large pretrained model for many tasks |
| LLM | Generate text via next-token prediction |
| Prompt/completion | Input / output |
| Token | Unit of text (cost/length) |
| RAG | Ground answers with retrieved info |
| Fine-tuning | Retrain the model on extra data |
Scenario: an internal knowledge bot. Using one foundation model, start with prompt engineering to set role and answer format. Since answers must reflect internal policies accurately, use RAG to retrieve documents and ground responses (with citations). Consider fine-tuning only to deeply adapt style or specialized tasks. Reusing one model across many tasks is the foundation model’s strength.
Watch the mix-ups: (1) Don’t confuse prompt (input) vs completion (output). (2) Tokens are their own unit, not characters, driving cost and context length. (3) RAG (ground via retrieval, model unchanged) vs fine-tuning (retrain the model) differ. (4) A foundation model is "one for many tasks"; task-specific AI services (previous chapter) are "one specific task."
Q. Foundation model vs LLM? A foundation model is broad (including images/audio); an LLM is the language-specialized kind. Q. RAG or fine-tuning? RAG to ground on fresh/internal data; fine-tuning to deeply adapt style or specialized tasks. Q. What happens with more tokens? You approach the context-length limit and cost rises.
Common: foundation model = large pretrained model, LLMs predict the next token, prompt = input / completion = output, token = basis for length/cost, and the three tuning levels (prompt < RAG < fine-tuning).
2.1.2Section summary
- Generative AI centers on the foundation model; text generation is the LLM (next-token prediction)
- Prompt (input) → completion (output), measured in tokens; multimodal and embeddings are core terms too
- Adapt in order of ease: prompt engineering < RAG < fine-tuning
Sign in to track progress — Log in.
Quick check
(just a quick review)Q1. What term refers to a large pretrained model usable across many tasks?
Q2. What is the basic mechanism by which an LLM generates text?
Q3. In generative AI, what is the "input (instruction/question)" to the model called?

