Skip to content
Preponderous-SoftwarePublic

About

A first-person game about how language models write: tokens, next-word bets and the Press

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

Inkling

A small first-person game about how large language models write, for players who have never studied them. You are the new night scribe at a writing-house whose Press writes one word at a time, like a language model. Tonight the Press has stopped mid-sentence. Each room fixes one part of it, and each room is a puzzle you solve by understanding that part.

The Press Hall: the Page on the wall, the Press below it, plaques either side

Status: second build. The Press Hall and four rooms:

  • Room 1, the Cutting Room (tokens). The stalled text lies on a bench as loose letter blocks: 46 pieces. Aim at the gap between two blocks and glue them. A glue joins that pair everywhere it appears. With 6 glues, get the bench down to 22 pieces, which is what the standard method (always glue the commonest pair) reaches. That method is how real tokenizers are built.

    Aiming at a gap on the bench: the pair is outlined and the prompt says how often it appears

  • Room 2, the Wager Room (next-word probabilities). A board shows a sentence from the Press's reading, cut off before a word. Spread ten chips over four words that might come next, then reveal. Your score is your surprise in bits, the number training pushes down. Grey posts show how the model bet.

    After a reveal: the real word glows, the board shows your surprise and the model's

  • Room 3, the Furnace (temperature). The Press has its bets; the furnace decides how it draws from them. Turn the heat up and down, watch the bets flatten or sharpen on the board, and pump the bellows to see three lines at that heat. Three jobs each need a different heat: a sign that must come out the same every time (0), a fresh line that still makes sense (0.7 to 1), and the oddest lines it can make (hot).

    The Furnace: the bets as bars, three draws at this heat

  • Room 4, the Stacks (training data). The Press only knows the books on its reading desk. Swap books between the shelf and the desk's three slots, pull READ, and it answers three questions, each marked as coming from its reading or as a guess. Leave a book out and it still answers just as smoothly, by guessing. Then it's asked something no book covers, and answers anyway: a hallucination.

    The Stacks: three answers from its reading

  • The Press runs. With all four rooms fixed, the Press writes new sentences onto the Page, one token at a time, at the heat you set, from all five books. Every word comes from a real language model inside the game: a word trigram counter trained on about a hundred short sentences written for Inkling.

    The Page, being written word by word

Each room has a plaque that says what to do, and each solve ends with a card: what just happened, and why it matters. Phones work: there's a stick to walk, you drag to look, and a Use button.

Next rooms (not built): the Gallery (attention: which earlier words it looks at), the Polishing Room (fine-tuning: from text predictor to assistant).

Play

On the arcade: https://inkling.play.danielstephenson.dev. Locally:

python3 tools/serve.py . 8790      # then open http://127.0.0.1:8790/

On Windows, tools\play-inkling.bat copies the game out of WSL and opens it in its own window.

Controls: W A S D to walk, mouse to look, E or click to use. At the wager table, 1–4 put a chip on a word, 5 takes the chips back, and Enter reveals. On a phone: stick, drag, Use.

Code

Plain ES modules, no build step. The engine is Tangle's (engine/: Strata 0.7.0's web kit plus Tangle's host.cpp), used unchanged; walking, geometry and audio are Tangle's too.

  • src/model.js: the language model (trigram counts, temperature, top-k, sampling) and its reading.
  • src/glue.js: the Cutting Room's pair-gluing (byte-pair merging) and its target.
  • src/wager.js: the Wager Room's rounds and surprise scoring.
  • src/furnace.js: the Furnace's jobs, its bets as bars and its draws.
  • src/stacks.js: the Stacks' two extra books, its orders, and answering from what's on the desk.
  • src/world.js: the rooms, furniture, collision and lights.
  • src/text.js: plaques and boards drawn to canvas textures.
  • src/game.js: the game: aiming, puzzles, the Page, captions, cards, input.

npm test runs the model and puzzle tests. node tools/shots.cjs [url] [outdir] [--phone] plays every room headless, saves screenshots, and fails on a page error or a room that doesn't solve (needs Playwright).

Code: MIT. The sentences Inkling reads were written for it and are CC0.

About

A first-person game about how language models write: tokens, next-word bets and the Press

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages