← pushpjeet.com · Tutorials & LabsDownload the PDF guide
Student Study GuideBeginner → AdvancedAWS + GenAI

AI & Machine Learning Foundations

A self-paced, interactive learning guide that takes you from “What is AI?” to “How does RAG work?” and helps you test your understanding as you learn.

Your learning goal: build the mental model first, understand the core concepts, then connect them to ML workflows, deep learning, generative AI and AWS services.

Your learning roadmap

  1. AI → ML → DL → Generative AI
  2. Data → Training → Model → Inference
  3. Neural networks → CV + NLP
  4. Foundation models → LLMs → RAG
  5. Bedrock vs SageMaker AI
  6. AWS AI services + cost thinking

1. Start Here: Your 60-Second Mental Model

Think about this: A computer can recognize a cat in a photo, translate Hindi to English, predict customer churn, and generate an email. Are all four examples of AI? Yes — but they can use very different techniques. Keep this distinction in mind throughout the guide.
AI
Broad field

Machines performing tasks that normally require aspects of human intelligence: perception, reasoning, language, planning, decision-making, generation.

ML
Learning from data

A major approach within AI where models learn patterns from examples instead of being explicitly programmed with every rule.

DL
Neural networks

A family of ML methods using multi-layer neural networks, especially powerful for images, audio, language and complex representations.

GenAI
Generating new content

Models that generate text, images, audio, video, code or other content based on learned patterns and a user/system input.

Artificial Intelligence
Big umbrella
Machine Learning
Learn from data
Deep Learning
Neural networks
Generative AI
Generation-focused systems

Questions you may be wondering

Q1. Is AI the same as machine learning?
No. AI is the broader field. ML is one way to build AI systems by learning patterns from data. Some AI systems can be built with rules, search, optimization or symbolic reasoning without ML.
Q2. Is every ML model an AI model?
In common industry usage, ML is treated as a major branch of AI. But “AI” is broader than ML. A simple regression model is ML even if it does not look intelligent to a human.
Q3. Is ChatGPT an AI, ML, deep-learning or generative-AI system?
It can be described at multiple levels: it is an AI system, built using ML, using deep neural networks, and specifically designed for generative AI tasks such as generating text. The labels are nested rather than mutually exclusive.
Q4. Can AI exist without ML?
Yes. Classical rule-based expert systems, search algorithms and symbolic reasoning are examples of AI approaches that do not necessarily learn from data.
Q5. Why did generative AI suddenly become so important?
Several trends converged: large datasets, powerful accelerators, transformer-based architectures, large-scale pretraining, better training methods and easy-to-use APIs/products. The result was a dramatic increase in the quality and accessibility of generated content.

2. Understand AI vs ML vs DL vs Generative AI

ConceptCore ideaTypical inputTypical outputExample
AISystems performing intelligent tasksRules, data, sensors, text, imagesDecision/action/contentGame-playing agent
MLLearn patterns from examplesFeatures + labels or unlabeled dataPrediction/classification/representationSpam classifier
DLDeep neural networks learn representationsImages, text, audio, sequencesPrediction/representation/generationImage classifier
Generative AIGenerate new contentPrompt/context/noise/conditioningText, image, audio, video, codeText-to-image model
Common misconception: These are not four competing technologies. They overlap. Think “sets and methods,” not four boxes with hard walls.

Use-case challenge

Classify each system. Click an answer to reveal the reasoning.

Predict house price from area, location and bedrooms.
Supervised ML — typically regression.
Detect a tumor from an X-ray image.
ML; deep learning is commonly used for image classification/segmentation.
Generate a product description from a product specification.
Generative AI, commonly using an LLM.
A rule engine rejects transactions containing a blocked country code.
Rule-based automation/AI-related decision system, but not necessarily ML.

Basic → Advanced questions

Basic What is the difference between prediction and generation?
Prediction usually estimates a target or probability, such as “fraud = 0.82.” Generation produces new content, such as a paragraph, image or code snippet.
Intermediate Can a generative model also perform classification?
Yes. A generative model can be prompted or adapted to classify text, images or other inputs. “Generative” describes a capability/approach, not a rule that the model can only generate.
Advanced Why can the same neural architecture support both prediction and generation?
Because the architecture defines how representations are transformed; the training objective, data, output head/decoding procedure and task determine what behavior the trained system learns.

3. Machine Learning Fundamentals

Raw data
Clean / prepare
Train
Evaluate
Deploy
Inference

Training a model — simple story

Suppose we want to predict whether a customer will cancel a subscription.

  1. Collect historical customer records.
  2. Define the target: churn = yes/no.
  3. Prepare features such as tenure, usage, plan and support calls.
  4. Split data into training/validation/test sets.
  5. Train a model on training data.
  6. Tune choices using validation data.
  7. Evaluate once more on unseen test data.
  8. Deploy and monitor it.

Labeled data

Each training example has an input and a known target.

(customer_features → churn=yes)

Typical: classification, regression.

Unlabeled data

Inputs exist, but a target label is not supplied.

customer_features → ?

Typical: clustering, representation learning, self-supervised learning.

Data typeExampleCommon ML treatment
StructuredRows/columns in a databaseTabular ML, regression, classification
UnstructuredImages, audio, free-form text, videoDeep learning, NLP, computer vision, multimodal models
Semi-structuredJSON, XML, logsParse into features/representations first

Inference: batch vs real-time

Batch inference

Process many records together on a schedule.

Example: generate tomorrow's recommendations for 10 million customers overnight.

Real-time inference

Respond to a request with low latency.

Example: score a payment transaction during checkout.

ML questions students ask

Q1. Why can't we simply train on all available data?
You need an honest way to estimate generalization to unseen data. If evaluation data has already influenced model selection, your measured performance can become overly optimistic. Proper train/validation/test separation helps.
Q2. What is overfitting?
The model fits the training data too closely, including noise or accidental patterns, and therefore performs worse on unseen data.
Q3. What is underfitting?
The model is too limited or insufficiently trained to capture important patterns, so it performs poorly even on training data.
Q4. Is more data always better?
No. More high-quality, representative data often helps, but noisy, biased, duplicated or incorrectly labeled data can hurt. Data quality and distribution matter.
Q5. What is a feature?
A measurable input representation used by a model. In tabular ML, examples include age, income or transaction amount. In deep learning, useful representations can be learned automatically from raw inputs.
Q6. What is data leakage?
When information that would not legitimately be available at prediction time leaks into training or evaluation. Leakage can produce impressive but misleading metrics.
Advanced Why can accuracy be a bad metric?
With class imbalance, a model can obtain high accuracy by mostly predicting the majority class. Precision, recall, F1, ROC-AUC, PR-AUC, calibration and business-specific costs may be more informative depending on the task.
Advanced What does generalization mean?
The ability of a trained model to perform well on new data drawn from the relevant deployment distribution, rather than merely memorizing the training examples.

4. Deep Learning Fundamentals

Input
pixels / tokens / audio
Layer 1
representation
Layer 2
higher-level features
Output
prediction / generation

A neural network learns parameters (weights and biases) so that its output minimizes a chosen loss function. During training, gradients computed by backpropagation are used by an optimizer to update those parameters.

Computer Vision

Works with images/video. Tasks include classification, object detection, segmentation, OCR and image generation.

NLP

Works with language. Tasks include classification, translation, summarization, question answering and text generation.

Representation learning

The network learns useful internal representations rather than requiring humans to manually specify every feature.

Q1. What is a neuron?
A mathematical unit that combines inputs using learned weights and a bias, then applies an activation function.
Q2. What is an activation function?
A nonlinear function applied within a neural network. Nonlinearity allows stacked layers to represent complex functions. Examples include ReLU, sigmoid and tanh.
Q3. What is backpropagation?
An efficient application of the chain rule that computes gradients of the loss with respect to model parameters, allowing an optimizer to update them.
Q4. Why are GPUs useful?
Many neural-network operations can be expressed as large parallel tensor computations. GPUs are designed for high-throughput parallel numerical workloads.
Advanced Why does depth help?
Multiple nonlinear layers can build hierarchical representations. Earlier layers may learn lower-level patterns while later layers combine them into increasingly abstract features. This is a useful intuition, not a universal rule for every architecture.

5. Generative AI Fundamentals

Key idea: A generative model learns statistical structure in data and uses that learned structure to produce new outputs conditioned on an input, context, or latent/noise representation.

Foundation models

Foundation models are large, broadly capable models trained on extensive data and intended to be adapted or prompted for many downstream tasks. They can support language, vision, audio and multimodal use cases depending on the model.

LLMs and tokens

Token

A model-specific unit used to represent text. A token may be a whole word, part of a word, punctuation or another subword unit.

Important: token ≠ character ≠ word. Tokenization depends on the tokenizer.

LLM

A large language model is trained to model language patterns. Autoregressive LLMs commonly predict the next token given previous context.

Embeddings and vectors

An embedding maps an item such as text into a numerical vector in a learned representation space. Similar meanings can often occupy nearby regions, although “nearby” depends on the model and similarity metric.

text → embedding model → [0.12, -0.44, 0.83, ...] → vector database → similarity search

Diffusion models

Clean data
Forward diffusion
add noise
Noise
Reverse process
learn to denoise
Generated sample

GANs and VAEs

GAN

Two neural networks are trained in opposition: a generator creates samples and a discriminator attempts to distinguish generated samples from real samples.

VAE

A variational autoencoder learns a probabilistic latent representation and a decoder can sample from that latent space to generate outputs.

Multimodal models

Models that can work across multiple modalities, such as text + image, or text + audio, depending on the system. Multimodality is about the information types a model can process and/or generate.

Optimizing model outputs

TechniqueWhat changes?When useful?
Prompt engineeringThe instructions/context sent to the modelFast task adaptation without changing model weights
Instruction fine-tuningModel parameters are adapted using instruction-response examplesTeach desired task behavior/style/format
Fine-tuningModel parameters are adapted on task/domain dataNeed more persistent behavior than prompting alone
RLHFHuman preference information influences optimizationAlign behavior with desired human preferences
RAGExternal information is retrieved and supplied as contextGround responses in current/private/domain information

RAG: the practical mental model

User question
Query embedding
Vector search
Relevant chunks
Prompt + context
LLM
Answer
Q1. Why not just fine-tune a model on company documents?
Fine-tuning and RAG solve different problems. Fine-tuning changes model behavior/weights; RAG supplies external information at inference time. If documents change frequently, RAG can avoid repeatedly retraining the model just to update factual context.
Q2. Does RAG eliminate hallucinations?
No. RAG can improve grounding, but retrieval can fail, context can be irrelevant, the model can misinterpret evidence, or it can still generate unsupported claims. Evaluation and guardrails remain necessary.
Q3. What is the difference between an embedding and an LLM?
An embedding model maps input into vectors useful for similarity/retrieval or other ML tasks. An LLM is generally used to model/generate language. Some systems can expose both kinds of capabilities, but the functions are conceptually different.
Q4. What is context window?
The amount of tokenized input/context a model can process within one model invocation. A larger context window does not automatically mean better reasoning or lower cost.
Advanced Why can retrieval quality matter more than changing the LLM?
In a RAG system, if the correct evidence is never retrieved, the generator cannot reliably use it. Improving chunking, metadata, query formulation, retrieval, reranking and indexing can therefore have a major impact on end-to-end quality.
Advanced Why can a higher-temperature output be less deterministic?
Temperature changes the sharpness of the probability distribution used during sampling. Higher values generally flatten the distribution and make lower-probability alternatives more likely to be sampled; exact behavior depends on the implementation and decoding setup.

6. AWS AI/ML Services & Technologies

Current naming note: AWS renamed Amazon SageMaker to Amazon SageMaker AI in December 2024. Existing API/CLI namespaces and many technical names still use “SageMaker.”

Core platform mental model

Data
Prepare
Build / Train
Evaluate
Deploy
Monitor

Amazon SageMaker AI

Managed ML platform for building, training and deploying ML models, including support for foundation-model workflows and custom training.

Amazon Bedrock

Managed service for building generative AI applications using foundation models through APIs and managed capabilities.

SageMaker JumpStart

Helps discover, evaluate, customize and deploy models and ML solutions within SageMaker workflows.

Amazon Q

Generative-AI assistants for business/technical workflows. Amazon Q Developer focuses strongly on software development and AWS-related work.

Amazon Comprehend

NLP service for extracting insights from text, such as sentiment, entities, language and key phrases.

Amazon Translate

Neural machine translation for text.

Amazon Textract

Extracts text and structured information from documents and images.

Amazon Lex

Build conversational interfaces using voice and text.

Amazon Polly

Text-to-speech service that turns text into spoken audio.

Amazon Transcribe

Speech-to-text transcription for audio files and streams.

Amazon Rekognition

Computer-vision capabilities for image and video analysis.

Amazon Kendra

ML-powered enterprise search over unstructured content.

Amazon Personalize

Personalization and recommendation capabilities.

AWS DeepRacer

Hands-on learning platform centered on reinforcement learning through an autonomous racing environment.

Bedrock vs SageMaker AI — a question worth teaching carefully

Amazon BedrockAmazon SageMaker AI
Primary focusBuild and operate generative AI applications/agents using foundation modelsBuild, train, customize and deploy ML/AI models with greater model/infrastructure control
Typical audienceDevelopers, application teams, technical decision makersData scientists, ML engineers, AI platform teams
Need to train from scratch?Usually noCan support custom training and extensive customization
RAGManaged capabilities such as Knowledge Bases can support RAGCan be used for broader custom ML/RAG infrastructure and model workflows
ControlMore abstractionMore control over training, compute, deployment and optimization
Q1. When should a developer think “Bedrock”?
When the goal is to build a generative-AI application using managed foundation models and managed application capabilities, without taking on the full model-training infrastructure.
Q2. When should a team think “SageMaker AI”?
When the workflow needs substantial control over model development, training, customization, inference infrastructure, classical ML or broader ML operations.
Q3. Can Bedrock and SageMaker AI be used together?
Yes. They are complementary. A team may use SageMaker AI for model development/customization and Bedrock for managed generative-AI application integration, depending on the architecture and supported model/workflow.

AWS service selection challenge

“Convert a call recording into text.”
Amazon Transcribe.
“Read an invoice and extract fields.”
Amazon Textract is a natural fit for document text/data extraction.
“Turn text into speech.”
Amazon Polly.
“Translate customer feedback.”
Amazon Translate; Comprehend can then analyze the translated text.
“Analyze sentiment in thousands of reviews.”
Amazon Comprehend.
“Build a chatbot using a foundation model.”
Amazon Bedrock is a strong managed starting point.

Cost considerations

Teaching point: “Cheapest API call” is not the same as “cheapest solution.” Teach students to calculate cost per useful outcome, not just cost per request.

7. Check Your Understanding

Try these questions without looking back at the notes. Use your score to identify topics you should review.

8. Flashcards for Quick Revision

Click “Reveal”

Use these for quick revision before an exam, interview or practical session.

9. Searchable Glossary & Quick Reference

10. Recommended Self-Study Path

StepWhat you should doGoal
1Study AI, ML, DL and GenAIBuild the core mental model and learn the differences.
2Study ML fundamentalsUnderstand data, labels, training, evaluation and inference.
3Study deep learningUnderstand neural networks, CV and NLP.
4Study generative AIConnect tokens, embeddings, foundation models, prompting and RAG.
5Compare GenAI techniquesUnderstand when prompting, RAG and fine-tuning are appropriate.
6Study AWS servicesMatch real-world problems to appropriate AWS AI/ML services.
7Take the quiz and flashcardsCheck your understanding and revisit weak areas.
Study technique: Do not memorize definitions blindly. Start with a real problem, decide what kind of AI/ML approach could solve it, and then connect your answer to the terminology. This makes the concepts much easier to remember.

11. Sources & AWS Documentation

This tutorial uses current AWS terminology checked against official AWS documentation in September 2026.