AAIA study materials
AAIA study resources

AAIA cheat sheet

AAIA · Keep the key ideas within reach.

Quick reference

Fundamentals of AI and ML

  • Supervised learning uses labeled pairs (x, y); unsupervised learning finds structure in unlabeled x; reinforcement learning optimizes a policy from reward signals.

  • Regression predicts continuous targets and is scored with MAE, RMSE, or R²; classification predicts discrete labels and is scored with accuracy, precision, recall, F1, or AUC-ROC.

  • Precision = TP/(TP+FP); recall = TP/(TP+FN); F1 = 2·(precision·recall)/(precision+recall). Accuracy misleads on class-imbalanced data.

  • Overfitting shows low training error and high validation error; remedies are more data, regularization (L1/L2), dropout, early stopping, and simpler models.

  • Bias is systematic error from wrong assumptions (underfitting); variance is sensitivity to training noise (overfitting). The bias–variance tradeoff governs model capacity.

  • K-fold cross-validation splits data into k folds, training on k−1 and validating on the held-out fold; it reduces evaluation variance versus a single split.

  • Gradient descent updates parameters as θ ← θ − η·∇L(θ); learning rate η too large diverges, too small converges slowly.

  • Feature engineering creates informative inputs (scaling, encoding, interaction terms); leakage occurs when validation data influences training and inflates scores.

Quick reference

Fundamentals of Generative AI

  • A transformer computes self-attention as softmax(QKᵀ/√d_k)V, letting each token weight all others in context; this replaced recurrence for most large language models.

  • Tokenization splits text into subword units; context window is the maximum token count the model can attend to at once, bounding prompt plus output length.

  • Pretraining uses self-supervised next-token prediction; fine-tuning adapts weights to a task; instruction tuning and RLHF align outputs with human preferences.

  • Temperature scales logits before softmax: low temperature sharpens the distribution (deterministic), high temperature flattens it (diverse, higher hallucination risk).

  • Top-p (nucleus) sampling keeps the smallest token set whose cumulative probability exceeds p; top-k keeps the k highest-probability tokens.

  • Retrieval-augmented generation (RAG) embeds documents, retrieves top-k chunks by vector similarity, and inserts them into the prompt to ground answers in sources.

  • Hallucination is fluent but unsupported output; it arises because models optimize likelihood, not factual truth, and is mitigated by grounding, citations, and verification.

  • Embeddings map text to dense vectors where cosine similarity reflects semantic relatedness; diffusion models generate images by iteratively denoising random noise.

Quick reference

Applications of Foundation Models

  • Prompt engineering patterns: zero-shot instruction, few-shot examples, chain-of-thought reasoning, and role/system prompts that constrain tone and scope.

  • RAG suits knowledge that changes often or is proprietary; fine-tuning suits fixed style, format, or domain behavior. Prefer RAG when citations and freshness matter.

  • Vector databases index embeddings and support approximate nearest-neighbor search (e.g., HNSW, IVF); retrieval quality depends on chunking strategy and embedding model.

  • Agents combine an LLM with tools and a planning loop: observe → reason → act → observe. Function calling lets the model emit structured arguments for external APIs.

  • Model evaluation uses task-specific benchmarks plus human review; LLM-as-judge scales evaluation but inherits judge bias and must be calibrated against human labels.

  • Latency and cost scale with token count; reduce both via prompt compression, caching, smaller models for simple tasks, and streaming responses.

  • Multimodal models accept text, images, and audio; use cases include document extraction, visual QA, captioning, and transcription-to-summary pipelines.

  • Guardrails for applications include input validation, output schema enforcement (JSON mode), content filters, and fallback responses on low-confidence retrieval.

Quick reference

Guidelines for Responsible AI

  • Core responsible-AI principles: fairness, transparency/explainability, privacy, safety, accountability, and human oversight.

  • Fairness metrics include demographic parity (equal positive rates), equalized odds (equal TPR and FPR across groups), and calibration within groups; they can conflict, so the choice is a policy decision.

  • Proxy variables (e.g., ZIP code) can reintroduce bias even after protected attributes are removed; disparate impact testing is required, not just attribute exclusion.

  • Explainability methods: SHAP attributes predictions via Shapley values; LIME fits local surrogate models; feature importance and counterfactuals support global and local explanations.

  • Human-in-the-loop review is required for high-stakes decisions; automation bias occurs when reviewers over-trust model output, so interfaces must surface uncertainty.

  • Transparency artifacts include model cards (intended use, limits, metrics) and datasheets for datasets (provenance, collection method, known gaps).

  • Privacy techniques: data minimization, de-identification, differential privacy (calibrated noise), and federated learning (training without centralizing raw data).

  • Red-teaming probes harmful outputs (bias, toxicity, jailbreaks) before release; findings feed mitigation and documented residual risk acceptance.

Quick reference

Security, Compliance, and Governance for AI Solutions

  • Shared responsibility: the cloud provider secures the infrastructure; the customer secures data, identity, prompts, model configuration, and access policies.

  • Prompt injection is untrusted text altering model instructions; defenses include input/output filtering, least-privilege tool access, and separating trusted instructions from retrieved content.

  • Data poisoning corrupts training data; model theft/extraction reconstructs behavior via queries; membership inference detects training records. Mitigations: provenance checks, rate limits, output perturbation.

  • Governance controls map to frameworks such as NIST AI RMF (Govern, Map, Measure, Manage) and ISO/IEC 42001 for AI management systems; these are voluntary unless adopted by contract or regulation.

  • Risk-tiered regulation: the EU AI Act bans certain practices, imposes strict duties on high-risk systems (risk management, logging, human oversight, conformity assessment), and requires transparency for general-purpose models.

  • Compliance obligations span GDPR (lawful basis, data-subject rights, cross-border transfer), sector rules (HIPAA, financial services), and IP/licensing of training data and model outputs.

  • Logging and monitoring requirements: capture prompts, responses, model versions, and access events; retain per policy; enable audit trails and anomaly detection.

  • Encryption in transit (TLS) and at rest (KMS-managed keys), plus secrets management, network isolation, and role-based access control, are baseline controls for AI workloads.

Quick reference

Fundamentals of AI and ML

  • Supervised learning uses labeled pairs (x, y); unsupervised learning finds structure in unlabeled x; reinforcement learning optimizes a policy from reward signals.

  • Regression predicts continuous targets and is scored with MAE, RMSE, or R²; classification predicts discrete labels and is scored with accuracy, precision, recall, F1, or AUC-ROC.

  • Precision = TP/(TP+FP); recall = TP/(TP+FN); F1 = 2·(precision·recall)/(precision+recall). Accuracy misleads on class-imbalanced data.

  • Overfitting shows low training error and high validation error; remedies are more data, regularization (L1/L2), dropout, early stopping, and simpler models.

  • Bias is systematic error from wrong assumptions (underfitting); variance is sensitivity to training noise (overfitting). The bias–variance tradeoff governs model capacity.

  • K-fold cross-validation splits data into k folds, training on k−1 and validating on the held-out fold; it reduces evaluation variance versus a single split.

  • Gradient descent updates parameters as θ ← θ − η·∇L(θ); learning rate η too large diverges, too small converges slowly.

  • Feature engineering creates informative inputs (scaling, encoding, interaction terms); leakage occurs when validation data influences training and inflates scores.

Quick reference

Fundamentals of Generative AI

  • A transformer computes self-attention as softmax(QKᵀ/√d_k)V, letting each token weight all others in context; this replaced recurrence for most large language models.

  • Tokenization splits text into subword units; context window is the maximum token count the model can attend to at once, bounding prompt plus output length.

  • Pretraining uses self-supervised next-token prediction; fine-tuning adapts weights to a task; instruction tuning and RLHF align outputs with human preferences.

  • Temperature scales logits before softmax: low temperature sharpens the distribution (deterministic), high temperature flattens it (diverse, higher hallucination risk).

  • Top-p (nucleus) sampling keeps the smallest token set whose cumulative probability exceeds p; top-k keeps the k highest-probability tokens.

  • Retrieval-augmented generation (RAG) embeds documents, retrieves top-k chunks by vector similarity, and inserts them into the prompt to ground answers in sources.

  • Hallucination is fluent but unsupported output; it arises because models optimize likelihood, not factual truth, and is mitigated by grounding, citations, and verification.

  • Embeddings map text to dense vectors where cosine similarity reflects semantic relatedness; diffusion models generate images by iteratively denoising random noise.

Quick reference

Applications of Foundation Models

  • Prompt engineering patterns: zero-shot instruction, few-shot examples, chain-of-thought reasoning, and role/system prompts that constrain tone and scope.

  • RAG suits knowledge that changes often or is proprietary; fine-tuning suits fixed style, format, or domain behavior. Prefer RAG when citations and freshness matter.

  • Vector databases index embeddings and support approximate nearest-neighbor search (e.g., HNSW, IVF); retrieval quality depends on chunking strategy and embedding model.

  • Agents combine an LLM with tools and a planning loop: observe → reason → act → observe. Function calling lets the model emit structured arguments for external APIs.

  • Model evaluation uses task-specific benchmarks plus human review; LLM-as-judge scales evaluation but inherits judge bias and must be calibrated against human labels.

  • Latency and cost scale with token count; reduce both via prompt compression, caching, smaller models for simple tasks, and streaming responses.

  • Multimodal models accept text, images, and audio; use cases include document extraction, visual QA, captioning, and transcription-to-summary pipelines.

  • Guardrails for applications include input validation, output schema enforcement (JSON mode), content filters, and fallback responses on low-confidence retrieval.

Quick reference

Guidelines for Responsible AI

  • Core responsible-AI principles: fairness, transparency/explainability, privacy, safety, accountability, and human oversight.

  • Fairness metrics include demographic parity (equal positive rates), equalized odds (equal TPR and FPR across groups), and calibration within groups; they can conflict, so the choice is a policy decision.

  • Proxy variables (e.g., ZIP code) can reintroduce bias even after protected attributes are removed; disparate impact testing is required, not just attribute exclusion.

  • Explainability methods: SHAP attributes predictions via Shapley values; LIME fits local surrogate models; feature importance and counterfactuals support global and local explanations.

  • Human-in-the-loop review is required for high-stakes decisions; automation bias occurs when reviewers over-trust model output, so interfaces must surface uncertainty.

  • Transparency artifacts include model cards (intended use, limits, metrics) and datasheets for datasets (provenance, collection method, known gaps).

  • Privacy techniques: data minimization, de-identification, differential privacy (calibrated noise), and federated learning (training without centralizing raw data).

  • Red-teaming probes harmful outputs (bias, toxicity, jailbreaks) before release; findings feed mitigation and documented residual risk acceptance.

Quick reference

Security, Compliance, and Governance for AI Solutions

  • Shared responsibility: the cloud provider secures the infrastructure; the customer secures data, identity, prompts, model configuration, and access policies.

  • Prompt injection is untrusted text altering model instructions; defenses include input/output filtering, least-privilege tool access, and separating trusted instructions from retrieved content.

  • Data poisoning corrupts training data; model theft/extraction reconstructs behavior via queries; membership inference detects training records. Mitigations: provenance checks, rate limits, output perturbation.

  • Governance controls map to frameworks such as NIST AI RMF (Govern, Map, Measure, Manage) and ISO/IEC 42001 for AI management systems; these are voluntary unless adopted by contract or regulation.

  • Risk-tiered regulation: the EU AI Act bans certain practices, imposes strict duties on high-risk systems (risk management, logging, human oversight, conformity assessment), and requires transparency for general-purpose models.

  • Compliance obligations span GDPR (lawful basis, data-subject rights, cross-border transfer), sector rules (HIPAA, financial services), and IP/licensing of training data and model outputs.

  • Logging and monitoring requirements: capture prompts, responses, model versions, and access events; retain per policy; enable audit trails and anomaly detection.

  • Encryption in transit (TLS) and at rest (KMS-managed keys), plus secrets management, network isolation, and role-based access control, are baseline controls for AI workloads.

Quick reference

Fundamentals of AI and ML

  • Supervised learning uses labeled pairs (x, y); unsupervised learning finds structure in unlabeled x; reinforcement learning optimizes a policy from reward signals.

  • Regression predicts continuous targets and is scored with MAE, RMSE, or R²; classification predicts discrete labels and is scored with accuracy, precision, recall, F1, or AUC-ROC.

  • Precision = TP/(TP+FP); recall = TP/(TP+FN); F1 = 2·(precision·recall)/(precision+recall). Accuracy misleads on class-imbalanced data.

  • Overfitting shows low training error and high validation error; remedies are more data, regularization (L1/L2), dropout, early stopping, and simpler models.

  • Bias is systematic error from wrong assumptions (underfitting); variance is sensitivity to training noise (overfitting). The bias–variance tradeoff governs model capacity.

  • K-fold cross-validation splits data into k folds, training on k−1 and validating on the held-out fold; it reduces evaluation variance versus a single split.

  • Gradient descent updates parameters as θ ← θ − η·∇L(θ); learning rate η too large diverges, too small converges slowly.

  • Feature engineering creates informative inputs (scaling, encoding, interaction terms); leakage occurs when validation data influences training and inflates scores.

Quick reference

Fundamentals of Generative AI

  • A transformer computes self-attention as softmax(QKᵀ/√d_k)V, letting each token weight all others in context; this replaced recurrence for most large language models.

  • Tokenization splits text into subword units; context window is the maximum token count the model can attend to at once, bounding prompt plus output length.

  • Pretraining uses self-supervised next-token prediction; fine-tuning adapts weights to a task; instruction tuning and RLHF align outputs with human preferences.

  • Temperature scales logits before softmax: low temperature sharpens the distribution (deterministic), high temperature flattens it (diverse, higher hallucination risk).

  • Top-p (nucleus) sampling keeps the smallest token set whose cumulative probability exceeds p; top-k keeps the k highest-probability tokens.

  • Retrieval-augmented generation (RAG) embeds documents, retrieves top-k chunks by vector similarity, and inserts them into the prompt to ground answers in sources.

  • Hallucination is fluent but unsupported output; it arises because models optimize likelihood, not factual truth, and is mitigated by grounding, citations, and verification.

  • Embeddings map text to dense vectors where cosine similarity reflects semantic relatedness; diffusion models generate images by iteratively denoising random noise.

Quick reference

Applications of Foundation Models

  • Prompt engineering patterns: zero-shot instruction, few-shot examples, chain-of-thought reasoning, and role/system prompts that constrain tone and scope.

  • RAG suits knowledge that changes often or is proprietary; fine-tuning suits fixed style, format, or domain behavior. Prefer RAG when citations and freshness matter.

  • Vector databases index embeddings and support approximate nearest-neighbor search (e.g., HNSW, IVF); retrieval quality depends on chunking strategy and embedding model.

  • Agents combine an LLM with tools and a planning loop: observe → reason → act → observe. Function calling lets the model emit structured arguments for external APIs.

  • Model evaluation uses task-specific benchmarks plus human review; LLM-as-judge scales evaluation but inherits judge bias and must be calibrated against human labels.

  • Latency and cost scale with token count; reduce both via prompt compression, caching, smaller models for simple tasks, and streaming responses.

  • Multimodal models accept text, images, and audio; use cases include document extraction, visual QA, captioning, and transcription-to-summary pipelines.

  • Guardrails for applications include input validation, output schema enforcement (JSON mode), content filters, and fallback responses on low-confidence retrieval.

Quick reference

Guidelines for Responsible AI

  • Core responsible-AI principles: fairness, transparency/explainability, privacy, safety, accountability, and human oversight.

  • Fairness metrics include demographic parity (equal positive rates), equalized odds (equal TPR and FPR across groups), and calibration within groups; they can conflict, so the choice is a policy decision.

  • Proxy variables (e.g., ZIP code) can reintroduce bias even after protected attributes are removed; disparate impact testing is required, not just attribute exclusion.

  • Explainability methods: SHAP attributes predictions via Shapley values; LIME fits local surrogate models; feature importance and counterfactuals support global and local explanations.

  • Human-in-the-loop review is required for high-stakes decisions; automation bias occurs when reviewers over-trust model output, so interfaces must surface uncertainty.

  • Transparency artifacts include model cards (intended use, limits, metrics) and datasheets for datasets (provenance, collection method, known gaps).

  • Privacy techniques: data minimization, de-identification, differential privacy (calibrated noise), and federated learning (training without centralizing raw data).

  • Red-teaming probes harmful outputs (bias, toxicity, jailbreaks) before release; findings feed mitigation and documented residual risk acceptance.

Quick reference

Security, Compliance, and Governance for AI Solutions

  • Shared responsibility: the cloud provider secures the infrastructure; the customer secures data, identity, prompts, model configuration, and access policies.

  • Prompt injection is untrusted text altering model instructions; defenses include input/output filtering, least-privilege tool access, and separating trusted instructions from retrieved content.

  • Data poisoning corrupts training data; model theft/extraction reconstructs behavior via queries; membership inference detects training records. Mitigations: provenance checks, rate limits, output perturbation.

  • Governance controls map to frameworks such as NIST AI RMF (Govern, Map, Measure, Manage) and ISO/IEC 42001 for AI management systems; these are voluntary unless adopted by contract or regulation.

  • Risk-tiered regulation: the EU AI Act bans certain practices, imposes strict duties on high-risk systems (risk management, logging, human oversight, conformity assessment), and requires transparency for general-purpose models.

  • Compliance obligations span GDPR (lawful basis, data-subject rights, cross-border transfer), sector rules (HIPAA, financial services), and IP/licensing of training data and model outputs.

  • Logging and monitoring requirements: capture prompts, responses, model versions, and access events; retain per policy; enable audit trails and anomaly detection.

  • Encryption in transit (TLS) and at rest (KMS-managed keys), plus secrets management, network isolation, and role-based access control, are baseline controls for AI workloads.

Quick reference

Fundamentals of AI and ML

  • Supervised learning uses labeled pairs (x, y); unsupervised learning finds structure in unlabeled x; reinforcement learning optimizes a policy from reward signals.

  • Regression predicts continuous targets and is scored with MAE, RMSE, or R²; classification predicts discrete labels and is scored with accuracy, precision, recall, F1, or AUC-ROC.

  • Precision = TP/(TP+FP); recall = TP/(TP+FN); F1 = 2·(precision·recall)/(precision+recall). Accuracy misleads on class-imbalanced data.

  • Overfitting shows low training error and high validation error; remedies are more data, regularization (L1/L2), dropout, early stopping, and simpler models.

  • Bias is systematic error from wrong assumptions (underfitting); variance is sensitivity to training noise (overfitting). The bias–variance tradeoff governs model capacity.

  • K-fold cross-validation splits data into k folds, training on k−1 and validating on the held-out fold; it reduces evaluation variance versus a single split.

  • Gradient descent updates parameters as θ ← θ − η·∇L(θ); learning rate η too large diverges, too small converges slowly.

  • Feature engineering creates informative inputs (scaling, encoding, interaction terms); leakage occurs when validation data influences training and inflates scores.

Quick reference

Fundamentals of Generative AI

  • A transformer computes self-attention as softmax(QKᵀ/√d_k)V, letting each token weight all others in context; this replaced recurrence for most large language models.

  • Tokenization splits text into subword units; context window is the maximum token count the model can attend to at once, bounding prompt plus output length.

  • Pretraining uses self-supervised next-token prediction; fine-tuning adapts weights to a task; instruction tuning and RLHF align outputs with human preferences.

  • Temperature scales logits before softmax: low temperature sharpens the distribution (deterministic), high temperature flattens it (diverse, higher hallucination risk).

  • Top-p (nucleus) sampling keeps the smallest token set whose cumulative probability exceeds p; top-k keeps the k highest-probability tokens.

  • Retrieval-augmented generation (RAG) embeds documents, retrieves top-k chunks by vector similarity, and inserts them into the prompt to ground answers in sources.

  • Hallucination is fluent but unsupported output; it arises because models optimize likelihood, not factual truth, and is mitigated by grounding, citations, and verification.

  • Embeddings map text to dense vectors where cosine similarity reflects semantic relatedness; diffusion models generate images by iteratively denoising random noise.

Quick reference

Applications of Foundation Models

  • Prompt engineering patterns: zero-shot instruction, few-shot examples, chain-of-thought reasoning, and role/system prompts that constrain tone and scope.

  • RAG suits knowledge that changes often or is proprietary; fine-tuning suits fixed style, format, or domain behavior. Prefer RAG when citations and freshness matter.

  • Vector databases index embeddings and support approximate nearest-neighbor search (e.g., HNSW, IVF); retrieval quality depends on chunking strategy and embedding model.

  • Agents combine an LLM with tools and a planning loop: observe → reason → act → observe. Function calling lets the model emit structured arguments for external APIs.

  • Model evaluation uses task-specific benchmarks plus human review; LLM-as-judge scales evaluation but inherits judge bias and must be calibrated against human labels.

  • Latency and cost scale with token count; reduce both via prompt compression, caching, smaller models for simple tasks, and streaming responses.

  • Multimodal models accept text, images, and audio; use cases include document extraction, visual QA, captioning, and transcription-to-summary pipelines.

  • Guardrails for applications include input validation, output schema enforcement (JSON mode), content filters, and fallback responses on low-confidence retrieval.

Quick reference

Guidelines for Responsible AI

  • Core responsible-AI principles: fairness, transparency/explainability, privacy, safety, accountability, and human oversight.

  • Fairness metrics include demographic parity (equal positive rates), equalized odds (equal TPR and FPR across groups), and calibration within groups; they can conflict, so the choice is a policy decision.

  • Proxy variables (e.g., ZIP code) can reintroduce bias even after protected attributes are removed; disparate impact testing is required, not just attribute exclusion.

  • Explainability methods: SHAP attributes predictions via Shapley values; LIME fits local surrogate models; feature importance and counterfactuals support global and local explanations.

  • Human-in-the-loop review is required for high-stakes decisions; automation bias occurs when reviewers over-trust model output, so interfaces must surface uncertainty.

  • Transparency artifacts include model cards (intended use, limits, metrics) and datasheets for datasets (provenance, collection method, known gaps).

  • Privacy techniques: data minimization, de-identification, differential privacy (calibrated noise), and federated learning (training without centralizing raw data).

  • Red-teaming probes harmful outputs (bias, toxicity, jailbreaks) before release; findings feed mitigation and documented residual risk acceptance.

Quick reference

Security, Compliance, and Governance for AI Solutions

  • Shared responsibility: the cloud provider secures the infrastructure; the customer secures data, identity, prompts, model configuration, and access policies.

  • Prompt injection is untrusted text altering model instructions; defenses include input/output filtering, least-privilege tool access, and separating trusted instructions from retrieved content.

  • Data poisoning corrupts training data; model theft/extraction reconstructs behavior via queries; membership inference detects training records. Mitigations: provenance checks, rate limits, output perturbation.

  • Governance controls map to frameworks such as NIST AI RMF (Govern, Map, Measure, Manage) and ISO/IEC 42001 for AI management systems; these are voluntary unless adopted by contract or regulation.

  • Risk-tiered regulation: the EU AI Act bans certain practices, imposes strict duties on high-risk systems (risk management, logging, human oversight, conformity assessment), and requires transparency for general-purpose models.

  • Compliance obligations span GDPR (lawful basis, data-subject rights, cross-border transfer), sector rules (HIPAA, financial services), and IP/licensing of training data and model outputs.

  • Logging and monitoring requirements: capture prompts, responses, model versions, and access events; retain per policy; enable audit trails and anomaly detection.

  • Encryption in transit (TLS) and at rest (KMS-managed keys), plus secrets management, network isolation, and role-based access control, are baseline controls for AI workloads.

Quick reference

Fundamentals of AI and ML

  • Supervised learning uses labeled pairs (x, y); unsupervised learning finds structure in unlabeled x; reinforcement learning optimizes a policy from reward signals.

  • Regression predicts continuous targets and is scored with MAE, RMSE, or R²; classification predicts discrete labels and is scored with accuracy, precision, recall, F1, or AUC-ROC.

  • Precision = TP/(TP+FP); recall = TP/(TP+FN); F1 = 2·(precision·recall)/(precision+recall). Accuracy misleads on class-imbalanced data.

  • Overfitting shows low training error and high validation error; remedies are more data, regularization (L1/L2), dropout, early stopping, and simpler models.

  • Bias is systematic error from wrong assumptions (underfitting); variance is sensitivity to training noise (overfitting). The bias–variance tradeoff governs model capacity.

  • K-fold cross-validation splits data into k folds, training on k−1 and validating on the held-out fold; it reduces evaluation variance versus a single split.

  • Gradient descent updates parameters as θ ← θ − η·∇L(θ); learning rate η too large diverges, too small converges slowly.

  • Feature engineering creates informative inputs (scaling, encoding, interaction terms); leakage occurs when validation data influences training and inflates scores.

Quick reference

Fundamentals of Generative AI

  • A transformer computes self-attention as softmax(QKᵀ/√d_k)V, letting each token weight all others in context; this replaced recurrence for most large language models.

  • Tokenization splits text into subword units; context window is the maximum token count the model can attend to at once, bounding prompt plus output length.

  • Pretraining uses self-supervised next-token prediction; fine-tuning adapts weights to a task; instruction tuning and RLHF align outputs with human preferences.

  • Temperature scales logits before softmax: low temperature sharpens the distribution (deterministic), high temperature flattens it (diverse, higher hallucination risk).

  • Top-p (nucleus) sampling keeps the smallest token set whose cumulative probability exceeds p; top-k keeps the k highest-probability tokens.

  • Retrieval-augmented generation (RAG) embeds documents, retrieves top-k chunks by vector similarity, and inserts them into the prompt to ground answers in sources.

  • Hallucination is fluent but unsupported output; it arises because models optimize likelihood, not factual truth, and is mitigated by grounding, citations, and verification.

  • Embeddings map text to dense vectors where cosine similarity reflects semantic relatedness; diffusion models generate images by iteratively denoising random noise.

Quick reference

Applications of Foundation Models

  • Prompt engineering patterns: zero-shot instruction, few-shot examples, chain-of-thought reasoning, and role/system prompts that constrain tone and scope.

  • RAG suits knowledge that changes often or is proprietary; fine-tuning suits fixed style, format, or domain behavior. Prefer RAG when citations and freshness matter.

  • Vector databases index embeddings and support approximate nearest-neighbor search (e.g., HNSW, IVF); retrieval quality depends on chunking strategy and embedding model.

  • Agents combine an LLM with tools and a planning loop: observe → reason → act → observe. Function calling lets the model emit structured arguments for external APIs.

  • Model evaluation uses task-specific benchmarks plus human review; LLM-as-judge scales evaluation but inherits judge bias and must be calibrated against human labels.

  • Latency and cost scale with token count; reduce both via prompt compression, caching, smaller models for simple tasks, and streaming responses.

  • Multimodal models accept text, images, and audio; use cases include document extraction, visual QA, captioning, and transcription-to-summary pipelines.

  • Guardrails for applications include input validation, output schema enforcement (JSON mode), content filters, and fallback responses on low-confidence retrieval.

Quick reference

Guidelines for Responsible AI

  • Core responsible-AI principles: fairness, transparency/explainability, privacy, safety, accountability, and human oversight.

  • Fairness metrics include demographic parity (equal positive rates), equalized odds (equal TPR and FPR across groups), and calibration within groups; they can conflict, so the choice is a policy decision.

  • Proxy variables (e.g., ZIP code) can reintroduce bias even after protected attributes are removed; disparate impact testing is required, not just attribute exclusion.

  • Explainability methods: SHAP attributes predictions via Shapley values; LIME fits local surrogate models; feature importance and counterfactuals support global and local explanations.

  • Human-in-the-loop review is required for high-stakes decisions; automation bias occurs when reviewers over-trust model output, so interfaces must surface uncertainty.

  • Transparency artifacts include model cards (intended use, limits, metrics) and datasheets for datasets (provenance, collection method, known gaps).

  • Privacy techniques: data minimization, de-identification, differential privacy (calibrated noise), and federated learning (training without centralizing raw data).

  • Red-teaming probes harmful outputs (bias, toxicity, jailbreaks) before release; findings feed mitigation and documented residual risk acceptance.

Quick reference

Security, Compliance, and Governance for AI Solutions

  • Shared responsibility: the cloud provider secures the infrastructure; the customer secures data, identity, prompts, model configuration, and access policies.

  • Prompt injection is untrusted text altering model instructions; defenses include input/output filtering, least-privilege tool access, and separating trusted instructions from retrieved content.

  • Data poisoning corrupts training data; model theft/extraction reconstructs behavior via queries; membership inference detects training records. Mitigations: provenance checks, rate limits, output perturbation.

  • Governance controls map to frameworks such as NIST AI RMF (Govern, Map, Measure, Manage) and ISO/IEC 42001 for AI management systems; these are voluntary unless adopted by contract or regulation.

  • Risk-tiered regulation: the EU AI Act bans certain practices, imposes strict duties on high-risk systems (risk management, logging, human oversight, conformity assessment), and requires transparency for general-purpose models.

  • Compliance obligations span GDPR (lawful basis, data-subject rights, cross-border transfer), sector rules (HIPAA, financial services), and IP/licensing of training data and model outputs.

  • Logging and monitoring requirements: capture prompts, responses, model versions, and access events; retain per policy; enable audit trails and anomaly detection.

  • Encryption in transit (TLS) and at rest (KMS-managed keys), plus secrets management, network isolation, and role-based access control, are baseline controls for AI workloads.

Quick reference

Fundamentals of AI and ML

  • Supervised learning uses labeled pairs (x, y); unsupervised learning finds structure in unlabeled x; reinforcement learning optimizes a policy from reward signals.

  • Regression predicts continuous targets and is scored with MAE, RMSE, or R²; classification predicts discrete labels and is scored with accuracy, precision, recall, F1, or AUC-ROC.

  • Precision = TP/(TP+FP); recall = TP/(TP+FN); F1 = 2·(precision·recall)/(precision+recall). Accuracy misleads on class-imbalanced data.

  • Overfitting shows low training error and high validation error; remedies are more data, regularization (L1/L2), dropout, early stopping, and simpler models.

  • Bias is systematic error from wrong assumptions (underfitting); variance is sensitivity to training noise (overfitting). The bias–variance tradeoff governs model capacity.

  • K-fold cross-validation splits data into k folds, training on k−1 and validating on the held-out fold; it reduces evaluation variance versus a single split.

  • Gradient descent updates parameters as θ ← θ − η·∇L(θ); learning rate η too large diverges, too small converges slowly.

  • Feature engineering creates informative inputs (scaling, encoding, interaction terms); leakage occurs when validation data influences training and inflates scores.

Quick reference

Fundamentals of Generative AI

  • A transformer computes self-attention as softmax(QKᵀ/√d_k)V, letting each token weight all others in context; this replaced recurrence for most large language models.

  • Tokenization splits text into subword units; context window is the maximum token count the model can attend to at once, bounding prompt plus output length.

  • Pretraining uses self-supervised next-token prediction; fine-tuning adapts weights to a task; instruction tuning and RLHF align outputs with human preferences.

  • Temperature scales logits before softmax: low temperature sharpens the distribution (deterministic), high temperature flattens it (diverse, higher hallucination risk).

  • Top-p (nucleus) sampling keeps the smallest token set whose cumulative probability exceeds p; top-k keeps the k highest-probability tokens.

  • Retrieval-augmented generation (RAG) embeds documents, retrieves top-k chunks by vector similarity, and inserts them into the prompt to ground answers in sources.

  • Hallucination is fluent but unsupported output; it arises because models optimize likelihood, not factual truth, and is mitigated by grounding, citations, and verification.

  • Embeddings map text to dense vectors where cosine similarity reflects semantic relatedness; diffusion models generate images by iteratively denoising random noise.

Quick reference

Applications of Foundation Models

  • Prompt engineering patterns: zero-shot instruction, few-shot examples, chain-of-thought reasoning, and role/system prompts that constrain tone and scope.

  • RAG suits knowledge that changes often or is proprietary; fine-tuning suits fixed style, format, or domain behavior. Prefer RAG when citations and freshness matter.

  • Vector databases index embeddings and support approximate nearest-neighbor search (e.g., HNSW, IVF); retrieval quality depends on chunking strategy and embedding model.

  • Agents combine an LLM with tools and a planning loop: observe → reason → act → observe. Function calling lets the model emit structured arguments for external APIs.

  • Model evaluation uses task-specific benchmarks plus human review; LLM-as-judge scales evaluation but inherits judge bias and must be calibrated against human labels.

  • Latency and cost scale with token count; reduce both via prompt compression, caching, smaller models for simple tasks, and streaming responses.

  • Multimodal models accept text, images, and audio; use cases include document extraction, visual QA, captioning, and transcription-to-summary pipelines.

  • Guardrails for applications include input validation, output schema enforcement (JSON mode), content filters, and fallback responses on low-confidence retrieval.

Quick reference

Guidelines for Responsible AI

  • Core responsible-AI principles: fairness, transparency/explainability, privacy, safety, accountability, and human oversight.

  • Fairness metrics include demographic parity (equal positive rates), equalized odds (equal TPR and FPR across groups), and calibration within groups; they can conflict, so the choice is a policy decision.

  • Proxy variables (e.g., ZIP code) can reintroduce bias even after protected attributes are removed; disparate impact testing is required, not just attribute exclusion.

  • Explainability methods: SHAP attributes predictions via Shapley values; LIME fits local surrogate models; feature importance and counterfactuals support global and local explanations.

  • Human-in-the-loop review is required for high-stakes decisions; automation bias occurs when reviewers over-trust model output, so interfaces must surface uncertainty.

  • Transparency artifacts include model cards (intended use, limits, metrics) and datasheets for datasets (provenance, collection method, known gaps).

  • Privacy techniques: data minimization, de-identification, differential privacy (calibrated noise), and federated learning (training without centralizing raw data).

  • Red-teaming probes harmful outputs (bias, toxicity, jailbreaks) before release; findings feed mitigation and documented residual risk acceptance.

Quick reference

Security, Compliance, and Governance for AI Solutions

  • Shared responsibility: the cloud provider secures the infrastructure; the customer secures data, identity, prompts, model configuration, and access policies.

  • Prompt injection is untrusted text altering model instructions; defenses include input/output filtering, least-privilege tool access, and separating trusted instructions from retrieved content.

  • Data poisoning corrupts training data; model theft/extraction reconstructs behavior via queries; membership inference detects training records. Mitigations: provenance checks, rate limits, output perturbation.

  • Governance controls map to frameworks such as NIST AI RMF (Govern, Map, Measure, Manage) and ISO/IEC 42001 for AI management systems; these are voluntary unless adopted by contract or regulation.

  • Risk-tiered regulation: the EU AI Act bans certain practices, imposes strict duties on high-risk systems (risk management, logging, human oversight, conformity assessment), and requires transparency for general-purpose models.

  • Compliance obligations span GDPR (lawful basis, data-subject rights, cross-border transfer), sector rules (HIPAA, financial services), and IP/licensing of training data and model outputs.

  • Logging and monitoring requirements: capture prompts, responses, model versions, and access events; retain per policy; enable audit trails and anomaly detection.

  • Encryption in transit (TLS) and at rest (KMS-managed keys), plus secrets management, network isolation, and role-based access control, are baseline controls for AI workloads.

Quick reference

Fundamentals of AI and ML

  • Supervised learning uses labeled pairs (x, y); unsupervised learning finds structure in unlabeled x; reinforcement learning optimizes a policy from reward signals.

  • Regression predicts continuous targets and is scored with MAE, RMSE, or R²; classification predicts discrete labels and is scored with accuracy, precision, recall, F1, or AUC-ROC.

  • Precision = TP/(TP+FP); recall = TP/(TP+FN); F1 = 2·(precision·recall)/(precision+recall). Accuracy misleads on class-imbalanced data.

  • Overfitting shows low training error and high validation error; remedies are more data, regularization (L1/L2), dropout, early stopping, and simpler models.

  • Bias is systematic error from wrong assumptions (underfitting); variance is sensitivity to training noise (overfitting). The bias–variance tradeoff governs model capacity.

  • K-fold cross-validation splits data into k folds, training on k−1 and validating on the held-out fold; it reduces evaluation variance versus a single split.

  • Gradient descent updates parameters as θ ← θ − η·∇L(θ); learning rate η too large diverges, too small converges slowly.

  • Feature engineering creates informative inputs (scaling, encoding, interaction terms); leakage occurs when validation data influences training and inflates scores.

Quick reference

Fundamentals of Generative AI

  • A transformer computes self-attention as softmax(QKᵀ/√d_k)V, letting each token weight all others in context; this replaced recurrence for most large language models.

  • Tokenization splits text into subword units; context window is the maximum token count the model can attend to at once, bounding prompt plus output length.

  • Pretraining uses self-supervised next-token prediction; fine-tuning adapts weights to a task; instruction tuning and RLHF align outputs with human preferences.

  • Temperature scales logits before softmax: low temperature sharpens the distribution (deterministic), high temperature flattens it (diverse, higher hallucination risk).

  • Top-p (nucleus) sampling keeps the smallest token set whose cumulative probability exceeds p; top-k keeps the k highest-probability tokens.

  • Retrieval-augmented generation (RAG) embeds documents, retrieves top-k chunks by vector similarity, and inserts them into the prompt to ground answers in sources.

  • Hallucination is fluent but unsupported output; it arises because models optimize likelihood, not factual truth, and is mitigated by grounding, citations, and verification.

  • Embeddings map text to dense vectors where cosine similarity reflects semantic relatedness; diffusion models generate images by iteratively denoising random noise.

Quick reference

Applications of Foundation Models

  • Prompt engineering patterns: zero-shot instruction, few-shot examples, chain-of-thought reasoning, and role/system prompts that constrain tone and scope.

  • RAG suits knowledge that changes often or is proprietary; fine-tuning suits fixed style, format, or domain behavior. Prefer RAG when citations and freshness matter.

  • Vector databases index embeddings and support approximate nearest-neighbor search (e.g., HNSW, IVF); retrieval quality depends on chunking strategy and embedding model.

  • Agents combine an LLM with tools and a planning loop: observe → reason → act → observe. Function calling lets the model emit structured arguments for external APIs.

  • Model evaluation uses task-specific benchmarks plus human review; LLM-as-judge scales evaluation but inherits judge bias and must be calibrated against human labels.

  • Latency and cost scale with token count; reduce both via prompt compression, caching, smaller models for simple tasks, and streaming responses.

  • Multimodal models accept text, images, and audio; use cases include document extraction, visual QA, captioning, and transcription-to-summary pipelines.

  • Guardrails for applications include input validation, output schema enforcement (JSON mode), content filters, and fallback responses on low-confidence retrieval.

Quick reference

Guidelines for Responsible AI

  • Core responsible-AI principles: fairness, transparency/explainability, privacy, safety, accountability, and human oversight.

  • Fairness metrics include demographic parity (equal positive rates), equalized odds (equal TPR and FPR across groups), and calibration within groups; they can conflict, so the choice is a policy decision.

  • Proxy variables (e.g., ZIP code) can reintroduce bias even after protected attributes are removed; disparate impact testing is required, not just attribute exclusion.

  • Explainability methods: SHAP attributes predictions via Shapley values; LIME fits local surrogate models; feature importance and counterfactuals support global and local explanations.

  • Human-in-the-loop review is required for high-stakes decisions; automation bias occurs when reviewers over-trust model output, so interfaces must surface uncertainty.

  • Transparency artifacts include model cards (intended use, limits, metrics) and datasheets for datasets (provenance, collection method, known gaps).

  • Privacy techniques: data minimization, de-identification, differential privacy (calibrated noise), and federated learning (training without centralizing raw data).

  • Red-teaming probes harmful outputs (bias, toxicity, jailbreaks) before release; findings feed mitigation and documented residual risk acceptance.

Quick reference

Security, Compliance, and Governance for AI Solutions

  • Shared responsibility: the cloud provider secures the infrastructure; the customer secures data, identity, prompts, model configuration, and access policies.

  • Prompt injection is untrusted text altering model instructions; defenses include input/output filtering, least-privilege tool access, and separating trusted instructions from retrieved content.

  • Data poisoning corrupts training data; model theft/extraction reconstructs behavior via queries; membership inference detects training records. Mitigations: provenance checks, rate limits, output perturbation.

  • Governance controls map to frameworks such as NIST AI RMF (Govern, Map, Measure, Manage) and ISO/IEC 42001 for AI management systems; these are voluntary unless adopted by contract or regulation.

  • Risk-tiered regulation: the EU AI Act bans certain practices, imposes strict duties on high-risk systems (risk management, logging, human oversight, conformity assessment), and requires transparency for general-purpose models.

  • Compliance obligations span GDPR (lawful basis, data-subject rights, cross-border transfer), sector rules (HIPAA, financial services), and IP/licensing of training data and model outputs.

  • Logging and monitoring requirements: capture prompts, responses, model versions, and access events; retain per policy; enable audit trails and anomaly detection.

  • Encryption in transit (TLS) and at rest (KMS-managed keys), plus secrets management, network isolation, and role-based access control, are baseline controls for AI workloads.

Quick reference

Fundamentals of AI and ML

  • Supervised learning uses labeled pairs (x, y); unsupervised learning finds structure in unlabeled x; reinforcement learning optimizes a policy from reward signals.

  • Regression predicts continuous targets and is scored with MAE, RMSE, or R²; classification predicts discrete labels and is scored with accuracy, precision, recall, F1, or AUC-ROC.

  • Precision = TP/(TP+FP); recall = TP/(TP+FN); F1 = 2·(precision·recall)/(precision+recall). Accuracy misleads on class-imbalanced data.

  • Overfitting shows low training error and high validation error; remedies are more data, regularization (L1/L2), dropout, early stopping, and simpler models.

  • Bias is systematic error from wrong assumptions (underfitting); variance is sensitivity to training noise (overfitting). The bias–variance tradeoff governs model capacity.

  • K-fold cross-validation splits data into k folds, training on k−1 and validating on the held-out fold; it reduces evaluation variance versus a single split.

  • Gradient descent updates parameters as θ ← θ − η·∇L(θ); learning rate η too large diverges, too small converges slowly.

  • Feature engineering creates informative inputs (scaling, encoding, interaction terms); leakage occurs when validation data influences training and inflates scores.

Quick reference

Fundamentals of Generative AI

  • A transformer computes self-attention as softmax(QKᵀ/√d_k)V, letting each token weight all others in context; this replaced recurrence for most large language models.

  • Tokenization splits text into subword units; context window is the maximum token count the model can attend to at once, bounding prompt plus output length.

  • Pretraining uses self-supervised next-token prediction; fine-tuning adapts weights to a task; instruction tuning and RLHF align outputs with human preferences.

  • Temperature scales logits before softmax: low temperature sharpens the distribution (deterministic), high temperature flattens it (diverse, higher hallucination risk).

  • Top-p (nucleus) sampling keeps the smallest token set whose cumulative probability exceeds p; top-k keeps the k highest-probability tokens.

  • Retrieval-augmented generation (RAG) embeds documents, retrieves top-k chunks by vector similarity, and inserts them into the prompt to ground answers in sources.

  • Hallucination is fluent but unsupported output; it arises because models optimize likelihood, not factual truth, and is mitigated by grounding, citations, and verification.

  • Embeddings map text to dense vectors where cosine similarity reflects semantic relatedness; diffusion models generate images by iteratively denoising random noise.

Quick reference

Applications of Foundation Models

  • Prompt engineering patterns: zero-shot instruction, few-shot examples, chain-of-thought reasoning, and role/system prompts that constrain tone and scope.

  • RAG suits knowledge that changes often or is proprietary; fine-tuning suits fixed style, format, or domain behavior. Prefer RAG when citations and freshness matter.

  • Vector databases index embeddings and support approximate nearest-neighbor search (e.g., HNSW, IVF); retrieval quality depends on chunking strategy and embedding model.

  • Agents combine an LLM with tools and a planning loop: observe → reason → act → observe. Function calling lets the model emit structured arguments for external APIs.

  • Model evaluation uses task-specific benchmarks plus human review; LLM-as-judge scales evaluation but inherits judge bias and must be calibrated against human labels.

  • Latency and cost scale with token count; reduce both via prompt compression, caching, smaller models for simple tasks, and streaming responses.

  • Multimodal models accept text, images, and audio; use cases include document extraction, visual QA, captioning, and transcription-to-summary pipelines.

  • Guardrails for applications include input validation, output schema enforcement (JSON mode), content filters, and fallback responses on low-confidence retrieval.

Quick reference

Guidelines for Responsible AI

  • Core responsible-AI principles: fairness, transparency/explainability, privacy, safety, accountability, and human oversight.

  • Fairness metrics include demographic parity (equal positive rates), equalized odds (equal TPR and FPR across groups), and calibration within groups; they can conflict, so the choice is a policy decision.

  • Proxy variables (e.g., ZIP code) can reintroduce bias even after protected attributes are removed; disparate impact testing is required, not just attribute exclusion.

  • Explainability methods: SHAP attributes predictions via Shapley values; LIME fits local surrogate models; feature importance and counterfactuals support global and local explanations.

  • Human-in-the-loop review is required for high-stakes decisions; automation bias occurs when reviewers over-trust model output, so interfaces must surface uncertainty.

  • Transparency artifacts include model cards (intended use, limits, metrics) and datasheets for datasets (provenance, collection method, known gaps).

  • Privacy techniques: data minimization, de-identification, differential privacy (calibrated noise), and federated learning (training without centralizing raw data).

  • Red-teaming probes harmful outputs (bias, toxicity, jailbreaks) before release; findings feed mitigation and documented residual risk acceptance.

Quick reference

Security, Compliance, and Governance for AI Solutions

  • Shared responsibility: the cloud provider secures the infrastructure; the customer secures data, identity, prompts, model configuration, and access policies.

  • Prompt injection is untrusted text altering model instructions; defenses include input/output filtering, least-privilege tool access, and separating trusted instructions from retrieved content.

  • Data poisoning corrupts training data; model theft/extraction reconstructs behavior via queries; membership inference detects training records. Mitigations: provenance checks, rate limits, output perturbation.

  • Governance controls map to frameworks such as NIST AI RMF (Govern, Map, Measure, Manage) and ISO/IEC 42001 for AI management systems; these are voluntary unless adopted by contract or regulation.

  • Risk-tiered regulation: the EU AI Act bans certain practices, imposes strict duties on high-risk systems (risk management, logging, human oversight, conformity assessment), and requires transparency for general-purpose models.

  • Compliance obligations span GDPR (lawful basis, data-subject rights, cross-border transfer), sector rules (HIPAA, financial services), and IP/licensing of training data and model outputs.

  • Logging and monitoring requirements: capture prompts, responses, model versions, and access events; retain per policy; enable audit trails and anomaly detection.

  • Encryption in transit (TLS) and at rest (KMS-managed keys), plus secrets management, network isolation, and role-based access control, are baseline controls for AI workloads.