skip to content
Victor Guerra

NotesRSS feed

Self-contained concept references I keep while studying machine learning, deep learning, and systems. Each note stands on its own.

PyTorch — Tensors & Mechanics

NumPy & Python

  • NumPy Basics — one-hot, argmax, rounding, type conversion, random matrices, `default_rng`, transpose, broadcasting, reshape, reductions, norms, ReLU, stable sigmoid
  • Python Basics — `match`, walrus, reshape/transpose tricks, string ops, dict max, char↔int, `assert` best practices

Training Dynamics & Optimization

  • Optimization — Hessian eigenvalues, saddle points, condition number, adaptive optimizers, Newton's method, convergence, 2nd-order at LLM scale
  • Learning Rate: Effect on Convergence & How to Tune It — LR effect on convergence/stability, tuning (log-scale, loss-curve, LR range test); SGD vs SGD+momentum vs Adam update rules + when-preferred; batch-size-1 SGD; warmup + decay schedules

Generalization & Model Fitting

Transformers & Sequence Models

  • Self-Attention — scaled dot-product attention, QKV, softmax gotchas
  • Attention-Free / Sub-Quadratic Architectures — sub-quadratic landscape (linear attention, SSM/Mamba, Hyena, AFT), train/infer duality; linear attention deep-dive (kernel factorization, `(QKᵀ)V→Q(KᵀV)`, `d×d` recurrent state, feature maps, decay→RetNet/RWKV)
  • Positional Encoding — sinusoidal PE, even/odd indices, frequency intuition, RoPE vs learned vs sinusoidal
  • Transformer Architecture — FFN role, attention vs FFN, memory view of FFN
  • Normalization — LayerNorm formula, variance, LayerNorm vs BatchNorm
  • Tokenization — how BPE/WordPiece handles rare words, numbers, code
  • Perplexity — definition, stable log-prob implementation, why not to multiply probs
  • Scaling Laws & Chinchilla — Chinchilla (C≈6ND, 20 tokens/param), Kaplan-era under-training, fitted loss model, inference-cost correction (overtraining), optimal-operating-point via local-quadratic fit

Math Foundations

  • Linear Algebra Basics — singular matrices (equivalent characterizations, why they break OLS), near-singular / condition number, detecting rank-deficiency
  • Taylor Series — definition, common expansions, computation, relevance to ML

Reinforcement Learning

  • RLHF — Reinforcement Learning from Human Feedback — RLHF pipeline (pretraining → SFT → reward model + PPO), SFT model & its 3 roles, reward model from pairwise preferences (Bradley-Terry, architecture, margin, shift-invariance), PPO + KL penalty, reward hacking, DPO/RLAIF
  • RL Fundamentals — on-policy vs off-policy (behavior/target policies, Q-learning vs SARSA, deadly triad, importance sampling, PPO clipped ratio, RLHF connection); GAE & the bias/variance tradeoff (advantage/baseline, TD residual, λ dial, γ vs λ)

Misc ML Concepts