{
  "id": 1212,
  "kind": "post",
  "title": "How to Train a Neural Net: Lecture Notes (MIT 6.7960 Deep Learning, Fall 2024)",
  "summary": "Concise mathematical treatment of how a neural network learns its weights during training, from MIT's 6.7960 Deep Learning course (Fall 2024). Covers the forward pass, loss functions, gradients, backpropagation, and gradient-based optimization — aimed at moving from high-level intuition to a rigorous understanding of training math. Lecture 2 notes; a tip in the thread notes all 20+ lectures can be downloaded from the course's OCW page. Resource-sharing, not a research paper.",
  "body": "",
  "notes": "Discovery: @antoniolupetti (Antonio Lupetti, founder of Algebrica) X post 2026-10-02 3:14 PM ET (https://x.com/antoniolupetti/status/2106100475938398697), 27.5K views, 96 reposts, 718 likes, 800 bookmarks | Slides shown: forward/backward + backprop update diagram, 3D gradient-descent surface plot | No arXiv/HF/GitHub links",
  "url": "https://ocw.mit.edu/courses/6-7960-deep-learning-fall-2024/mit6_7960_f24_lec2.pdf",
  "links": [],
  "authors": [
    "MIT 6.7960 Deep Learning course staff (Fall 2024)"
  ],
  "tags": [
    "neural-networks",
    "backpropagation",
    "gradient-descent",
    "lecture-notes",
    "mit-ocw",
    "education"
  ],
  "topics": "neural networks, backpropagation, gradient descent, training, education, lecture notes",
  "venue": "MIT OpenCourseWare, 6.7960 Deep Learning (Fall 2024), Lecture 2",
  "publisher": "",
  "source": "other",
  "language": "en",
  "access": "free",
  "license": "",
  "published_year": 2024,
  "added_at": "2026-10-03T00:00:00.000Z",
  "verified_at": "2026-10-03T00:00:00.000Z",
  "attrs": {},
  "enrichment": {},
  "enriched_at": null,
  "license_class": "unknown",
  "langs": [
    "en"
  ],
  "modalities": [],
  "size_class": null,
  "provenance": {
    "channel": "random-papers",
    "legacy_paper_id": "1521"
  },
  "visibility": "public",
  "status": "active",
  "duplicate_of": null,
  "origin": "legacy",
  "created_at": "2026-10-03T18:52:18.745Z",
  "updated_at": "2026-10-03T18:52:18.745Z",
  "page": "https://papers.projxon.ai/entries/1212",
  "markdown": "https://papers.projxon.ai/entries/1212.md",
  "api": "https://papers.projxon.ai/api/entries/1212",
  "relations": [],
  "duplicates": [],
  "similar": [
    {
      "id": 738,
      "kind": "thread",
      "title": "Dust: Pretraining Transformers Without Backpropagation (QLabs)",
      "summary": "First zeroth-order method to pretrain transformers to approach and sometimes exceed backprop with large compute. Key idea: instead of weight-space ES (one forward pass per population member), Dust perturbs activations independently at every token (node perturbation), so each token acts as a virtual population member and one forward pass evaluates thousands of perturbations — a 'virtual population' scaling to large populations by perturbing activations in parallel. 1,000-10,000x more compute-efficient than EGGROLL (SOTA ES method) for training transformers. Results: beats backprop at 100k and 1M tokens, close at 10M and 20M (trend puts Dust's asymptote below backprop at 20M); integrates with Adam. Scientific finding: search in high dimensions gets better with overparameterization — at fixed population size, larger models (up to 120x) reach lower loss; backprop-like gradients emerge from a large population of activation perturbations, with Dust<->backprop gradient alignment holding up to 1B tokens, and Dust's gradients sometimes better. Still far more expensive than backprop; positioned as the 'bitter lesson' for optimization research — zeroth-order methods enabling non-differentiable architectures and better directions than first-order gradients.",
      "url": "http://qlabs.sh/research/dust",
      "authors": [
        "Samip Dahal",
        "Bishwas Mandal",
        "Serdar Gulbahar",
        "Akshay Vegesna"
      ],
      "tags": [
        "dust",
        "zeroth-order",
        "backpropagation",
        "pretraining",
        "evolution-strategies",
        "qlabs"
      ],
      "venue": "QLabs research blog paper, October 2026 (qlabs.sh/research/dust)",
      "source": "x",
      "license": "",
      "published_year": 2026,
      "added_at": "2026-09-29T00:00:00.000Z",
      "has_dataset_profile": false,
      "license_class": "unknown",
      "langs": [
        "en"
      ],
      "modalities": [],
      "size_class": null,
      "citation_count": null,
      "downloads": null,
      "stars": null,
      "page": "https://papers.projxon.ai/entries/738",
      "markdown": "https://papers.projxon.ai/entries/738.md",
      "api": "https://papers.projxon.ai/api/entries/738"
    },
    {
      "id": 1000,
      "kind": "other",
      "title": "OpenStax (open educational textbooks)",
      "summary": "OpenStax publishes free, openly licensed textbooks (including a math subject catalog at openstax.org/subjects/math). Discord math-textbooks list (mid 1451641334371717373) named OpenStax among ArXiv/OpenStax/AMS/LibreTexts/MIT OCW (ZLIB/Libgen skipped as piracy). Catalog as research-worth OER source, not a single frozen dump.",
      "url": "https://openstax.org/subjects/math",
      "authors": [
        "OpenStax / Rice University"
      ],
      "tags": [
        "openstax",
        "oer",
        "textbooks",
        "math",
        "education",
        "cc"
      ],
      "venue": "OpenStax",
      "source": "web",
      "license": "Typically Creative Commons (per-book; often CC BY) — confirm per title",
      "published_year": null,
      "added_at": "2026-09-17T14:53:22.000Z",
      "has_dataset_profile": false,
      "license_class": "other",
      "langs": [
        "en"
      ],
      "modalities": [],
      "size_class": null,
      "citation_count": null,
      "downloads": null,
      "stars": null,
      "page": "https://papers.projxon.ai/entries/1000",
      "markdown": "https://papers.projxon.ai/entries/1000.md",
      "api": "https://papers.projxon.ai/api/entries/1000"
    },
    {
      "id": 1439,
      "kind": "paper",
      "title": "Simulating Training Spikes of Deep Neural Networks by Layer-wise Random Feature Models",
      "summary": "A mechanism paper for training spikes — the sharp temporary train+validation loss surges in LLM pretraining. Diagnostic starting point: ordinary loss fluctuations are driven by data shuffling and reproduce identically across seeds, but spikes occur at DIFFERENT steps for runs differing only in initialization, so spikes are not caused by a single bad data point and outlier removal cannot fully fix them. TOY MODEL (PLRF): a Power-Law Random Feature model — fixed random Gaussian features feeding linear regression, inputs power-law scaled with exponent α. Two necessary conditions for spikes in PLRF: (1) heavy-tailed data (large α) and (2) learning rate near the divergence threshold. At α=0.3 raising the LR just diverges cleanly; at α=0.9 BOTH SGD and Adam produce genuine spikes before divergence (claimed as the first explicit link between training spikes and heavy-tailed data). MECHANISM: decompose the iterate into deterministic full-batch descent plus a random walk accumulating stochastic gradient noise. Concentration of measure makes the loss concentrate on its expectation IFF α ≤ 0.5 (equivalently Σλ_i diverges for eigenvalues λ_i ∝ i^(−2α)); for α > 0.5 a few very large eigenvalues dominate, and when the noise random-walks into alignment with a large-eigenvalue direction, the loss surges. The EXPECTED loss stays smooth — average-case scaling-law analyses remain valid but stop describing individual runs. Side result: spikes occur in convex quadratic models under stochastic optimization — the 3rd-order terms needed for Edge-of-Stability spikes under full-batch GD are NOT necessary once gradient noise exists; and the SGD divergence threshold is not 2/λ_max but solves (1/B)·Σ γλ_i/(2−γλ_i) = 1 — sharpness (λ_max) is only distantly relevant; the whole eigenvalue distribution is what matters. LAYER-WISE SIMULATOR (Algorithm 1): each layer gets a 2nd-order Taylor expansion of validation loss around a checkpoint (per-example gradient second moments factorize through the activation-correlation spectrum — Prediction 5, verified with relative error <0.1, mostly within 5%, across layer types and steps); from ONE checkpoint + one validation pass (activation-correlation eigendecomposition, mean gradient, mean squared per-batch gradient norm, Hessian trace via Hutchinson probing), synthesize Gaussian per-batch gradients and roll the real optimizer map forward — ~5 seconds on CPU for 1,500 steps for one layer, vs 8 min–1.7 hrs of measurement on TPUv4×32 and 40 hrs to train the case-study model. CASE STUDY: vanilla 1.3B decoder-only Transformer (24 blocks, d=2048, C4, ~25.5B tokens, AdamW β2=0.95, peak LR 8.2e-4, NO gradient clipping); changing only β2 0.95 → 0.999 induces spikes (two seeds). Simulating from the step-21k checkpoint, the normal configuration stays comparatively smooth while both spiky configurations show clear bumps — matching the qualitative fact of spikiness, NOT the step (spike timing is random by construction). Activation-correlation eigenvalues are power-law distributed and MORE heavy-tailed for the spiky configuration, especially in lower layers. EQUIVALENT BATCH FACTOR: despite ~524K tokens per batch, the measured equivalent batch factor 𝔅 ≈ 1 — for gradient-noise purposes Transformer LM training sits in the SMALL-BATCH stochastic regime, because per-token gradients vary wildly; token-count batch size does not buy the gradient-noise suppression sequence-count reasoning suggests. β2 RECIPE: make Adam's second-moment decorrelation time ~1/√(η_t·H) instead of ~1/(η_t·H), giving β2 ≈ 1 − √(η_t·𝔗/√𝔑) from measured Hessian trace 𝔗 and per-batch gradient norm 𝔑 — generically an INCREASING β2 schedule as LR decays; fitted schedule β2 0.982 → 0.992 gave final val loss 2.4404 vs 2.4421 for constant 0.95 and 2.4502 (visibly spiky) for constant 0.992 — real but TINY margins (0.0017 over the original; 0.0001 over the best constant), single runs, no seed variance; the sharper finding is the sensitivity — a 0.01 change in constant β2 flips training between smooth and spiky. Caveats (authors' own, unusually candid): the simulator explains spikes only PARTIALLY — measured 2nd-order terms show level \"jumps\" rather than spike-and-recovery, 1st-order terms are ~20× larger than the quadratic model predicts; cross-layer correlations and >2nd-order terms are needed and absent; the honest claim is \"quadratic models at least partially reveal the mechanism,\" weaker than the abstract's \"successfully predicts.\" \"Prediction\" is qualitative — a spike-RISK screen from a checkpoint, not a forecast of when. The layer framework rests on imposed assumptions (Gaussian latents with negligible drift; isotropic output-gradient covariance) and EXCLUDES tied embedding/LM-head weights entirely. The β2 mechanism is admittedly unexplained (\"a curious mystery\"); the recipe is offered as proof of concept. Simulator accuracy degrades badly with batch size in the PLRF check (severe overestimation at B=64) — the DNN case is argued safe only because 𝔅 happens to be ≈1 for this recipe. Single case study: one size (1.3B), one dataset, one recipe, spikiness constructed by pushing β2, no gradient clipping (atypical for production pretraining); Muon is mentioned only as neighboring spectrum work, NOT simulated. All results first-party, no independent replication, paper ~2 weeks old.",
      "url": "https://arxiv.org/abs/2610.13524",
      "authors": [
        "Ran Tian (Google DeepMind)",
        "Courtney Paquette (McGill University / Mila — Québec AI Institute",
        "CIFAR AI Chair",
        "also 20% part-time at Google DeepMind)"
      ],
      "tags": [],
      "venue": "arXiv cs.LG preprint v1, submitted 9 Oct 2026 (no venue stated, not peer-reviewed as far as the record shows)",
      "source": "arxiv",
      "license": "",
      "published_year": 2026,
      "added_at": "2026-10-22T00:00:00.000Z",
      "has_dataset_profile": false,
      "license_class": "unknown",
      "langs": [
        "en"
      ],
      "modalities": [],
      "size_class": null,
      "citation_count": null,
      "downloads": null,
      "stars": null,
      "page": "https://papers.projxon.ai/entries/1439",
      "markdown": "https://papers.projxon.ai/entries/1439.md",
      "api": "https://papers.projxon.ai/api/entries/1439"
    },
    {
      "id": 1467,
      "kind": "paper",
      "title": "ParaTTT: Parallelizing Test-Time Training Layers with Deep Memories",
      "summary": "Test-time training (TTT) layers make a recurrent model's memory a small neural network trained online by gradient descent - more expressive than the linear fast-weight memories of Gated DeltaNet and Mamba-2, whose updates are a single delta-rule step. The cost: a nonlinear memory's gradient at each token must be evaluated at weights produced by every earlier update, a sequential dependency. TTT-MLP and Titans break it with block-wise evaluation (gradients for a whole block computed at the block-entry weights), which only approximates token-by-token learning and still runs several times slower than chunkwise-parallel linear recurrences. ParaTTT (PTTT) instead parallelizes arbitrarily deep nonlinear memories by iteratively refining an estimate of the inner-loop gradient trajectory: each refinement is three chunkwise-parallel passes (a forward pass building the feature trajectory implied by the current gradient estimate, an exact gated-delta-rule pass computing the readout trajectory and its feature gradients, and a backward pass producing a new estimate), each pass itself a composition of existing parallel linear-recurrence kernels. The exact online gradient-descent recurrence is a fixed point of the iteration; geometric convergence is proven for a two-layer variant under contraction conditions. Decoding needs no iterations - it runs the exact recurrence. Convergence in practice: on trained models, top-1 agreement with the exact recurrence is ~60% with no iteration, ~90% at N=1, ~94% at N=2, saturating near 98% (the bf16 noise floor); at 4K context, N=2 matches the output error of TTT-MLP's block approximation (b~5) in 32x less time. Speed: a ParaTTT layer at N=2 costs 4.7x a Gated DeltaNet layer and the model keeps roughly one-third the throughput of the linear baselines, but trains 4.9x faster than TTT-MLP end-to-end (37.9k vs 7.8k tokens/s per 8xMI325X node at 340M); TTT-MLP's block form is 5.5x slower per layer at 4K and 8.5x at 16K. Quality (24-layer backbones, SlimPajama, same recipe/order/seed; memory = one hidden layer of width = head dimension, with hidden-layer delta rule and centered readout): at 340M/15.7B tokens, ParaTTT has the best perplexity of the recurrent models (WikiText-103 25.46 vs GDN 26.57, Mamba-2 26.99, TTT-MLP 26.12; Transformer 25.34) and by far the best LAMBADA (26.93 vs 29.66/45.87/40.35; Transformer 39.25), with recall well above the linear recurrences (SWDE 41.9 vs 32.5/25.8; FDA 20.3 vs 17.8/5.7) and the best 32K needle-in-a-haystack of any model tested (16.0, Transformer 10.5). At 1.3B/100B tokens it again leads the recurrences on perplexity (Wiki 15.21, LAMBADA 9.00 - best overall) and recall (SWDE 62.8 vs GDN 59.0, Mamba-2 56.7), though softmax attention still wins most recall and long-context metrics at this scale (SWDE 75.3, NIAH 78.1 at 4K vs 53.8). Caveats: the convergence guarantee covers only the two-layer variant under sufficient contraction conditions; models adapt to their training iteration count (best near training N; training at N=5 improves all four recall tasks but worsens LAMBADA 26.93->28.44 and collapses 32K NIAH 16.0->5.8); the LaCT comparison strips LaCT's sliding-window attention branch, which the authors note prior TTT layers rely on; code repo is a placeholder ('Code to come'). For the fast-weight thread: this is the parallelization fix that makes deep nonlinear memories trainable at linear-recurrence-like cost structure - a per-layer cost of ~4.7x Gated DeltaNet buys the best recurrent recall in the comparison, with exact (iteration-free) decoding.",
      "url": "https://arxiv.org/abs/2610.38255",
      "authors": [
        "Noel Loo (MIT CSAIL)",
        "Neehal Tumma (MIT CSAIL)",
        "T. Konstantin Rusch (Max Planck Institute for Intelligent Systems)",
        "Mathias Lechner (Liquid AI)",
        "Alexander Amini (MIT CSAIL)",
        "Daniela Rus (MIT CSAIL)"
      ],
      "tags": [],
      "venue": "arXiv preprint",
      "source": "arxiv",
      "license": "",
      "published_year": 2026,
      "added_at": "2026-11-01T00:00:00.000Z",
      "has_dataset_profile": false,
      "license_class": "unknown",
      "langs": [
        "en"
      ],
      "modalities": [],
      "size_class": null,
      "citation_count": null,
      "downloads": null,
      "stars": null,
      "page": "https://papers.projxon.ai/entries/1467",
      "markdown": "https://papers.projxon.ai/entries/1467.md",
      "api": "https://papers.projxon.ai/api/entries/1467"
    },
    {
      "id": 1260,
      "kind": "paper",
      "title": "Planning to Learn (The horizon problem: policy gradients are myopic)",
      "summary": "Shows that when policy gradients fail, the usual suspects (exploration, credit assignment, sampling noise) are not the cause. A classifier is a policy whose expected reward — expected accuracy — is the probability assigned to the correct label, so the policy gradient is exact and smooth; yet exact policy gradient loses to cross-entropy even on expected accuracy (ImageNet: 4% vs 62% for cross-entropy). The exact gradient is myopic: it values an update only by what it buys now, but each update also sets where the next one starts, so an update's value depends on how much learning remains. Viewed this way, cross-entropy is 'patient accuracy' — the total error an example would pay if its log-odds rose at unit speed forever — while exact policy gradient is the zero-horizon limit. Truncating this total at the learning that remains yields the horizon loss, a one-line change moving from cross-entropy toward exact policy gradient as training runs out. Provably escapes the trap that catches each endpoint in a simple allocation model; on MNIST and ImageNet (ResNet-50, ResNet-101, ViT-S/16), the horizon loss improves top-1 accuracy over cross-entropy at a flat learning rate, with gains growing under label noise. Implication for LLM post-training: policy gradient 'only cares about the end result' (accuracy), so cross-entropy-like losses over a longer horizon can yield better expected reward than following the policy gradient directly.",
      "url": "https://arxiv.org/abs/2610.03667",
      "authors": [
        "Ian Osband"
      ],
      "tags": [
        "policy-gradient",
        "cross-entropy",
        "myopia",
        "horizon-loss",
        "rl-post-training",
        "deepmind",
        "osband"
      ],
      "venue": "arXiv 2610.03667 [cs.LG], submitted 2 Oct 2026, preprint",
      "source": "x",
      "license": "",
      "published_year": 2026,
      "added_at": "2026-10-05T00:00:00.000Z",
      "has_dataset_profile": false,
      "license_class": "unknown",
      "langs": [
        "en"
      ],
      "modalities": [],
      "size_class": null,
      "citation_count": null,
      "downloads": null,
      "stars": null,
      "page": "https://papers.projxon.ai/entries/1260",
      "markdown": "https://papers.projxon.ai/entries/1260.md",
      "api": "https://papers.projxon.ai/api/entries/1260"
    },
    {
      "id": 811,
      "kind": "paper",
      "title": "A Theoretical Analysis of Generalization Dynamics in Neural Networks under Gradient Descent with Weight Decay",
      "summary": "Theoretical framework characterizing how data, architecture, and training dynamics jointly shape generalization throughout training. Studies neural networks trained with L2 loss by gradient descent with weight decay; proves GD converges to a neighbourhood of the global minimizers of the empirical loss, then partitions the input space into data-centered cells and decomposes population risk into three explicit terms: E_opt (optimization error on training data), E_PV (propagation-variation error: how predictions oscillate within each cell), and E_A (approximation error: how far ground truth is from the function class). The culprit behind memorization without generalization is E_PV: E_opt vanishes early while E_PV stays large. Under approximate Euler homogeneity, layerwise variation satisfies a differential inequality with explicit contraction rate lambda_l >= 1 - 2(1 + L) eta_2 lambda-bar, bounding E_PV by the initial hypothesis variation decaying exponentially in steps at a rate proportional to weight decay. Yields a closed-form grokking residency time (Steps ~ Omega(log(Initial_Var / budget) / (lambda-bar * eta_2 * sum L_l))): weight decay accelerates generalization, deeper networks contract faster, smoother initialization shortens the delay. Bounds are qualitative -- constants depend on suprema over parameter balls and loss smoothness, so they give rates and scaling laws, not exact step counts.",
      "url": "https://arxiv.org/abs/2609.07755",
      "authors": [
        "Yuqing Wang",
        "Ioannis G. Kevrekidis",
        "Mikhail Belkin"
      ],
      "tags": [
        "generalization-theory",
        "grokking",
        "weight-decay",
        "optimization",
        "memorization"
      ],
      "venue": "arXiv (cs.LG), submitted 2026-09-07",
      "source": "arxiv",
      "license": "",
      "published_year": 2026,
      "added_at": "2026-09-30T00:00:00.000Z",
      "has_dataset_profile": false,
      "license_class": "unknown",
      "langs": [
        "en"
      ],
      "modalities": [],
      "size_class": null,
      "citation_count": 1,
      "downloads": null,
      "stars": null,
      "page": "https://papers.projxon.ai/entries/811",
      "markdown": "https://papers.projxon.ai/entries/811.md",
      "api": "https://papers.projxon.ai/api/entries/811"
    }
  ]
}
