What does an image generator actually read? We learn what a token dictionary consists of and how an image generator understands language, and use tokens to build images that no prompt can produce.
An image generator never reads the words of a prompt. A tokenizer first cuts them into tokens, pieces from a fixed dictionary of about 49,000 entries, and the model receives only their numbers: “what is tokenization?” arrives as 49406, 768, 533, 32634, 10847, 286, 49407. Each number then stands for a list of 768 values, an embedding, and only that list reaches the model.
The workshop follows the talk 51 Ways to Spell the Image Giraffe (39C3) and opens this layer with a small toolkit in the browser. No programming experience is needed.
What is a token?
Participants type sentences and watch them fall apart. Common English words, brand names and hashtags are single entries; “schnitzel” takes two pieces, “Kaffee” three, a Chinese name nine raw bytes. Many emojis have no entry of their own and are spelled from byte fragments as well. Who the dictionary was written for shows in what each language costs.
The token dictionary
The whole dictionary can be searched. Inside “giraffe” hide many pieces that are entries of their own, from gira and ffe down to single letters, and they can be put together in 51 different ways. Normally the tokenizer always picks the same one.
Prompting with numbers
With an image generator patched to accept token IDs directly (SDXL Turbo), participants skip the tokenizer and choose the cut themselves: giraffe as one token, as gira + ffe, or as gi + ra + ff + e, each a prompt of its own. Most spellings still give a giraffe; some give an animal that does not exist.
Rebuilding an image
The last exercise goes the other way: starting from a photo, a genetic algorithm breeds sequences of 16 tokens until CLIP finds them close to the picture. The result reads like noise, yet an image generator can paint the photo back from it. What comes out shows what the machine kept, and what it never had a word for.
Workshop and lecture requests: please get in touch by email.