What is a foundation model?
A foundation model (FM) is a large, pre-trained model trained on huge, broad datasets that can be adapted to many downstream tasks (text, image, code, audio) rather than one narrow job.
Amazon Bedrock is the AWS managed service that gives serverless, API access to FMs from multiple providers (Amazon, Anthropic, Meta, Mistral, Cohere, Stability AI, AI21) without you managing infrastructure.
Key foundation model concepts
- Pre-training: the model learns general patterns from massive unlabelled data; this is expensive and done once by the provider.
- Fine-tuning: you adapt a pre-trained FM to your own labelled data for a specific task; cheaper and faster than training from scratch.
- Continued pre-training (domain adaptation): further training on unlabelled domain data to improve vocabulary/context understanding.
- Retrieval Augmented Generation (RAG): the model retrieves relevant external data at inference time to ground its answer, reducing hallucination without retraining.
- Amazon Bedrock Knowledge Bases is AWS's managed RAG feature, using vector embeddings and a vector store.
Inference parameters (exam favourites)
- Temperature (0 to 1): controls randomness/creativity. Low = deterministic, focused, repeatable. High = diverse, creative, riskier.
- Top P: controls diversity by only sampling from the smallest set of tokens whose cumulative probability meets P. Lower Top P = narrower, more predictable choices.
- Top K: limits sampling to the K most likely next tokens.
- Max tokens / response length: caps the length of the generated output and therefore cost.
- These parameters affect output quality and cost but do NOT change the model's underlying knowledge.
Prompt engineering essentials
Prompt engineering is crafting inputs to get better, more reliable outputs WITHOUT changing model weights - it's the cheapest and fastest way to improve results.
- Zero-shot prompting: no examples given, just the instruction.
- Few-shot prompting: a small number of examples included in the prompt to show the desired pattern.
- Chain-of-thought (CoT) prompting: asking the model to reason step by step, improving performance on multi-step or logic problems.
- Prompt templates: reusable structured prompts with placeholders, useful for consistency at scale.
- Negative prompting: telling the model what NOT to do or include, common in image generation.
Prompt risks and mitigation
- Prompt injection: malicious input trying to override the system prompt or instructions - a security concern for AI Practitioner exam.
- Jailbreaking: attempts to bypass safety guardrails.
- Hallucination: the model confidently generates false or unsupported information - mitigate with RAG, fine-tuning, or lower temperature.
- Amazon Bedrock Guardrails helps filter harmful content, block denied topics, and reduce hallucinations at the platform level.
Common mistakes
- Confusing fine-tuning (changes model weights) with prompt engineering (changes only the input, no retraining).
- Thinking temperature and Top P do the same thing - they are separate, complementary controls.
- Forgetting RAG does NOT retrain the model; it augments the prompt with retrieved context at runtime.
- Assuming more examples always help - few-shot only needs enough examples to demonstrate the pattern, not a full dataset.
What is a foundation model?
A large model pre-trained on broad data that can be adapted to many downstream tasks, not just one narrow job.
tap to reveal
What does Amazon Bedrock provide?
Serverless API access to foundation models from multiple providers (Anthropic, Meta, Mistral, Cohere, AI21, Stability AI, Amazon) without managing infrastructure.
tap to reveal
What does the temperature parameter control?
Randomness of output: low temperature = focused/deterministic, high temperature = creative/varied.
tap to reveal
What does Top P do?
Limits sampling to the smallest set of tokens whose cumulative probability reaches P, controlling diversity of output.
tap to reveal
What does Top K do?
Restricts the model to choosing its next token only from the K most likely candidates.
tap to reveal
Define zero-shot prompting.
Giving the model an instruction with no examples of the desired output.
tap to reveal
Define few-shot prompting.
Including a small number of examples in the prompt to demonstrate the desired pattern before the real task.
tap to reveal
What is chain-of-thought prompting?
Prompting the model to reason step by step, which improves accuracy on multi-step or logical tasks.
tap to reveal
What is RAG and what problem does it solve?
Retrieval Augmented Generation - retrieves relevant external data at inference time to ground answers and reduce hallucination, without retraining the model.
tap to reveal
What is Amazon Bedrock Knowledge Bases?
AWS's managed RAG feature that uses vector embeddings and a vector store to ground model responses in your data.
tap to reveal
How does fine-tuning differ from prompt engineering?
Fine-tuning updates the model's weights using labelled data; prompt engineering only changes the input text and does not retrain the model.
tap to reveal
What is prompt injection?
A security risk where malicious input attempts to override a model's system prompt or safety instructions.
tap to reveal
What is hallucination in the context of FMs?
When a model confidently generates false or unsupported information; mitigated by RAG, fine-tuning, or lower temperature.
tap to reveal
What does Amazon Bedrock Guardrails do?
Filters harmful content, blocks denied topics, and helps reduce hallucinations at the platform level.
tap to reveal
What is negative prompting typically used for?
Telling the model what to exclude or avoid, commonly used to steer image generation away from unwanted elements.
tap to reveal