A teeny-tiny language model (TTLM)(TM)
A language model is a function.
That is all of it.
To say the right sound, the model at “says” has to look back at the animal.
That looking back is attention.
Query is the question a word asks of the words before it. At says: “any animal in front of me?”
Key is each earlier word’s answer. Fit = query · key. Softmax turns the fits into weights that sum to 1.
Value is what a chosen word hands over. The blend is added to says; WU reads the next word off it.
qi=xiWQ,kj=xjWK,vj=xjWV
Aij=softmaxj≤i(dkqi⋅kj)
hi=xi+(∑j≤iAijvj)WO
p(next∣…)=softmax(hiWU)
curl -s https://parley.api.mit.edu/v1/chat/completions \
-H "Authorization: Bearer $PARLEY_API_KEY" \
-H "Content-Type: application/json" \
-d @1-duck.json | jq .
1-duck.json # a list of messages in, one message out
2-name-alone.json # "What is my name?" It has no idea
3-name-with-history.json # same question, earlier turns resent. Now it knows
4-tool-offer.json # a tool on offer. It replies with a request to run it
ls . → 5-tool-result.json # we run the tool, send the result back. It answersThe model asks. It cannot act.
Whoever runs the tool and sends the transcript back is the harness.
| In the TTLM | In pi | |
|---|---|---|
| Model | 1,152 numbers and a forward pass: context in, distribution out | Sonnet behind Parley: a few hundred billion numbers, same contract |
| Context window | 8 words, one per row of Wpos | System prompt + AGENTS.md + your messages + every tool result + its own replies |
| Harness | The Sample and Take-top buttons, and the temperature slider | pi: builds the context, calls the model, runs the tool it asked for, calls again |
| Agent | There is none. Nothing acts | Model + harness + tools, running toward a goal. It can act |
You are an expert coding assistant operating inside pi, a coding agent
harness. You help users by reading files, executing commands, editing
code, and writing new files.
Available tools:
- read: ... - bash: ... - edit: ... - write: ...
Guidelines:
- Use bash for file operations like ls, rg, find
- Be concise in your responses
- Show file paths clearly when working with files
<project_context> ...your AGENTS.md, verbatim... </project_context>
<skills> ...one line per skill it found... </skills>
Current working directory: /Users/you/projectls, every file, every test logThe model does not learn from its mistakes.
The agent can, if you write them down.
Simon Willison, How coding agents work. Ten minutes; it is today’s Part 3 in prose.
Open one of your own pi sessions (ls ~/.pi/agent/sessions). Count the messages you typed and the tool calls the agent made. Two numbers, into your dev-log.
Email me, cc your advisor, ask them to reply-all. Tuesday 22 September.
Sandboxing agents: the lethal trifecta, prompt injection, and running pi inside nono.