Ch 22: AI Safety & Alignment - Introduction¶
Track: Advanced | Try code in Playground | Back to chapter overview
Read online or run locally
You can read this content here on the web. To run the code interactively, either use the Playground or clone the repo and open chapters/chapter-22-ai-safety-and-alignment/notebooks/01_risk_and_filtering.ipynb in Jupyter.
Chapter 22: AI Safety & Alignment — Notebook 01 (Risk & Content Filtering)¶
Safety starts with knowing what can go wrong. We map the risk taxonomy, then build a content filter and measure it like any classifier.
What you'll learn¶
| Topic | Section |
|---|---|
| The AI risk taxonomy | §1 |
| Input and output filtering | §2 |
| Precision/recall trade-offs in safety | §3 |
Time estimate: 2.5 hours
Key concepts¶
- Misuse vs accidents — intentional harm vs unintended failure.
- Defense in depth — filter inputs, filter outputs, monitor everything.
- Safety is a classifier — measure precision and recall; both errors hurt.
- Over-refusal — a filter that blocks too much is its own failure mode.
The risk taxonomy frames what to defend against; a content filter is a measurable classifier whose precision/recall trade-off — including over-refusal — must be chosen on purpose.
Run the full notebook in the chapter folder for code and outputs.
Generated by Berta AI