
Guideline-based decision support once meant hand-encoding rules that went stale. Retrieval removed that cost and moved the hard part to evaluation. Notes on a piece in Life Science Daily.

Build A3C from scratch in PyTorch: a critic cuts REINFORCE's gradient variance, and asynchronous workers train it without a replay buffer, on CartPole.

Build a recommender from scratch with the SVD: factorise a user-item ratings matrix, tune the rank, and beat mean baselines on real Jester data.

Predict the next continuous latent instead of the next token: build autoregression in latent space from scratch and see why the head makes or breaks it.

How vLLM serves hundreds of LLM requests at once: build continuous batching and a paged KV cache from scratch and watch GPU utilisation and throughput jump.

Reconstruct a chaotic attractor from a single time series with Takens delay embedding, then forecast it with simplex projection, from scratch in NumPy.

Build linear attention and a diagonal state-space model (Mamba) from scratch in PyTorch, and watch the O(n²) attention cost curve bend to O(n).

Build a Hamiltonian Neural Network from scratch in PyTorch: learn a scalar energy, take its symplectic gradient, and conserve energy where a plain MLP drifts.

The ONS asks UK businesses what has prevented or delayed them adopting AI. Expertise leads among firms of 10 or more employees, and reported barriers peak in the mid-market.

The ONS, Eurostat and the US Census Bureau each publish a business AI adoption rate. The three headline figures differ, and denominators explain most of the gap.

Build three unsupervised anomaly detectors from scratch: Isolation Forest, One-Class SVM and an autoencoder. See why ROC-AUC lies on imbalanced fraud data.

Autoregressive LLMs emit one token per pass. Build masked-diffusion and speculative decoders in NumPy to see how parallel decoding breaks the wall.

Build a graph neural network from scratch in NumPy, then watch a vanilla GCN lose to a graph-blind MLP on a fraud graph, and learn the fixes that recover it.

Build a Vision Transformer from scratch in PyTorch: patch embedding, class token, self-attention. Trained on CIFAR-10 and compared to a CNN.

One decision tree overfits wildly. Average a hundred on bootstrap samples with random feature subsets and you get the no-tuning workhorse of tabular ML.

Boosting fits weak trees to the errors so far, one at a time. We animate the residual loop, derive it as gradient descent in function space, then XGBoost.

Fine-tune a network on a new task and it erases the old. See catastrophic forgetting on split-MNIST, then fix it with Elastic Weight Consolidation and replay.

TabPFN is a transformer pre-trained on millions of synthetic datasets that predicts in one forward pass: no training. Benchmarked against XGBoost.

The KV cache is LLM serving's memory wall. MQA, GQA, and DeepSeek's Multi-Head Latent Attention shrink it 2 to 8x. We train all four and measure the cost.

On-policy distillation (GKD) vs off-policy SeqKD, from scratch in PyTorch. See exactly when training on a model's own output beats copying teacher transcripts.

Build a Joint-Embedding Predictive Architecture in PyTorch. Predict in latent space, watch representation collapse, and learn LeCun's world-model bet.

LoRA and QLoRA in pure PyTorch. Why low-rank adapters need 1000x fewer params, and how 4-bit base quantisation lets you fine-tune 65B models on one GPU.

Sparse MoE in PyTorch from scratch. Top-k routing, Switch Transformer load balancing, Mixtral, DeepSeek. Why MoE scales LLM parameters without scaling FLOPs.

Bagging, AdaBoost, gradient boosting, stacking, and mixture of experts from scratch in NumPy, with XGBoost benchmarked. Why ensembles still win on tabular data.

Probabilistic PCA as a latent variable model. EM-PCA, Bayesian PCA with ARD that picks dimensionality automatically, and Factor Analysis. From scratch in NumPy.

Gibbs sampling exploits conditionals; slice sampling adapts step size. Both cure random-walk Metropolis on correlated targets, with Python and animations.

Hands-on guide to Monte Carlo sampling: inverse-CDF, Box-Muller, rejection, and importance sampling, with Python code, animations, and a decision matrix.

Derive variational Bayesian linear regression in NumPy, compare it to PyMC NUTS on the same dataset, and watch the lower bound pick the true polynomial degree.

Build a Bayesian network in pgmpy from a toy lung-cancer dataset. Parameter learning, d-separation, structure search, causality.

Build a relevance vector machine from scratch. The RVM gives sparser, calibrated alternatives to the SVM via ARD priors and evidence maximisation.
Get notified when new tutorials and deep-dives are published. No spam, unsubscribe anytime.
Questions about these tutorials and write-ups