All projects

Haiku Machine

A small language model.
Change a connection to test how weights affect word choices.

Word cards connected by weighted strings, beside a generated haiku.

See how the model chooses a word.

Haiku Machine shows the connections the model uses to generate a poem. You can change those connections and their weights.

Connect words with strings. Give some connections more weight. Step through the choices one word at a time, or let the model play. The thicker a string, the more likely the model is to follow that connection when the path is eligible.

Try one small experiment.

  1. Open the machine and generate a haiku.
  2. Select a string at a fork and increase its weight.
  3. Generate a few more poems.
  4. Look for the change. Does the stronger connection appear more often?

Does a higher weight make a connection more likely without making every poem the same?

Start the experiment

What the model does.

This handwritten language model uses the current word's connections to choose the next word. Each preset marks one or more beginnings for each line. The model only chooses paths that can complete lines of 5, 7, and 5 syllables. Connecting words such as "the" cannot end a line.

Each card has a syllable count. You can add words, move cards, change weights, and choose where a line begins. Choose Rain, Evening, Harvest, or Snow. Each preset suggests one edit that breaks it in an interesting way. Reset restores the selected preset.

What the example helps explain.

Weights change the likelihood of a choice. Constraints change which choices are possible. A simple rule can produce a variety of results.

Modern large language models use learned representations and much richer context. Haiku Machine uses a small, weighted model to show how weights affect word choices. It does not reproduce a transformer.

Want to make an idea easier to understand?

Let's talk about a workshop, an explanation, or an interactive learning experience.