🎯 What You'll Learn
- Place AI, machine learning, deep learning and generative AI inside each other correctly, and say what distinguishes each layer
- Tell supervised from unsupervised learning by looking at the data, not the algorithm
- Describe what a trained model actually is: a file on disk, with a size, a format and a supply chain
- Separate training from inference — two different programs, two different cost profiles, two different attack surfaces
- Name which technique sits behind each familiar category of security tool
- State, out loud, what this track deliberately does not teach and why that is the right call
Where this page sits
Level: Beginner. No maths beyond arithmetic. No prior AI exposure assumed.
This is rung one of Track C — AI literacy for security people. The ladder for the whole site runs:
| Rung | Track | What you leave with |
|---|---|---|
| 1 | Linux substrate | A shell, Docker, and a machine you can run things on |
| 2 | AI literacy (you are here) | The vocabulary and the arithmetic to reason about AI systems |
| 3 | AI attack & defence | Hands-on offence and defence against real model deployments |
| 4 | CompTIA SecAI+ (CY0-001) | A certification aligned to published objectives |
If you cannot yet open a terminal, cd into a directory, and run docker compose up, go do the Linux substrate track first. Everything from here assumes that much and no more.
If you already know what a confusion matrix is and can explain why a softmax output is not a probability of being right, you are past this rung. Skip to AI Literacy: Thresholds and Confidence, or straight to the attack and defence track.
The honest pitch for this page. Most "AI for security" material fails in one of two directions. It either opens with linear algebra and loses everyone by page three, or it teaches nothing but prompt tips and leaves you unable to evaluate a vendor claim. This track does neither. The only maths in it is arithmetic, and you will be asked to do that arithmetic on paper, because it is the arithmetic — not the calculus — that determines whether a detector is useful.
Four words, nested
The single most common confusion in security conversations about AI is treating four different words as synonyms. They are not synonyms. They nest, like this:
┌─ Artificial Intelligence ───────────────────────────────────┐
│ Any system that performs tasks associated with human │
│ intelligence. Includes hand-written rules and search. │
│ │
│ ┌─ Machine Learning ────────────────────────────────────┐ │
│ │ Systems whose behaviour is fitted from data rather │ │
│ │ than written by a programmer. │ │
│ │ │ │
│ │ ┌─ Deep Learning ─────────────────────────────────┐ │ │
│ │ │ ML using many-layered neural networks. │ │ │
│ │ │ │ │ │
│ │ │ ┌─ Generative AI ──────────────────────────┐ │ │ │
│ │ │ │ Deep models that produce new content: │ │ │ │
│ │ │ │ text (LLMs), images, audio, code. │ │ │ │
│ │ │ └──────────────────────────────────────────┘ │ │ │
│ │ └─────────────────────────────────────────────────┘ │ │
│ └────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘Artificial intelligence is the widest term and the least useful one. It is a marketing category as much as a technical one. A chess engine that searches game trees is AI. A rules engine that fires an alert when a login comes from two countries in an hour is, by most definitions, AI. Neither one learns anything. When a vendor says "AI-powered", they have told you nothing; the question you need answered is which of the inner boxes they are in.
Machine learning is the meaningful boundary. An ML system's behaviour comes from fitting parameters to data rather than from a programmer writing the decision rules. That is the whole distinction, and it has a direct security consequence: if the behaviour comes from the data, then whoever controls the data controls the behaviour. Every data-poisoning concern in the rest of this curriculum descends from that one sentence.
Deep learning is machine learning using neural networks with many layers. The word "deep" refers to layer count, nothing more. Deep learning earns its place because it learns its own features. A classical ML pipeline needs a human to decide that "number of capital letters in the subject line" is a feature worth measuring; a deep model learns whatever representation the training signal rewards. That is powerful and it is opaque, and the opacity is why explaining a deep model's decision is a research problem rather than a documentation task.
Generative AI is a subset of deep learning that produces new content rather than a label. A classifier answers "which bucket?"; a generative model answers "what comes next?". Large language models are generative models over text tokens. The distinction matters enormously in security, because a classifier's failure mode is a wrong bucket, while a generative model's failure mode is fluent, plausible, structurally correct output that is false. Those two failure modes need completely different controls.
Vendor-claim triage. When someone says their product uses AI, ask three questions: What is fitted from data, and which data? Is the output a label or generated content? What does the system do when it is wrong? If they cannot answer all three, you are not being sold a capability, you are being sold a word.
Supervised versus unsupervised: read the data, not the algorithm
Learning paradigms are usually taught as a list of algorithm names. That is backwards. The paradigm is determined by what your data looks like, and the algorithm follows.
Supervised learning means your training data has labels. Every example comes with the answer attached: this email is phishing, that one is not; this binary is ransomware, that one is a legitimate installer. The model's job is to learn the mapping from example to label well enough to label examples it has never seen. Supervised learning is the workhorse of security ML, and its bottleneck is never the algorithm — it is the labels. Labelling ten thousand emails correctly is expensive, tedious, and requires the people who are least available.
Unsupervised learning means your data has no labels. You have a pile of events and no ground truth. The model's job is to find structure: which events group together, which ones sit far from everything else. Clustering and anomaly detection live here. Unsupervised methods are attractive in security precisely because labels are scarce — but they come with a hard limitation that is routinely glossed over in product marketing: an unsupervised model finds unusual, and unusual is not the same as malicious. A scheduled quarterly report job that only runs four times a year is deeply unusual. It is also fine.
Two more paradigms come up often enough to name:
Self-supervised learning is how modern language models are pretrained. The labels are manufactured from the data itself — hide the next token, ask the model to predict it, compare against what was actually there. It behaves like supervised learning mathematically but needs no human labelling, which is exactly why it scaled to internet-sized corpora when hand-labelled approaches could not.
Reinforcement learning trains an agent by rewarding outcomes rather than by correcting individual predictions. In the LLM world you meet it as the alignment stage that turns a raw next-token predictor into something that follows instructions and declines certain requests. It matters to you mostly as context: the "refusals" you will later try to bypass are a learned preference, not a filter bolted on top.
| Supervised | Unsupervised | |
|---|---|---|
| Training data | Examples with labels | Examples without labels |
| Question answered | "Which class is this?" | "What structure is in here?" |
| Security examples | Phishing classification, malware family attribution, URL reputation | Beaconing detection, user-behaviour baselining, log clustering, DGA domain grouping |
| Main cost | Getting labels | Interpreting the output |
| Main failure | Learns your labellers' biases, including their mistakes | Flags unusual-but-benign forever |
| Evaluation | Straightforward — you have ground truth | Genuinely hard — you have nothing to compare against |
A model is a file
This is the single most clarifying idea for a security person, and it is almost never stated plainly. A trained model is a file on disk. It has a path, a size in bytes, an owner, a permission bitmask, a format, and a supply chain. Everything you already know about handling untrusted files applies to it.
What is inside that file is two things: an architecture (the shape of the computation — how many layers, how wide, how they connect) and the parameters, usually called weights (the numbers that were fitted during training). Load the architecture, pour the weights into it, and you have a function you can call. That is all "loading a model" means.
Pull a small model locally and look at it. This is the whole point of the exercise — make the abstraction concrete.
# CPU-ONLY. No GPU required. ~1.3 GB download.
docker compose up -d
docker compose exec ollama ollama pull llama3.2:1b
docker compose exec ollama ollama listNAME ID SIZE MODIFIED
llama3.2:1b <id> 1.3 GB 2 minutes ago# Where does it actually live? Find the blobs.
docker compose exec ollama sh -c 'ls -lh /root/.ollama/models/blobs | head'The largest blob in that directory is the weights. It is a file. You could copy it to a USB stick. You could also replace it with a different file, and unless something checks the digest, the next inference call would happily run whatever you put there. Hold onto that thought — it is the seed of the model-supply-chain material later in the curriculum.
Model artefacts come in several formats, and the format is a security property:
| Format | Typical use | Loading it executes code? |
|---|---|---|
Python pickle / .pt / .pth | Older PyTorch checkpoints, scikit-learn models via joblib | Yes — pickle deserialisation runs arbitrary code by design |
safetensors | Modern weight distribution | No — it is a plain tensor container, which is precisely why it exists |
GGUF | Quantised models for CPU inference (llama.cpp, Ollama) | No |
| ONNX | Cross-framework inference graphs | Graph operators only, not arbitrary Python |
That table is worth memorising. "Download this pre-trained model" and "download and execute this binary" are the same sentence when the artefact is a pickle. The existence of safetensors as a format is itself the industry admitting the problem.
Training and inference are two different programs
People say "running the model" for both, which hides the most important operational distinction in the field.
Training consumes data and produces a model. It is done rarely, on expensive hardware, by a small number of people, usually offline. Its inputs are the training corpus, the labels, and a pile of hyperparameters. Its output is that file on disk.
Inference consumes a model and an input and produces an output. It is done constantly, cheaply, often on commodity hardware, and it is the part exposed to the world. Its inputs are the model file and whatever the user sends.
| Training | Inference | |
|---|---|---|
| Frequency | Rare — days to months apart | Continuous — per request |
| Cost driver | Compute hours × dataset size | Requests × tokens or features |
| Who touches it | ML engineers, data pipeline | Every user, including hostile ones |
| Primary risk | Poisoned or leaked training data; unreviewed data provenance | Prompt injection, evasion, extraction, resource exhaustion |
| Blast radius of a compromise | Every future prediction, silently | This request — unless the system has agency, then more |
| Fixable by | Retraining (slow, expensive) | Config, filtering, rate limits (fast) |
Two things follow from that table, and both are worth carrying into every AI security conversation you have.
First, training-time compromises are the quiet ones. A poisoned classifier is not visibly broken. It works normally on everything except the pattern the attacker planted, and it keeps working normally for as long as that model is deployed. There is no alert for it. Detection means evaluation discipline, not monitoring.
Second, inference-time is where the users are, so it is where most of the volume of attacks lives, and it is also where you have the most levers. Rate limits, input validation, output filtering, and access control are all inference-time controls, and all of them can ship this week. Retraining cannot.
A third state sits between them and deserves a name: fine-tuning takes an existing model and continues training it on a smaller, targeted dataset. It is cheap enough that ordinary teams do it, which means it is common enough to be a real supply-chain surface. Someone fine-tuning a base model on internal documents has created a new artefact that may contain those documents' contents in its weights.
Where each technique shows up in security tooling
You have been using these systems for years under other names. Mapping the marketing term to the technique is most of what "AI literacy" buys you.
| Security tool category | Technique underneath | Paradigm |
|---|---|---|
| Spam and phishing filters | Text classification (historically Naive Bayes and gradient-boosted trees, increasingly transformer-based) | Supervised |
| Endpoint malware detection | Feature-based classifiers over static and dynamic attributes | Supervised |
| UEBA / insider-risk scoring | Baselining plus outlier scoring per entity | Unsupervised |
| Network beaconing detection | Periodicity and clustering over connection timing | Unsupervised |
| DGA domain detection | Character-level sequence models over domain strings | Supervised |
| SIEM alert triage and deduplication | Similarity grouping, sometimes embeddings | Unsupervised |
| Fraud and account-takeover scoring | Gradient-boosted trees on behavioural features | Supervised |
| Log summarisation, report drafting, query generation | Large language models | Generative |
| Assistants inside a SOC console | LLM plus retrieval over your own documents | Generative + retrieval |
Notice the shape of that list. The mature, high-volume, boring parts of security have used supervised and unsupervised ML for well over a decade, and it works. The genuinely new arrival is the bottom three rows — generative models, which changed what is possible and simultaneously introduced a failure mode (confident fabrication) that the older categories never had.
A supervised classifier in twelve lines
Nothing about this needs a GPU, a framework, or a cloud account. The point is to see the whole loop — data in, model out, prediction — small enough to hold in your head.
# docker-compose.yml — CPU-ONLY, no model download needed for this part
services:
lab:
image: python:3.12-slim
working_dir: /work
volumes:
- ./:/work
command: sh -c "pip install --quiet scikit-learn && python classify.py"# classify.py — a phishing-ish classifier over toy features.
# Features: [external_sender, has_attachment, urgency_words, link_count]
from sklearn.tree import DecisionTreeClassifier
X = [[1, 1, 3, 4], [1, 0, 4, 6], [0, 0, 0, 1], [0, 1, 0, 2],
[1, 1, 5, 9], [0, 0, 1, 0], [1, 0, 0, 1], [0, 1, 1, 3]]
y = [1, 1, 0, 0, 1, 0, 0, 0] # 1 = phishing, 0 = benign
model = DecisionTreeClassifier(max_depth=3, random_state=0).fit(X, y)
# Inference: a message we never trained on.
print(model.predict([[1, 1, 4, 7]])) # -> [1]
print(model.predict_proba([[1, 1, 4, 7]])) # -> [[0. 1.]] — "100% confident"
print(model.get_depth(), model.get_n_leaves()) # -> 1 2 — one split separated the classesRun it and read what happened. fit() was training: it consumed eight labelled examples and produced a fitted object. predict() was inference: it consumed that object plus one new input.
Then look at the last two lines. A single split separated the classes perfectly, so the tree is one level deep, and predict_proba() reports 1.0 — apparent total certainty, coming from a leaf that contains three training rows. That is not the probability the answer is correct; it is the purity of a leaf. The next two pages of this track are about exactly that distinction.
What this does not prove. Eight examples is not a dataset and a depth-3 tree is not a detector. This classifier would collapse on real mail. It exists to make training and inference concrete, nothing else. Any claim about detector performance requires the arithmetic on the next page, done over a realistic population.
What this track will not teach you, and why
This is a promise, stated up front, so you can decide now whether you are in the right place.
Not covered: eigenvectors and singular value decomposition. They underpin dimensionality reduction and some embedding methods. You will never need them to reason about an AI system's security posture, and no shipping certification objective in this space asks for them.
Not covered: the derivation of backpropagation. You will learn that training adjusts weights to reduce error, and that the adjustment is computed by propagating that error backwards through the network. You will not derive the chain rule. Knowing the derivation changes nothing about how you secure a training pipeline.
Not covered: convex optimisation. Convergence guarantees, duality, KKT conditions — this is the mathematics of why optimisers work. It is genuinely beautiful and it is genuinely irrelevant to defending a deployed model.
Not covered: the attention formula. You will learn what attention does — that a transformer lets every token's representation be influenced by every other token in the context, which is why context windows matter and why anything in the context is effectively addressable by anything else. You will not see the scaled dot-product equation, because writing it down does not help you find an injection point.
The reason for all four exclusions is the same and it is checkable: none of them appears in a shipping certification objective for AI security, and none of them changes a defensive decision you would make. Domain 1 of CY0-001 asks you to compare and contrast AI types and techniques used in cybersecurity — that is conceptual fluency, not derivation. Domain 2 (securing AI systems) carries the heaviest weight, and it is architecture, controls and monitoring.
If you actually want the maths, that is a different job — and it has a name. Adversarial machine learning research — crafting gradient-based evasion, proving robustness bounds, designing certified defences — genuinely requires the linear algebra and the optimisation theory. It is a research career, not a certification path, and the honest route into it is a maths-first curriculum plus papers, not a security course. This track will not take you there, and any course that claims a beginner path leads to adversarial-ML research is selling you something. What this track will do is let you read those papers' abstracts and correctly understand what was and was not demonstrated.
Self-check before moving on
You are ready for the next rung when you can answer these without looking back up the page.
Nesting
Is every machine learning system an AI system? Is every AI system a machine learning system? Give one example of an AI system that does no learning at all.
Paradigm
You are handed six months of VPN logs with no labels and asked to find compromised accounts. Which paradigm are you forced into, and what is the specific limitation you must warn your manager about before you start?
The artefact
A colleague sends you a model.pkl from a public repository and asks you to load it in production. State the concrete risk in one sentence, and name the format they should have used instead.
Training vs inference
An attacker poisons your training data and an attacker crafts a malicious input at inference time. Which compromise is harder to detect, and why?
Scope
Someone tells you that you cannot understand AI security without knowing linear algebra. Give the counter-argument in two sentences, and name the one kind of work where they would be right.
Where to go next
Work the four remaining rungs of Track C in order. Each one is a single idea done properly.
| Next | Why it comes next |
|---|---|
| AI Literacy: The Confusion Matrix and Base Rates | The most important arithmetic in the entire curriculum. Do not skip it — everything about evaluating a detector rests on it. |
| AI Literacy: Thresholds and Confidence | Where the classifier's score becomes a decision, and why a confident model is not a correct one. |
| AI Literacy: Embeddings and Retrieval | Vectors, cosine similarity, and how RAG actually works — the groundwork for RAG security. |
| AI Literacy: LLM Mechanics | Tokens, context windows, temperature, sampling and hallucination — what is really happening inside the loop. |
Rung complete. You can now place any AI claim inside the four nested boxes, tell supervised from unsupervised by looking at the data, treat a model as the file it is, and separate training risk from inference risk. That is the vocabulary. Next comes the arithmetic — and it is only arithmetic.