← Tutorials2 / 17

Build a tiny LLM on your CPU

Step 0: what data does it learn from?Tap to reveal

Twenty short sentences (632 characters) are built into the program, so it runs anywhere. Pass a file path to train on your own text instead.

Small, repetitive text is perfect for learning: you can see the model pick up words and sentence structure.

const CORPUS: &str = "the cat sat on the mat.
the dog sat on the log.
a cat and a dog ran to the park.
...";
← PreviousNext card →