📝 Quick Notes: Advanced Topics
Purpose: This is a compact cheat sheet covering all advanced topics in this chapter. Use it for quick revision before exams.
Explainable AI (XAI) — Summary
- Goal: Make AI decisions interpretable and understandable to humans.
- LIME: Local Interpretable Model-agnostic Explanations — perturbs input, fits local linear model.
- SHAP: SHapley Additive exPlanations — uses Shapley values from game theory for feature attribution. φ_i = Σ_{S⊆N\{i}} [|S|!(|N|-|S|-1)!/|N|!] · [f(S∪{i}) - f(S)]
- Grad-CAM: Gradient-weighted Class Activation Mapping — highlights important regions in images using gradient flow to final conv layer.
- Saliency Maps: ∂y/∂x — gradient of output w.r.t. input pixels.
- Counterfactual: "What minimal change to input would flip the prediction?"
- Trade-off: More interpretable models (linear, decision trees) are often less accurate than black-box models (deep nets, ensembles).
Mnemonic — LSGCC: LIME, SHAP, Grad-CAM, Counterfactuals, Concept-based → "Lemon Sugar Goes in Coffee Cups"
AI Ethics & Fairness — Summary
- Bias Sources: Historical bias, representation bias, measurement bias, aggregation bias, evaluation bias.
- Demographic Parity: P(Ŷ=1|A=0) = P(Ŷ=1|A=1) — equal positive prediction rates across groups.
- Equalized Odds: P(Ŷ=1|Y=y,A=0) = P(Ŷ=1|Y=y,A=1) for y∈{0,1} — equal TPR and FPR across groups.
- Calibration: P(Y=1|Ŷ=p,A=a) = p — predicted probability matches true probability within each group.
- Impossibility Theorem (Chouldechova, Kleinberg): Cannot simultaneously satisfy all fairness criteria (except in trivial cases).
- Mitigation: Pre-processing (reweighting, resampling), In-processing (constrained optimization), Post-processing (threshold adjustment).
Federated Learning — Summary
- Core Idea: Train models across decentralized devices without sharing raw data. Only model updates (gradients) are communicated.
- FedAvg Algorithm: Each round: (1) Server sends global model to K clients, (2) Clients train locally for E epochs, (3) Server aggregates: w_{t+1} = Σ_k (n_k/n) · w_k
- Challenges: Non-IID data, communication overhead, stragglers, privacy attacks (model inversion, membership inference).
- Differential Privacy: Add calibrated noise to gradients: w̃ = w + N(0, σ²·S²·I), provides (ε,δ)-DP guarantee.
- Horizontal FL: Same features, different samples (e.g., hospitals with same tests, different patients).
- Vertical FL: Same samples, different features (e.g., bank + e-commerce for same customers).
Neuromorphic Computing — Summary
- Spiking Neural Networks (SNNs): Communicate via discrete spikes rather than continuous values. Biologically plausible.
- LIF Neuron: τ · dV/dt = -(V - V_rest) + R·I(t); fires when V ≥ V_threshold, then resets.
- STDP: Spike-Timing-Dependent Plasticity — Hebbian learning rule: Δw ∝ exp(-|Δt|/τ), sign depends on pre/post spike order.
- Hardware: Intel Loihi (128 cores, 131K neurons), IBM TrueNorth (4096 cores, 1M neurons, 256M synapses).
- Advantage: 100-1000× more energy efficient than GPUs for certain tasks (event-driven, sparse activation).
- Coding Schemes: Rate coding (spike frequency) vs Temporal coding (spike timing).
Quantum Machine Learning — Summary
- Qubit: |ψ⟩ = α|0⟩ + β|1⟩ where |α|² + |β|² = 1 (superposition).
- Entanglement: |Φ⁺⟩ = (|00⟩ + |11⟩)/√2 — measuring one qubit instantly determines the other.
- Key Gates: Hadamard H, Pauli-X/Y/Z, CNOT, Toffoli, Rotation R_x/R_y/R_z.
- VQE: Variational Quantum Eigensolver — hybrid classical-quantum algorithm for optimization.
- Quantum Kernel: K(x,y) = |⟨φ(x)|φ(y)⟩|² — compute kernel in exponentially large Hilbert space.
- NISQ Era: Noisy Intermediate-Scale Quantum (50-1000 qubits, not error-corrected). Practical quantum advantage for ML not yet demonstrated.
- Potential Speedups: Grover's (quadratic), HHL for linear systems (exponential, with caveats).
AI Safety & Alignment — Summary
- Value Alignment: Ensuring AI systems pursue goals aligned with human values and intentions.
- Reward Hacking: Agent exploits flaws in reward specification to get high reward without achieving intended goal.
- Specification Gaming: Finding unexpected solutions that satisfy the stated objective but not the intended one.
- RLHF Pipeline: SFT → Reward Model → PPO optimization (with KL penalty to prevent divergence).
- DPO: Direct Preference Optimization — eliminates separate reward model: L_DPO = -E[log σ(β · log(π_θ(y_w)/π_ref(y_w)) - β · log(π_θ(y_l)/π_ref(y_l)))]
- Constitutional AI: Model self-critiques and revises based on written principles, then RLAIF.
- Scalable Oversight: How do humans supervise AI systems on tasks humans can't easily evaluate?
Multimodal AI — Summary
- CLIP: Contrastive Language-Image Pre-training — learns joint text-image embeddings via contrastive loss on 400M image-text pairs.
- Fusion Types: Early (raw features), Mid/Cross-attention (intermediate), Late (decision-level).
- Contrastive Loss: L = -log[exp(sim(z_i, z_j)/τ) / Σ_k exp(sim(z_i, z_k)/τ)] — bring matching pairs closer, push non-matching apart.
- Text-to-Image: DALL-E (autoregressive), Stable Diffusion (latent diffusion + CLIP text conditioning).
- VQA: Visual Question Answering — input: image + question text, output: answer.
- Vision-Language Models: LLaVA, GPT-4V, Gemini — process interleaved image and text tokens.
Autonomous Systems — Summary
- SAE Levels: L0 (no automation) → L1 (driver assist) → L2 (partial) → L3 (conditional) → L4 (high) → L5 (full autonomy).
- Perception Pipeline: Cameras (semantic info), LiDAR (3D point clouds), Radar (velocity, weather-robust). Fused via Kalman filter or deep learning.
- SLAM: Simultaneous Localization And Mapping — build map and localize simultaneously. EKF-SLAM or graph-based SLAM.
- Planning Hierarchy: Route planning (global, A*/Dijkstra) → Behavioral (lane change decisions) → Motion (trajectory optimization) → Control (PID/MPC).
- Sim-to-Real: Domain randomization + domain adaptation to transfer policies from simulator to real world.
- Edge AI: Deploy models on device (TensorRT, ONNX, TFLite) for low-latency inference.
Recent Breakthroughs — Summary
- Scaling Laws: Loss ∝ N^(-α) — performance improves as power law with model size, data, compute.
- Chinchilla Optimal: Train N-parameter model on ~20N tokens.
- RLHF: SFT → Reward Model → PPO. Used in ChatGPT, Claude, Gemini.
- Chain-of-Thought: "Let's think step by step" → improves reasoning. Self-consistency = majority vote over multiple CoT paths.
- AlphaFold 2: Evoformer + Structure Module → protein structure prediction at atomic accuracy.
- Diffusion Models: Forward: add noise. Reverse: denoise. Beat GANs in quality and diversity.
- LoRA: W' = W + BA where B∈R^{d×r}, A∈R^{r×d}, r ≪ d — efficient fine-tuning.
- MoE: Mixture of Experts — sparse activation, only top-k experts per token.
Master Comparison Table
| Topic | Core Technique | Key Formula / Concept | GATE Relevance |
|---|---|---|---|
| XAI | SHAP | Shapley values for feature attribution | Medium |
| Ethics | Fairness metrics | Demographic parity, equalized odds | Medium |
| Federated Learning | FedAvg | w = Σ(n_k/n)·w_k | Low-Medium |
| Neuromorphic | SNNs | LIF neuron, STDP | Low |
| Quantum ML | VQC | |ψ⟩ = α|0⟩ + β|1⟩ | Low |
| AI Safety | RLHF | max E[R] - β·KL divergence | Medium |
| Multimodal | CLIP / Fusion | Contrastive loss, cross-attention | Medium |
| Autonomous | Sensor fusion | SLAM, planning hierarchy | Low-Medium |
| Breakthroughs | Scaling + RLHF | Loss ∝ N^(-α), CoT prompting | Medium |