Posts
All the articles I've posted.
Diffusion, for Images and for Text: Learn to Undo a Little Noise
Updated:Corrupt data a little at a time until it is pure noise, and train a network to undo one step. For images the corruption is Gaussian noise; for text it is masking. The forward process and its closed form, the noise schedule worked numerically, the ε-prediction loss derived from the ELBO of VAEs and GANs, DDPM and DDIM sampling, classifier-free guidance, and latent diffusion; a diffusion model trained on the eight-mode test of VAEs and GANs, with step counts and guidance measured; then masked diffusion for text, where a toy language shows exactly what decoding many tokens in parallel gets wrong, and the FLOPs and latency arithmetic against autoregressive decoding.
Predicting Chess Outcomes: A Disciplined ML Walkthrough
Updated:Predicting who wins a Lichess blitz game from its opening, rebuilt end to end on 100,000 games. Against a rating curve refitted to the data, the opening adds nothing at move 3 and a Brier gain of about 0.002 at move 10, on all seven splits tried; a Stockfish evaluation makes it 0.0084. The method is the point: an audited dataset, a leakage contract enforced by tests, a baseline worth beating, and diagnostics before features.
DPO: The Policy Is Its Own Reward Model
Updated:RLHF's KL-regularized objective has a closed-form optimal policy, and inverting it expresses the reward through the policy itself. Substituted into Bradley-Terry, the partition function cancels and preference learning becomes a logistic loss on log-probability ratios, with no reward model and no RL loop. The derivation step by step, its gradient, an exact check that in the right policy family DPO and RLHF are the same problem, a demonstration of DPO's collapse with a fully flexible policy and deterministic labels, IPO's bounded alternative, and KTO and ORPO.
Embeddings and Contrastive Learning: Making Similar Mean Close
Updated:An embedding is only as meaningful as the loss that made it, and the data it saw. Word2vec trained on this blog, worked and measured, including the famous analogy test and why it fails here; cosine vs dot product; InfoNCE as cross-entropy over one positive and many negatives, with the temperature and batch size explained; a contrastive head on frozen word2vec vectors, which adds about six and a half points of recall on this little data; and pretrained sentence encoders, one of which matches every English section to its Vietnamese translation.