AI & Machine Learning Overview
The Hierarchy
Artificial Intelligence is the broadest category — any system that performs tasks requiring human-like reasoning. This includes everything from hand-coded rule engines to modern neural networks.
Machine Learning is the subset where systems learn patterns from data instead of being explicitly programmed. Three paradigms:
- Supervised Learning — labeled examples: "this image is a cat." Model learns to map inputs to known outputs.
- Unsupervised Learning — no labels. Model finds structure: clustering, dimensionality reduction, anomaly detection.
- Reinforcement Learning — trial and error with a reward signal. Agent takes actions in an environment and learns to maximize reward.
Deep Learning is ML using neural networks with many layers. This is what powers modern AI — image recognition, language models, speech synthesis.
Generative AI is the subset of deep learning that creates new content — text, images, audio, code. LLMs like ChatGPT and Claude are generative AI.
Why This Matters for Security
Every layer in this hierarchy introduces attack surface:
| Layer | Attack Surface |
|---|---|
| Training data | Data poisoning, backdoors |
| Model architecture | Adversarial examples |
| Training process | Supply chain compromise |
| Inference API | Prompt injection, model extraction |
| Application layer | Jailbreaking, indirect injection |
| Output | Data exfiltration, hallucination exploitation |
Understanding the ML pipeline isn't optional — it's the foundation for every attack and defense in this book.
Key Concepts
Parameters — the learned weights in a model. GPT-4 has ~1.8 trillion. Claude 3 Opus is estimated in the hundreds of billions. More parameters generally means more capability but also more compute cost.
Training — adjusting parameters by showing the model data and minimizing error. Uses backpropagation and gradient descent.
Inference — using the trained model to make predictions on new data. This is what happens when you send a message to ChatGPT.
Overfitting — the model memorized training data but can't generalize to new inputs. Relevant to training data extraction attacks.
Fine-tuning — taking a pre-trained model and training it further on a specific dataset. This is how base models become assistants.