# AI with Leo > An interactive textbook on deep learning and large language models by Prof. Léonard Boussioux, with hands-on playgrounds at every step. AI with Leo covers the full LLM stack — from tokenization and attention to training, alignment, multimodality, agents, evaluation, and societal impact — plus companion tracks on deep learning fundamentals and classical data analytics. ## Pages - [Home](/): Overview of the textbook, all chapters, and progress tracking. - [Glossary](/glossary): Searchable index of every key term across all chapters. ## Chapters - [Overview: What Is a Language Model?](/chapters/llm-overview): Language models, autoregressive generation, GPT, and a roadmap of what you'll learn - [The Rise of LLMs: A Historical Landscape](/chapters/historical-landscape): From GPT-1 to GPT-5, the ChatGPT moment, major players, and key milestones - [Text to Tokens](/chapters/tokenization): How text becomes numbers: BPE, WordPiece, and subword tokenization - [Embeddings & Positional Encoding](/chapters/embeddings): Representing meaning in high-dimensional space - [The Transformer Architecture](/chapters/transformer): The building blocks: LayerNorm, FFN, residual connections - [The Attention Mechanism](/chapters/attention): Queries, keys, values, and scaled dot-product attention - [The Autoregressive Process](/chapters/autoregressive): Generating text one token at a time - [Decoding Strategies](/chapters/decoding): Greedy, top-k, top-p, temperature, and beam search - [Training: Pre-training & Fine-tuning](/chapters/training): From next-token prediction to RLHF - [Advanced LLM Training Techniques](/chapters/training-advanced): Quantization, distillation, QLoRA, synthetic data loops, and reasoning-focused RL - [Reasoning Models](/chapters/reasoning): Chain-of-thought, process reward models, and test-time compute - [Mixture of Experts](/chapters/moe): Conditional computation: big models at small-model cost - [Prompt Engineering Fundamentals](/chapters/prompt-engineering): Zero-shot, few-shot, chain-of-thought, system prompts, and core prompting best practices - [Advanced Prompting & Production Patterns](/chapters/advanced-prompting): Self-consistency, ReAct, structured outputs, prompt security, workflows vs agents, and production patterns - [Retrieval-Augmented Generation](/chapters/rag): Grounding LLMs in external knowledge with vector search and retrieval - [Embedding Spaces, UMAP & Clustering](/chapters/embedding-spaces): Visualizing and clustering high-dimensional representations with UMAP and HDBSCAN - [Agentic AI](/chapters/agentic): Tool use, memory, orchestration, sub-agents, and MCP - [Multimodal Models](/chapters/multimodality): Vision, audio, video — unifying modalities in a single transformer - [Image Models](/chapters/image-models): Diffusion, flow matching, world models, and modern image generation - [LLM Evaluation](/chapters/evaluations): Benchmarks, metrics, LLM-as-judge, arena evaluation, and contamination - [Alignment, Safety & Attacks](/chapters/alignment): RLHF, DPO, jailbreaking, prompt injection, and the open problems of AI safety - [Hallucinations & the Limits of Understanding](/chapters/hallucinations): Why LLMs fabricate, contextual understanding gaps, detection, and mitigation - [Search, Discovery & Agentic Optimization](/chapters/seo-agentic): Generative engine optimization, AI-mediated search, and content strategy for the AI era - [Human-AI Collaboration & Cognitive Augmentation](/chapters/human-ai-collaboration): Cognitive offloading, delegation, the centaur model, and designing for human agency - [AI & Environmental Sustainability](/chapters/sustainability): Energy, water, carbon footprint — the environmental cost of training and running LLMs - [The Politics & Economics of AI](/chapters/politics-economics): Power concentration, open vs closed source, regulation, the OpenAI saga, and the AI arms race - [Ethics, Bias, Fairness & Law](/chapters/ethics): Bias sources and mitigation, fairness frameworks, copyright, sustainability, and responsible deployment - [A Brief History of AI](/chapters/deep-learning-history): Interactive timeline of landmark AI moments, from Dartmouth to Claude Code and ClawdBot. - [The Perceptron](/chapters/deep-learning-perceptron): Interactive perceptron controls with weights, bias, and decision boundary intuition. - [Activation Functions](/chapters/deep-learning-activation-functions): Visual comparisons of sigmoid, tanh, ReLU-family, and derivative behavior. - [Multilayer Perceptron](/chapters/deep-learning-mlp): XOR-focused MLP playground with training and live network state. - [Loss Functions](/chapters/deep-learning-loss-functions): Hands-on MSE and cross-entropy visualizations with editable predictions. - [The Loss Landscape](/chapters/deep-learning-loss-landscape): Interactive convex/non-convex landscape simulation with trajectory playback. - [Gradient Descent](/chapters/deep-learning-gradient-descent): Faithful GD, momentum, and Adam trajectories on analytic surfaces with exact gradients. - [Backpropagation](/chapters/deep-learning-backpropagation): Single-neuron forward/backward pass walkthrough with interactive derivatives. - [Convolutional Neural Networks](/chapters/deep-learning-cnn): Interactive convolution chapter covering kernels, stride, and feature maps. - [Recurrent Neural Networks](/chapters/deep-learning-rnn): Hands-on RNN state updates with memory-retention intuition and gating context. - [Deep Learning & Beyond](/chapters/deep-learning-beyond): Dropout and overfitting intuition with modern deep learning context. - [Neural Network Builder Lab](/chapters/deep-learning-lab): Left-panel builder with live code generation, architecture breakdown, and training simulation. - [Linear Regression](/chapters/data-analytics-linear-regression): Interactive linear modeling chapter with regularization and coefficient paths. - [Logistic Regression](/chapters/data-analytics-logistic-regression): Interactive binary classification with cross-entropy, probabilities, and thresholds. - [Classification Metrics and Imbalance](/chapters/data-analytics-classification): Interactive classification diagnostics with confusion matrix, ROC/PR curves, and imbalance tradeoffs. - [CART: Decision Trees](/chapters/data-analytics-cart): Interactive CART visualization with depth controls and split interpretation. - [Random Forest](/chapters/data-analytics-random-forest): Bootstrap sampling, ensemble voting, and overfitting resistance in practice. - [XGBoost](/chapters/data-analytics-xgboost): Residual-driven boosting dynamics and confidence evolution over steps. - [LightGBM](/chapters/data-analytics-lightgbm): LightGBM internals with histogram bins, leaf-wise growth, and speed tradeoffs. - [Model Comparison](/chapters/data-analytics-compare): Switch between classification and regression mode to compare model families. - [Clustering](/chapters/data-analytics-clustering): Interactive clustering playground to contrast centroid and density-based methods. - [Time Series Forecasting](/chapters/data-analytics-time-series-forecasting): Interactive forecast simulator with trend, seasonality, and holdout-error comparisons.