12 episodes
Special Topics: Choosing Architectures and Designing Experiments
How to choose an architecture and how to prove you chose well. The Architecture Is a Prior: Inductive Bias and Symmetry-Physics-Inspired II: Dynamical Systems, Neural ODEs, and Signal Propagation treat architectures as priors and dynamical systems: symmetry and sample efficiency, convolutions, a measured decision table (throughput, decode memory, training depth, recall), hybrids of attention and recurrence, Hopfield networks as the physics of attention, and signal propagation and stability. Physics-Inspired III: Diffusion for Language-Designing an Experiment III: From Idea to Result on 16 GB cover diffusion language models, graph networks, subspace geometry, and three episodes on designing, running and reporting experiments on a single 16 GB GPU.
Objectives
Language
- Explain which properties of language (locality, order, long-range exact reference, streaming) each architecture family is biased toward
- Choose among CNN, LSTM, Transformer, SSM, linear attention, hybrids and MoE for a workload, and justify the choice with measured columns
- Explain why hybrids of recurrence and attention recover exact recall that pure fixed-state models lose
- Read Jamba, Griffin, RWKV, xLSTM, Samba, Hyena and Conformer as answers to specific problems and separate their claims from their evidence
Math & data structures
- Invariance and equivariance as commutation tests; weight sharing; pooling
- Convolution as a sliding dot product; receptive fields; dilations; the convolution theorem and circular vs linear convolution
- Outer-product associative memories, crosstalk variance (n-1)/d, the information floor n log2|V|
- Energy functions, Lyapunov arguments, Hebbian storage, capacity ~0.138 N, Boltzmann distributions, log-sum-exp and softmax as modern Hopfield retrieval
- ODEs and forward Euler; amplification factors and eigenvalue stability; bilinear and zero-order-hold discretisation; HiPPO-LegS
- Mean-field length and correlation maps, chi_1, depth scales, edge of chaos
Code
- NumPy conv1d (loop, unfold+einsum, causal, dilated), its backward pass, FFT long convolutions; TextCNN with gradchecked backward
- A synthetic task suite (MQAR, copying, selective copying, induction, parity) with oracles and memory floors
- Mechanism-level recall probes, decode-memory and throughput measurements, and a requirements-driven decision function
- RG-LRU in NumPy (loop and scan) and PyTorch; a hybrid LM trained on MQAR across attention ratios (gpu tier)
- Classical and modern Hopfield networks, an exactly trained Boltzmann machine; residual nets as ODE solvers; HiPPO discretisation; signal-propagation experiments
Episodes
- The Architecture Is a Prior: Inductive Bias and Symmetry18 min · 26 cues
Inductive bias; invariance vs equivariance; locality, weight sharing, permutation symmetry; the geometric deep learning blueprint (Bronstein et al. 2021); no-free-lunch intuition; data size vs bias trade-off.
- Convolutions for Language and Speech16 min · 27 cues
Convolution derived from sliding dot products; receptive fields; dilations (WaveNet/ByteNet); TextCNN (Kim 2014); ConvS2S; Conformer for speech; long convolutions (Hyena) as an attention alternative; when CNNs win (local patterns, speech front-ends, edge devices).
- Choosing an Architecture: A Decision Framework17 min · 27 cues
Decision axes: sequence length, streaming/latency, memory at inference (KV vs fixed state), exact-recall needs, data size, compute budget, hardware, parallelism in training; CNN vs LSTM vs Transformer vs SSM/linear attention vs hybrid vs MoE; worked case studies (on-device keyword spotting, 1M-token retrieval, low-resource tagging, streaming ASR).
- Hybrids and the RNN Revival: Jamba, Griffin, RWKV, xLSTM17 min · 27 cues
Jamba (AI21, 2024: Mamba + attention + MoE interleaving), Griffin/Hawk (gated linear recurrences + local attention), RWKV, xLSTM; why hybrids keep winning; how to choose the attention:recurrence ratio.
- Physics-Inspired I: Energy, Hopfield Networks, and Attention17 min · 26 cues
Energy functions; Hopfield networks (1982) as associative memory; Boltzmann machines; modern Hopfield networks and their equivalence to attention (Ramsauer et al. 2020); the 2024 Nobel Prize in Physics context (Hopfield, Hinton); storage capacity.
ResNets as Euler steps; neural ODEs; continuous-time SSMs (HiPPO, S4) and discretization; stability and eigenvalues; mean-field signal propagation for initialization (edge of chaos); why these views help design.
- Physics-Inspired III: Diffusion for Language20 min · 29 cues
Diffusion as reversing noise (score matching intuition, heat equation analogy); discrete/masked diffusion LMs (D3PM, SEDD, MDLM, LLaDA); diffusion vs autoregression trade-offs (parallel decoding, controllability).
- Graphs: Message Passing and Graph Neural Networks18 min · 28 cues
Graphs as adjacency (matrix and list); message passing; GCN, GAT; transformers as GNNs on complete graphs; graph transformers; GNNs over parse trees, knowledge graphs, and documents; oversmoothing.
- Subspaces and the Geometry of Representations18 min · 29 cues
Linear subspaces, projections, orthogonal complements; low-rank structure (intrinsic dimension, LoRA); linear representation hypothesis; steering vectors and concept erasure (projection out of a subspace); attention heads as subspaces; hyperbolic embeddings for hierarchies (Poincaré).
- Designing an Experiment I: Hypotheses, Baselines, and Controls17 min · 29 cues
Falsifiable hypotheses; the right baseline; controls and confounds; compute-matched and parameter-matched comparisons; choosing metrics and eval sets; pre-registration mindset; ablation design (one change at a time, factorial designs).
Seed variance; confidence intervals; bootstrap and paired tests; multiple comparisons; learning-rate sensitivity; comparing via scaling curves rather than single points; small-scale proxies and hyperparameter transfer (μP intuition); reporting standards.
- Designing an Experiment III: From Idea to Result on 16 GB15 min · 29 cues
Research workflow: literature map, minimal reproducible setup, sweeps, logging, failure diaries, debugging training (loss spikes, divergence), writing up; how frontier labs de-risk ideas small before scaling.
Exercises
Labs
- The Architecture Is a Prior: Inductive Bias and Symmetry browser X.01 · 90 min
- Convolutions for Language and Speech browser X.02 · 100 min
- Choosing an Architecture: A Decision Framework browser X.03 · 90 min
- Hybrids and the RNN Revival: Jamba, Griffin, RWKV, xLSTM browser X.04 · 80 min
- Physics-Inspired I: Energy, Hopfield Networks, and Attention browser X.05 · 90 min
- Physics-Inspired II: Dynamical Systems, Neural ODEs, and Signal Propagation browser X.06 · 90 min
- Physics-Inspired III: Diffusion for Language browser X.07 · 75 min
- Graphs: Message Passing and Graph Neural Networks browser X.08 · 70 min
- Subspaces and the Geometry of Representations browser X.09 · 70 min
- Designing an Experiment I: Hypotheses, Baselines, and Controls browser X.10 · 90 min
- Designing an Experiment II: Variance, Significance, and Scaling Curves browser X.11 · 90 min
- Designing an Experiment III: From Idea to Result on 16 GB browser X.12 · 120 min
Library contributions
Files in nlpcore this module teaches you to write.
nlpcore/layers/conv/text_cnn.pynlpcore/layers/conv/dilated.pynlpcore/layers/hopfield.pynlpcore/experiment/benchmarks.pynlpcore/layers/graph/gcn.pynlpcore/layers/graph/gat.pynlpcore/models/diffusion_lm.pynlpcore/geometry/subspaces.pynlpcore/experiment/harness.pynlpcore/experiment/stats.py
Sources
- Ackley, Hinton & Sejnowski (1985). A learning algorithm for Boltzmann machines. Cognitive Science 9:147-169.
- Aghajanyan, Zettlemoyer & Gupta, Intrinsic Dimensionality Explains the Effectiveness of Language Model Fine-Tuning, ACL 2021 · arXiv:2012.13255
- Amit, Gutfreund & Sompolinsky (1985). Storing Infinite Numbers of Patterns in a Spin-Glass Model of Neural Networks. Phys. Rev. Lett. 55(14):1530-1533.
- Arora, Eyuboglu et al., Zoology: Measuring and Improving Recall in Efficient Language Models, 2023 · arXiv:2312.04927
- Austin, Johnson, Ho, Tarlow & van den Berg, Structured Denoising Diffusion Models in Discrete State-Spaces, NeurIPS 2021 · arXiv:2107.03006
- Beck, Pöppel, Spanring, Auer, Prudnikova, Kopp, Klambauer, Brandstetter & Hochreiter, xLSTM: Extended Long Short-Term Memory, 2024 · arXiv:2405.04517
- Belrose, Schneider-Joseph, Ravfogel, Cotterell, Raff & Biderman, LEACE: Perfect linear concept erasure in closed form, NeurIPS 2023 · arXiv:2306.03819
- Berg-Kirkpatrick, Burkett & Klein, An Empirical Investigation of Statistical Significance in NLP, EMNLP 2012unverified
- Bouthillier et al., Accounting for Variance in Machine Learning Benchmarks, MLSys 2021 · arXiv:2103.03098
- Bronstein, Bruna, Cohen & Veličković, Geometric Deep Learning: Grids, Groups, Graphs, Geodesics, and Gauges (2021) · arXiv:2104.13478
- Chen, Rubanova, Bettencourt & Duvenaud, Neural Ordinary Differential Equations, NeurIPS 2018 · arXiv:1806.07366
- Chowdhery et al., PaLM: Scaling Language Modeling with Pathways, 2022 · arXiv:2204.02311
- De et al., Griffin: Mixing Gated Linear Recurrences with Local Attention for Efficient Language Models, 2024 · arXiv:2402.19427
- Dodge et al., Fine-Tuning Pretrained Language Models: Weight Initializations, Data Orders, and Early Stopping, 2020 · arXiv:2002.06305
- Dror, Baumer, Shlomov & Reichart, The Hitchhiker's Guide to Testing Statistical Significance in Natural Language Processing, ACL 2018 · link
- Dwivedi & Bresson, A Generalization of Transformer Networks to Graphs, 2020 · arXiv:2012.09699
- Weinan E, A Proposal on Machine Learning via Dynamical Systems. Communications in Mathematics and Statistics 5(1):1-11 (2017)
- Efron, Bootstrap Methods: Another Look at the Jackknife, Annals of Statistics 7(1), 1979 · link
- Elhage et al., A Mathematical Framework for Transformer Circuits, Transformer Circuits Thread 2021 · link
- Gehring, Auli, Grangier, Yarats & Dauphin, Convolutional Sequence to Sequence Learning, 2017 · arXiv:1705.03122
- Gilmer et al., Neural Message Passing for Quantum Chemistry, ICML 2017 · arXiv:1704.01212
- Gu, Dao, Ermon, Rudra & Ré, HiPPO: Recurrent Memory with Optimal Polynomial Projections, 2020 · arXiv:2008.07669
- Gu, Goel & Ré, Efficiently Modeling Long Sequences with Structured State Spaces (S4), 2021 · arXiv:2111.00396
- Gu & Dao, Mamba: Linear-Time Sequence Modeling with Selective State Spaces, 2023 · arXiv:2312.00752
- Gulati et al., Conformer: Convolution-augmented Transformer for Speech Recognition, 2020 · arXiv:2005.08100
- He, Zhang, Ren & Sun, Deep Residual Learning for Image Recognition, 2015/2016 · arXiv:1512.03385
- Ho, Jain & Abbeel, Denoising Diffusion Probabilistic Models, NeurIPS 2020 · arXiv:2006.11239
- Holm, A Simple Sequentially Rejective Multiple Test Procedure, Scandinavian Journal of Statistics 6(2), 1979
- Hopfield, J. J. (1982). Neural networks and physical systems with emergent collective computational abilities. PNAS 79(8):2554-2558.
- Hu et al., LoRA: Low-Rank Adaptation of Large Language Models, 2021 · arXiv:2106.09685
- Inception Labs (Kuleshov et al.), Mercury: Ultra-Fast Language Models Based on Diffusion, 2025 · arXiv:2506.17298
- Jelassi, Brandfonbrener, Kakade & Malach, Repeat After Me: Transformers are Better than State Space Models at Copying, 2024 · arXiv:2402.01032
- Joshi, Transformers are Graph Neural Networks, The Gradient (2020); arXiv version 2025 · arXiv:2506.22084
- Kalchbrenner, Espeholt, Simonyan, van den Oord, Graves & Kavukcuoglu, Neural Machine Translation in Linear Time (ByteNet), 2016 · arXiv:1610.10099
- Karpathy, A Recipe for Training Neural Networks (blog post), 2019 · link
- Kim, Y. (2014). Convolutional Neural Networks for Sentence Classification. EMNLP 2014. · arXiv:1408.5882
- Kimi Team, Kimi Linear: An Expressive, Efficient Attention Architecture (arXiv 2510.26692), Oct 2025 · arXiv:2510.26692
- Kipf & Welling, Semi-Supervised Classification with Graph Convolutional Networks, ICLR 2017 · arXiv:1609.02907
- Klein, F. (1872). Vergleichende Betrachtungen über neuere geometrische Forschungen (the Erlangen programme)
- Krotov & Hopfield, Dense Associative Memory for Pattern Recognition, 2016 · arXiv:1606.01164
- Kun, A Programmer's Introduction to Mathematics (style reference: developer translations)unverified
- Li, Farkhoor, Liu & Yosinski, Measuring the Intrinsic Dimension of Objective Landscapes, ICLR 2018 · arXiv:1804.08838
- Li, Han & Wu, Deeper Insights into Graph Convolutional Networks for Semi-Supervised Learning, AAAI 2018 · arXiv:1801.07606
- Lieber, Lenz et al., Jamba: A Hybrid Transformer-Mamba Language Model, 2024 · arXiv:2403.19887
- Lou, Meng & Ermon, Discrete Diffusion Modeling by Estimating the Ratios of the Data Distribution, ICML 2024 · arXiv:2310.16834
- Marcheggiani & Titov, Encoding Sentences with Graph Convolutional Networks for Semantic Role Labeling, EMNLP 2017 · arXiv:1703.04826
- Melis, Dyer & Blunsom, On the State of the Art of Evaluation in Neural Language Models, ICLR 2018 · arXiv:1707.05589
- Narang et al., Do Transformer Modifications Transfer Across Implementations and Applications?, 2021 · arXiv:2102.11972
- Nickel & Kiela, Poincare Embeddings for Learning Hierarchical Representations, NeurIPS 2017 · arXiv:1705.08039
- Nie et al., Large Language Diffusion Models (LLaDA), 2025 · arXiv:2502.09992
- The Nobel Prize in Physics 2024 (announced 8 Oct 2024): John J. Hopfield and Geoffrey E. Hinton · link
- Park, Choe & Veitch, The Linear Representation Hypothesis and the Geometry of Large Language Models, ICML 2024 · arXiv:2311.03658
- Peng et al., RWKV: Reinventing RNNs for the Transformer Era, 2023 · arXiv:2305.13048
- Poli et al., Hyena Hierarchy: Towards Larger Convolutional Language Models, 2023 · arXiv:2302.10866
- Poole, Lahiri, Raghu, Sohl-Dickstein & Ganguli, Exponential expressivity in deep neural networks through transient chaos, NeurIPS 2016 · arXiv:1606.05340
- Ramsauer et al., Hopfield Networks is All You Need, 2020 (ICLR 2021) · arXiv:2008.02217
- Ravfogel, Elazar, Gonen, Twiton & Goldberg, Null It Out: Guarding Protected Attributes by Iterative Nullspace Projection, ACL 2020 · arXiv:2004.07667
- Ren, Liu, Lu, Shen, Liang & Chen, Samba: Simple Hybrid State Space Models for Efficient Unlimited Context Language Modeling, 2024 · arXiv:2406.07522
- Sahoo et al., Simple and Effective Masked Diffusion Language Models, NeurIPS 2024 · arXiv:2406.07524
- Schlichtkrull et al., Modeling Relational Data with Graph Convolutional Networks (R-GCN), 2017 · arXiv:1703.06103
- Schoenholz, Gilmer, Ganguli & Sohl-Dickstein, Deep Information Propagation, ICLR 2017 · arXiv:1611.01232
- Shazeer, GLU Variants Improve Transformer, 2020 · arXiv:2002.05202
- Sohl-Dickstein, Weiss, Maheswaranathan & Ganguli, Deep Unsupervised Learning using Nonequilibrium Thermodynamics, ICML 2015 · arXiv:1503.03585
- Song & Ermon, Generative Modeling by Estimating Gradients of the Data Distribution, NeurIPS 2019 · arXiv:1907.05600
- Turner et al., Activation Addition: Steering Language Models Without Optimization (later 'Steering Language Models With Activation Engineering'), 2023 · arXiv:2308.10248
- van den Oord et al., WaveNet: A Generative Model for Raw Audio (2016) · arXiv:1609.03499
- Velickovic, Cucurull, Casanova, Romero, Lio & Bengio, Graph Attention Networks, ICLR 2018 · arXiv:1710.10903
- Wolpert, D. H. (1996). The Lack of A Priori Distinctions Between Learning Algorithms. Neural Computation 8(7):1341-1390.
- Wortsman et al., Small-scale proxies for large-scale Transformer training instabilities, ICLR 2024 · arXiv:2309.14322
- Yang, Hu et al., Tensor Programs V: Tuning Large Neural Networks via Zero-Shot Hyperparameter Transfer, 2022 · arXiv:2203.03466