Skip to the content.

The examples are the most direct way to see TorchLean as a working system. Each page starts from something concrete: a model run, a graph, a tensor artifact, a saved log, a verifier result, or a bug pattern. The goal is to show how runnable ML code becomes an object that Lean can inspect, lower, check, or relate to a theorem.

Start with a small training run or the verification bounds page. For a systems-oriented view, read the text-model and diffusion walkthroughs. For the clearest motivation, read Bug Zoo.

CUDA is opt-in. The build flags, runtime path, and agreement assumptions are explained in GPU and CUDA. For long CUDA training runs, model commands also expose allocator telemetry through --cuda-mem-watch N; longer runs choose a small default cadence so device-memory behavior is visible while the example is running.

The guide also covers the newer runtime-facing APIs used by larger examples: runtime-side Float initializers, typed step streams for generated or file-backed batches, and integer-token GPT helpers that avoid one-hot targets for language-model training.