AI TEACHING COURSE · LESSON 02

From learning
algorithms to
learning systems.

The classical grammar of machine learning still matters. But modern AI engineering expands the unit of analysis: data, representation, objective, model, evaluation, serving, and feedback.

~ 45 min10 partstextbook ↔ 2026 practice

THE THROUGH-LINE

The model is only one part of learning.

Classical textbook

Fit parameters to a fixed dataset, then estimate performance on held-out examples.

data → model → score

2026 engineering

Compose data, pretrained weights, adapters, retrieval, evaluators, serving, and feedback.

system → evidence → update
Learning objective. Explain why a reliable AI system requires more than a low training loss.

ONE COMPARISON TO KEEP

A model learns.
A system keeps learning.

TEXTBOOKFixed dataset

One target · one loss · one test set

FRONTIER PRACTICELiving system

Data · model · evals · traces · updates

01

PART ONE

What does it mean
to learn?

The word “learning” is larger than changing weights.

LEARNING LOCATIONS

Improvement can happen in four places.

01Base modelPretraining changes the general representation.
02Adapter or post-trainingTask-specific behavior is added with a smaller update.
03Context and toolsRetrieval and tool results change what the model can answer now.
04Feedback loopFailures become tests, data, and release decisions.

A MORE USEFUL EQUATION

Reliable behavior =
model × context × feedback

MModelWhat the learned weights can do
CContextWhat the system makes available
FFeedbackWhat the system can notice and improve
02

PART TWO

The learning problem
is a design problem.

Before model selection comes task specification.

TASK SPECIFICATION

Turn a vague goal into a testable contract.

OBSERVEWhat may the system see?
PRODUCEWhat must it return?
PROTECTWhat must it never do?
ESCALATEWhen should a human decide?
Textbook: “Predict the label.” Engineering: “Support this decision under these evidence, risk, and response constraints.”
03

PART THREE

Representation is
the first bottleneck.

The optimizer cannot recover information the representation discards.

LEARNED REPRESENTATION

A representation makes some relationships easy.

similar casesdifferent taskedge cases

Explore: TensorFlow Embedding Projector

SAME TASK · DIFFERENT REPRESENTATION

A feature matrix and an embedding
do not ask the same question.

CLASSICAL

Columns

age · income · count · category

FRONTIER

Latent space

learned proximity · context · modality

CONCRETE MODEL TOOLKIT

Let’s make “representation”
mechanical.

AE

Autoencoder

Compress → reconstruct

learn a useful bottleneck
VAE

Variational AE

Distribute → sample → reconstruct

learn a smooth latent space
NN

Nonlinear network

Transform → compose → predict

learn flexible functions
Why here? These models expose the connection between architecture, representation, activation, objective, and regularization.

AE · DETERMINISTIC LATENT CODE

The bottleneck is the representation.

xinput
encoderfθ(x)
zlatent code
decodergφ(z)
reconstruction
LAE =distance(x, x̂)MSE for continuous values · BCE for binary inputs

VAE · PROBABILISTIC LATENT SPACE

A VAE learns where to sample.

xinput
μ, σencoder predicts a distribution
z = μ + σ ⊙ εreparameterized sample
decoder output
LVAE =reconstruction loss + β · KL(q(z|x) || p(z))smooth latent structure ↔ reconstruction detail

DO NOT MIX THESE ROLES

ReLU and tanh transform signals.
Loss functions score outcomes.

COMPONENTJOBEXAMPLES
Activationnonlinear transform inside the networkReLU · tanh · sigmoid · GELU
Losscompare output with target or preferenceMSE · cross-entropy · KL
Regularizeradd a preference or constraintweight decay · sparsity · VAE KL
ReLUmax(0, x)
tanhbounded in [-1, 1]
04

PART FOUR

Inductive bias:
what does the system assume?

Generalization is impossible without structure.

THE BIAS STACK

Modern systems distribute assumptions across layers.

policy & escalation
retrieval & tools
instruction & preference
pretraining data
architecture
Question: Does the system’s full set of assumptions match the world where it will operate?
05

PART FIVE

Loss functions
encode priorities.

The system optimizes the signals it can see.

MULTI-OBJECTIVE SYSTEM

What counts as “better”?

QUALITYrelevance · correctness
SAFETYrefusal · privacy
COSTtokens · compute
LATENCYtime · throughput
Modern adaptation: LoRA / QLoRA updates a small trainable adapter while keeping a large base model mostly frozen.

Reference: Hugging Face · LoRA

06

PART SIX

Optimization is
not understanding.

A system can optimize perfectly toward the wrong target.

TRAINING DIAGNOSTICS

Two curves can tell two stories.

overfit beginsstepslosstrainingvalidation
training improves validation worsens

Visual idea adapted from Google ML Crash Course.

AT SCALE

Optimization becomes
a systems problem.

datamixture · dedup · provenance
computeprecision · parallelism · memory
checkpointresume · compare · reproduce
servebatch · cache · route
Textbook: tune the learning rate. Frontier: tune the entire training-and-serving path.
07

PART SEVEN

Generalization
under new conditions.

Unseen data is not one kind of novelty.

GENERALIZATION IS A PROFILE

Four distributions, not one score.

TRAINknownexamples used to fit
TESTheld outsame-world novelty
DEPLOYchangingreal users + new conditions
STRESSadversarialrare + strategic cases
Engineering move: split by time, source, user, geography, task family, and failure condition—not only at random.
08

PART EIGHT

Spurious correlations
and data failure.

The model can be right for the wrong reason.

SHORTCUT LEARNING

A high score can hide a low-quality reason.

background
?background
Leakagetest information enters training
Artifactsource marker predicts label
Shortcuteasy cue replaces task signal
09

PART NINE

Evaluation is
measurement design.

A benchmark makes some failures visible—and leaves others invisible.

EVALUATION SUITE

Measure the output and the system around it.

DIMENSIONQUESTIONEXAMPLE
QualityDid it solve the task?relevance · correctness
GroundingCan we support the claim?evidence · citation
SafetyDid it avoid a harmful action?privacy · refusal
OperationsCan we run it?latency · cost · uptime

TRACE-LEVEL EVALUATION

Where did the system go wrong?

requestreceived
retrieval3 docs
tool callslow
answerungrounded
Modern move: record intermediate spans, then score the trace—not just the final string.

Reference: Evaluating production traces.

10

PART TEN

From model
to learning system.

Deploying is the beginning of the feedback loop.

THE PRODUCTION LOOP

A deployed system keeps producing evidence.

define
build
release
trace
evaluate
update
Textbook endpoint: deploy the artifact. Frontier endpoint: maintain the evidence loop.

CLASSROOM EXERCISE

One task.
Two learning systems.

A

Classical classifier

Train on labeled question–answer pairs.

  • feature representation
  • fixed labels
  • held-out test
B

Retrieval-based assistant

Use a pretrained model over a changing policy manual.

  • document provenance
  • retrieval evaluation
  • trace + human review

A PORTABLE CHECKLIST

Interrogate any ML system with five questions.

01What does it see?representation + context
02What does it assume?inductive bias
03What does it optimize?loss + priorities
04What can we measure?evals + traces
05What changes next?feedback + governance

CHECK YOUR UNDERSTANDING

Why can a lower loss fail to improve the product?

A
Because optimization never changes the model.

Not quite. Optimization can change the model while still missing the product objective.

B
Because the objective, data, or evaluation may not represent the real task.

✓ Correct. A system can improve its measured signal while becoming less useful in context.

C
Because test sets are never useful.

Test sets remain useful; they simply answer a limited question.

LESSON 02 · FINAL TAKEAWAY

The classical grammar
still holds.

But modern AI engineering expands the unit of analysis from a fitted model to a versioned, evaluated, observable, and governable learning system.

A reliable system is not just trained.
It is measured, operated, and updated.