AIF cheat sheet
AIF · Keep the key ideas within reach.
Fundamentals of AI and ML
Supervised learning trains on labeled input-output pairs to predict labels or values; unsupervised learning finds structure in unlabeled data.
Classification predicts discrete categories; regression predicts continuous numeric values.
Accuracy = correct predictions / total predictions; precision = TP/(TP+FP); recall = TP/(TP+FN); F1 = 2PR/(P+R).
Overfitting shows low training error and high validation error; remedies include more data, regularization, simpler models, and early stopping.
Underfitting shows high training and validation error; remedies include more complex models, better features, and longer training.
Training updates model parameters from data; inference applies fixed parameters to new inputs.
High bias causes underfitting; high variance causes overfitting; the bias-variance tradeoff balances model complexity.
Feature engineering converts raw data into model inputs; data quality and representativeness limit achievable model performance.
Prebuilt AI services expose APIs for common tasks; custom ML services such as SageMaker build, train, and deploy models.
Fundamentals of Generative AI
Foundation models are large pretrained models adapted to downstream tasks through prompting, retrieval augmentation, or fine-tuning.
Tokens are subword units; context window limits count input tokens plus output tokens in one request.
Temperature controls randomness: lower values are more deterministic; higher values increase diversity; top-p and top-k also affect sampling.
Embeddings map text or images to vectors; semantic similarity is measured with cosine distance or vector distance.
RAG retrieves relevant documents and inserts them into the prompt to ground responses without retraining model weights.
Fine-tuning updates model weights on domain data; prompt engineering changes only the input instructions and examples.
Hallucination is fluent but unsupported output; mitigate with retrieval grounding, citations, evaluation, guardrails, and human review.
Transformer self-attention weighs relationships between tokens and enables parallel processing over long contexts.
Generative AI lifecycle stages include data selection, pretraining, adaptation, evaluation, deployment, and monitoring.
Applications of Foundation Models
Model selection considers task type, modality, latency, cost, context length, language support, and compliance requirements.
Prompt patterns include zero-shot, few-shot, chain-of-thought, role instructions, task instructions, and output-format constraints.
max tokens caps generated output length; stop sequences terminate generation when a specified string appears.
Amazon Bedrock provides managed API access to foundation models and supports guardrails, knowledge bases, agents, and evaluation.
RAG pipeline: ingest and chunk documents, create embeddings, index vectors, retrieve top-k matches, augment prompt, generate response.
Agents decompose tasks, call tools or APIs, use memory, and rely on orchestration to control multi-step workflows.
Customization options include fine-tuning, continued pretraining, and distillation; distillation trains a smaller model from a larger model's outputs.
Generative AI cost drivers include input and output tokens, model size, provisioned throughput, and vector storage or retrieval.
Evaluation methods include task metrics, human review, LLM-as-judge, A/B testing, latency measurement, and cost analysis.
Guidelines for Responsible AI
Responsible AI dimensions include fairness, explainability, privacy, safety, controllability, verifiability, transparency, and governance.
Bias sources include historical data, sampling methods, labeling practices, and proxy features; measure outcomes across subgroups.
Explainability methods include feature importance, SHAP, partial dependence, and counterfactuals; model cards document intended use and limitations.
Privacy controls include minimizing PII, anonymization or pseudonymization, encryption, access control, and retention limits.
Safety controls include content filters, guardrails, red-teaming, human oversight, and escalation paths for high-risk outputs.
Human-in-the-loop review is required where AI outputs affect rights, safety, or finances; automation bias can reduce review effectiveness.
Transparency practices disclose AI use and provide model, prompt, and version metadata with known limitations.
Fairness metrics include demographic parity, equal opportunity, and equalized odds; these can trade off against accuracy and each other.
Amazon Bedrock Guardrails filters harmful content and sensitive information; SageMaker Clarify detects bias and explains predictions.
Security, Compliance, and Governance for AI Solutions
Shared responsibility: AWS secures the cloud infrastructure; customers secure data, identities, prompts, model configuration, and applications.
Least privilege uses scoped IAM roles and policies; avoid long-term access keys and grant only permissions required for each workload.
Data protection uses encryption at rest with KMS, encryption in transit with TLS, and private connectivity through VPC endpoints or PrivateLink.
Prompt injection uses malicious input to alter model behavior; mitigate with input validation, guardrails, and least-privilege tool access.
Data poisoning corrupts training or retrieval data; controls include source validation, data lineage, and restricted write access.
Compliance obligations may include GDPR, HIPAA, SOC, and ISO requirements; data residency and retention rules vary by jurisdiction.
Monitoring uses CloudTrail for API activity, CloudWatch for metrics and alarms, model invocation logging, and anomaly detection.
Model governance includes versioning, approval workflows, lineage records, evaluation evidence, drift monitoring, and decommissioning.
Generative AI security protects model weights, restricts tool permissions, sanitizes retrieved content, and monitors outputs for leakage or misuse.
Fundamentals of AI and ML
Supervised learning trains on labeled input-output pairs to predict labels or values; unsupervised learning finds structure in unlabeled data.
Classification predicts discrete categories; regression predicts continuous numeric values.
Accuracy = correct predictions / total predictions; precision = TP/(TP+FP); recall = TP/(TP+FN); F1 = 2PR/(P+R).
Overfitting shows low training error and high validation error; remedies include more data, regularization, simpler models, and early stopping.
Underfitting shows high training and validation error; remedies include more complex models, better features, and longer training.
Training updates model parameters from data; inference applies fixed parameters to new inputs.
High bias causes underfitting; high variance causes overfitting; the bias-variance tradeoff balances model complexity.
Feature engineering converts raw data into model inputs; data quality and representativeness limit achievable model performance.
Prebuilt AI services expose APIs for common tasks; custom ML services such as SageMaker build, train, and deploy models.
Fundamentals of Generative AI
Foundation models are large pretrained models adapted to downstream tasks through prompting, retrieval augmentation, or fine-tuning.
Tokens are subword units; context window limits count input tokens plus output tokens in one request.
Temperature controls randomness: lower values are more deterministic; higher values increase diversity; top-p and top-k also affect sampling.
Embeddings map text or images to vectors; semantic similarity is measured with cosine distance or vector distance.
RAG retrieves relevant documents and inserts them into the prompt to ground responses without retraining model weights.
Fine-tuning updates model weights on domain data; prompt engineering changes only the input instructions and examples.
Hallucination is fluent but unsupported output; mitigate with retrieval grounding, citations, evaluation, guardrails, and human review.
Transformer self-attention weighs relationships between tokens and enables parallel processing over long contexts.
Generative AI lifecycle stages include data selection, pretraining, adaptation, evaluation, deployment, and monitoring.
Applications of Foundation Models
Model selection considers task type, modality, latency, cost, context length, language support, and compliance requirements.
Prompt patterns include zero-shot, few-shot, chain-of-thought, role instructions, task instructions, and output-format constraints.
max tokens caps generated output length; stop sequences terminate generation when a specified string appears.
Amazon Bedrock provides managed API access to foundation models and supports guardrails, knowledge bases, agents, and evaluation.
RAG pipeline: ingest and chunk documents, create embeddings, index vectors, retrieve top-k matches, augment prompt, generate response.
Agents decompose tasks, call tools or APIs, use memory, and rely on orchestration to control multi-step workflows.
Customization options include fine-tuning, continued pretraining, and distillation; distillation trains a smaller model from a larger model's outputs.
Generative AI cost drivers include input and output tokens, model size, provisioned throughput, and vector storage or retrieval.
Evaluation methods include task metrics, human review, LLM-as-judge, A/B testing, latency measurement, and cost analysis.
Guidelines for Responsible AI
Responsible AI dimensions include fairness, explainability, privacy, safety, controllability, verifiability, transparency, and governance.
Bias sources include historical data, sampling methods, labeling practices, and proxy features; measure outcomes across subgroups.
Explainability methods include feature importance, SHAP, partial dependence, and counterfactuals; model cards document intended use and limitations.
Privacy controls include minimizing PII, anonymization or pseudonymization, encryption, access control, and retention limits.
Safety controls include content filters, guardrails, red-teaming, human oversight, and escalation paths for high-risk outputs.
Human-in-the-loop review is required where AI outputs affect rights, safety, or finances; automation bias can reduce review effectiveness.
Transparency practices disclose AI use and provide model, prompt, and version metadata with known limitations.
Fairness metrics include demographic parity, equal opportunity, and equalized odds; these can trade off against accuracy and each other.
Amazon Bedrock Guardrails filters harmful content and sensitive information; SageMaker Clarify detects bias and explains predictions.
Security, Compliance, and Governance for AI Solutions
Shared responsibility: AWS secures the cloud infrastructure; customers secure data, identities, prompts, model configuration, and applications.
Least privilege uses scoped IAM roles and policies; avoid long-term access keys and grant only permissions required for each workload.
Data protection uses encryption at rest with KMS, encryption in transit with TLS, and private connectivity through VPC endpoints or PrivateLink.
Prompt injection uses malicious input to alter model behavior; mitigate with input validation, guardrails, and least-privilege tool access.
Data poisoning corrupts training or retrieval data; controls include source validation, data lineage, and restricted write access.
Compliance obligations may include GDPR, HIPAA, SOC, and ISO requirements; data residency and retention rules vary by jurisdiction.
Monitoring uses CloudTrail for API activity, CloudWatch for metrics and alarms, model invocation logging, and anomaly detection.
Model governance includes versioning, approval workflows, lineage records, evaluation evidence, drift monitoring, and decommissioning.
Generative AI security protects model weights, restricts tool permissions, sanitizes retrieved content, and monitors outputs for leakage or misuse.
Fundamentals of AI and ML
Supervised learning trains on labeled input-output pairs to predict labels or values; unsupervised learning finds structure in unlabeled data.
Classification predicts discrete categories; regression predicts continuous numeric values.
Accuracy = correct predictions / total predictions; precision = TP/(TP+FP); recall = TP/(TP+FN); F1 = 2PR/(P+R).
Overfitting shows low training error and high validation error; remedies include more data, regularization, simpler models, and early stopping.
Underfitting shows high training and validation error; remedies include more complex models, better features, and longer training.
Training updates model parameters from data; inference applies fixed parameters to new inputs.
High bias causes underfitting; high variance causes overfitting; the bias-variance tradeoff balances model complexity.
Feature engineering converts raw data into model inputs; data quality and representativeness limit achievable model performance.
Prebuilt AI services expose APIs for common tasks; custom ML services such as SageMaker build, train, and deploy models.
Fundamentals of Generative AI
Foundation models are large pretrained models adapted to downstream tasks through prompting, retrieval augmentation, or fine-tuning.
Tokens are subword units; context window limits count input tokens plus output tokens in one request.
Temperature controls randomness: lower values are more deterministic; higher values increase diversity; top-p and top-k also affect sampling.
Embeddings map text or images to vectors; semantic similarity is measured with cosine distance or vector distance.
RAG retrieves relevant documents and inserts them into the prompt to ground responses without retraining model weights.
Fine-tuning updates model weights on domain data; prompt engineering changes only the input instructions and examples.
Hallucination is fluent but unsupported output; mitigate with retrieval grounding, citations, evaluation, guardrails, and human review.
Transformer self-attention weighs relationships between tokens and enables parallel processing over long contexts.
Generative AI lifecycle stages include data selection, pretraining, adaptation, evaluation, deployment, and monitoring.
Applications of Foundation Models
Model selection considers task type, modality, latency, cost, context length, language support, and compliance requirements.
Prompt patterns include zero-shot, few-shot, chain-of-thought, role instructions, task instructions, and output-format constraints.
max tokens caps generated output length; stop sequences terminate generation when a specified string appears.
Amazon Bedrock provides managed API access to foundation models and supports guardrails, knowledge bases, agents, and evaluation.
RAG pipeline: ingest and chunk documents, create embeddings, index vectors, retrieve top-k matches, augment prompt, generate response.
Agents decompose tasks, call tools or APIs, use memory, and rely on orchestration to control multi-step workflows.
Customization options include fine-tuning, continued pretraining, and distillation; distillation trains a smaller model from a larger model's outputs.
Generative AI cost drivers include input and output tokens, model size, provisioned throughput, and vector storage or retrieval.
Evaluation methods include task metrics, human review, LLM-as-judge, A/B testing, latency measurement, and cost analysis.
Guidelines for Responsible AI
Responsible AI dimensions include fairness, explainability, privacy, safety, controllability, verifiability, transparency, and governance.
Bias sources include historical data, sampling methods, labeling practices, and proxy features; measure outcomes across subgroups.
Explainability methods include feature importance, SHAP, partial dependence, and counterfactuals; model cards document intended use and limitations.
Privacy controls include minimizing PII, anonymization or pseudonymization, encryption, access control, and retention limits.
Safety controls include content filters, guardrails, red-teaming, human oversight, and escalation paths for high-risk outputs.
Human-in-the-loop review is required where AI outputs affect rights, safety, or finances; automation bias can reduce review effectiveness.
Transparency practices disclose AI use and provide model, prompt, and version metadata with known limitations.
Fairness metrics include demographic parity, equal opportunity, and equalized odds; these can trade off against accuracy and each other.
Amazon Bedrock Guardrails filters harmful content and sensitive information; SageMaker Clarify detects bias and explains predictions.
Security, Compliance, and Governance for AI Solutions
Shared responsibility: AWS secures the cloud infrastructure; customers secure data, identities, prompts, model configuration, and applications.
Least privilege uses scoped IAM roles and policies; avoid long-term access keys and grant only permissions required for each workload.
Data protection uses encryption at rest with KMS, encryption in transit with TLS, and private connectivity through VPC endpoints or PrivateLink.
Prompt injection uses malicious input to alter model behavior; mitigate with input validation, guardrails, and least-privilege tool access.
Data poisoning corrupts training or retrieval data; controls include source validation, data lineage, and restricted write access.
Compliance obligations may include GDPR, HIPAA, SOC, and ISO requirements; data residency and retention rules vary by jurisdiction.
Monitoring uses CloudTrail for API activity, CloudWatch for metrics and alarms, model invocation logging, and anomaly detection.
Model governance includes versioning, approval workflows, lineage records, evaluation evidence, drift monitoring, and decommissioning.
Generative AI security protects model weights, restricts tool permissions, sanitizes retrieved content, and monitors outputs for leakage or misuse.
Fundamentals of AI and ML
Supervised learning trains on labeled input-output pairs to predict labels or values; unsupervised learning finds structure in unlabeled data.
Classification predicts discrete categories; regression predicts continuous numeric values.
Accuracy = correct predictions / total predictions; precision = TP/(TP+FP); recall = TP/(TP+FN); F1 = 2PR/(P+R).
Overfitting shows low training error and high validation error; remedies include more data, regularization, simpler models, and early stopping.
Underfitting shows high training and validation error; remedies include more complex models, better features, and longer training.
Training updates model parameters from data; inference applies fixed parameters to new inputs.
High bias causes underfitting; high variance causes overfitting; the bias-variance tradeoff balances model complexity.
Feature engineering converts raw data into model inputs; data quality and representativeness limit achievable model performance.
Prebuilt AI services expose APIs for common tasks; custom ML services such as SageMaker build, train, and deploy models.
Fundamentals of Generative AI
Foundation models are large pretrained models adapted to downstream tasks through prompting, retrieval augmentation, or fine-tuning.
Tokens are subword units; context window limits count input tokens plus output tokens in one request.
Temperature controls randomness: lower values are more deterministic; higher values increase diversity; top-p and top-k also affect sampling.
Embeddings map text or images to vectors; semantic similarity is measured with cosine distance or vector distance.
RAG retrieves relevant documents and inserts them into the prompt to ground responses without retraining model weights.
Fine-tuning updates model weights on domain data; prompt engineering changes only the input instructions and examples.
Hallucination is fluent but unsupported output; mitigate with retrieval grounding, citations, evaluation, guardrails, and human review.
Transformer self-attention weighs relationships between tokens and enables parallel processing over long contexts.
Generative AI lifecycle stages include data selection, pretraining, adaptation, evaluation, deployment, and monitoring.
Applications of Foundation Models
Model selection considers task type, modality, latency, cost, context length, language support, and compliance requirements.
Prompt patterns include zero-shot, few-shot, chain-of-thought, role instructions, task instructions, and output-format constraints.
max tokens caps generated output length; stop sequences terminate generation when a specified string appears.
Amazon Bedrock provides managed API access to foundation models and supports guardrails, knowledge bases, agents, and evaluation.
RAG pipeline: ingest and chunk documents, create embeddings, index vectors, retrieve top-k matches, augment prompt, generate response.
Agents decompose tasks, call tools or APIs, use memory, and rely on orchestration to control multi-step workflows.
Customization options include fine-tuning, continued pretraining, and distillation; distillation trains a smaller model from a larger model's outputs.
Generative AI cost drivers include input and output tokens, model size, provisioned throughput, and vector storage or retrieval.
Evaluation methods include task metrics, human review, LLM-as-judge, A/B testing, latency measurement, and cost analysis.
Guidelines for Responsible AI
Responsible AI dimensions include fairness, explainability, privacy, safety, controllability, verifiability, transparency, and governance.
Bias sources include historical data, sampling methods, labeling practices, and proxy features; measure outcomes across subgroups.
Explainability methods include feature importance, SHAP, partial dependence, and counterfactuals; model cards document intended use and limitations.
Privacy controls include minimizing PII, anonymization or pseudonymization, encryption, access control, and retention limits.
Safety controls include content filters, guardrails, red-teaming, human oversight, and escalation paths for high-risk outputs.
Human-in-the-loop review is required where AI outputs affect rights, safety, or finances; automation bias can reduce review effectiveness.
Transparency practices disclose AI use and provide model, prompt, and version metadata with known limitations.
Fairness metrics include demographic parity, equal opportunity, and equalized odds; these can trade off against accuracy and each other.
Amazon Bedrock Guardrails filters harmful content and sensitive information; SageMaker Clarify detects bias and explains predictions.
Security, Compliance, and Governance for AI Solutions
Shared responsibility: AWS secures the cloud infrastructure; customers secure data, identities, prompts, model configuration, and applications.
Least privilege uses scoped IAM roles and policies; avoid long-term access keys and grant only permissions required for each workload.
Data protection uses encryption at rest with KMS, encryption in transit with TLS, and private connectivity through VPC endpoints or PrivateLink.
Prompt injection uses malicious input to alter model behavior; mitigate with input validation, guardrails, and least-privilege tool access.
Data poisoning corrupts training or retrieval data; controls include source validation, data lineage, and restricted write access.
Compliance obligations may include GDPR, HIPAA, SOC, and ISO requirements; data residency and retention rules vary by jurisdiction.
Monitoring uses CloudTrail for API activity, CloudWatch for metrics and alarms, model invocation logging, and anomaly detection.
Model governance includes versioning, approval workflows, lineage records, evaluation evidence, drift monitoring, and decommissioning.
Generative AI security protects model weights, restricts tool permissions, sanitizes retrieved content, and monitors outputs for leakage or misuse.