Notes on verified ML

Here's my vision for verification in AI. Some examples I've been working on :)

* I wrote most of these posts, with some AI assistance in the prose and Lean code.

03 / Training

Training a GPT-2-style model in Lean

Let's train a GPT in Lean :) I trained a 124.4-million-parameter model on one A100, then compared fifty matched updates with PyTorch. The loss improved; turning it into a dependable assistant proved harder.

Alongside the run, we prove results about next-token targets, resuming training, and reusing the attention cache during generation.

Read the experiment →

04 / Tensor programming

Writing tensor programs in Lean

I'd like to write a tensor calculation in Lean and choose the device when I run it. We try the custom-function API, build attention with einsum, and look at the performance measurements. Higher derivatives and binary128 arithmetic let us try other calculations too.

Write a tensor function →

05 / Kimi K3

Kimi K3: the paper and proofs side by side

I wanted to bring the paper-and-proof approach from research mathematics to ML. With K3's report open beside us, we work through its memory, attention, and experts, prove that streaming preserves the logits, and find an endpoint error in the expert-balancing argument.

Open the annotated report →