Needle 2: the memory budget is written first
3 months ago
A watch has almost no memory to spare. Whatever turns your words into a command has to fit in what is left. Needle 2 does that job. The file the project trained is just over ninety megabytes. The file that ships to the device is thirteen point seven megabytes, and that is the whole model.
Ask about this presentation
Chapters
0:00Needle 2 · a model that turns what you say into an exact command
0:16It answers only in the functions you declared
0:35Memory is the hard limit on a watch or a phone
0:53The memory budget is fixed first, and it decides the most this can hold
1:20The model cannot forget what it is allowed to do
1:40The rule comes from your code, not from the model
2:10It trades five points of accuracy for a model a fraction of the size
2:27Builds for sixteen kinds of device, and a 13.7 MB model file
2:44A model sized by what the device can spare
Show transcriptHide transcript
A watch has almost no memory to spare. Whatever turns your words into a command has to fit in what is left. Needle 2 does that job. The file the project trained is just over ninety megabytes. The file that ships to the device is thirteen point seven megabytes, and that is the whole model.
You write an ordinary function in your own code. Then you say what you want. Dim the bedroom lights to twenty percent, and lock the front door. What comes back is the exact instruction your program takes: which action to run, and the values to run it with. Ask for a poem instead and the answer comes back empty, because writing poems is not one of your functions.
On a watch, memory is the number that cannot move. A model eats memory as a conversation runs. The model keeps running notes on everything said so far. Needle 2 runs a whole session in about twenty-eight megabytes. And every answer Needle 2 sends back carries the memory that answer used, right there in the reply.
Models are normally described by how much conversation they can hold. Needle 2 works backwards. The source picks the memory first: eleven and a half megabytes, written down as a constant. Then the code works out what one more chunk of text costs to remember. A chunk is a short word or a piece of one. That costs about sixteen thousand seven hundred bytes. Divide the budget by that cost, and the answer is a hard ceiling on how far back this model may ever see. The project writes that ceiling into the file that ships.
The model that shipped keeps a window of two hundred and fifty-six chunks of text, well under that ceiling. A long conversation would push the description of what this model may do off the back of a window that short. So the project keeps that description exempt, and marks it on the model’s own diagram. The description stays in memory however far behind it falls.
Needle 2 turns your own function into a rule. That rule decides, letter by letter, which characters are allowed next. If your function accepts only heat, cool or auto, there is no path through which any other word can be produced. The project’s own documentation says the model cannot emit anything else. With one function declared, it says, the shape of the answer is guaranteed rather than requested. The reasoning the model writes alongside is left free, so that part stays readable.
On the project’s own chart, scored on a public set of everyday phone commands that Google put out, Needle 2 lands at sixty-three point seven percent. That is level with a model six times its size, and five points of accuracy off the highest score there. Five points, for a model five to sixty-seven times smaller that runs with the network off.
The project publishes builds for sixteen kinds of device: phones, watches and TVs. Needle 2 is free and open, and it installs from the Python package index. After the first run, a machine with no connection at all can use Needle 2. And that thirteen point seven megabytes is the file that goes on the device, not the size of the download.
Needle 2 is described by the memory it is allowed to spend, and how much conversation that buys is what falls out. The project’s own chart leaves open how much smaller this can get before the answers stop being good enough. Cactus dash compute slash needle, on GitHub. New repo tomorrow.
Up next
6:49Hide the tests from your coding agent? StrongDM's holdout idea, tested on Claude Code
@github-trending
3 weeks ago
0:51Claude Code built a machine to explain prompt caching
@github-trending
1 month ago
10:10reladraw draws your diagram from where you say the boxes go
@github-trending
1 month ago
7:27Lap photo manager finds photos by what's in them, offline
@github-trending
2 months ago
9:04Spirula Studio does Gaussian splatting on any graphics card
@github-trending
2 months ago
8:50Univer puts a spreadsheet, document editor and slides in your app
@github-trending
2 months ago
18:13i-have-adhd, ponytail, and 7 more skills that make your agent stop explaining itself
@github-trending
2 months ago
7:57Homebrew BrewUI runs every brew command in a clean shell
@github-trending
2 months ago
8:35fugleramme draws the birds in your garden on an e-ink frame
@github-trending
2 months ago
9:01Open Code Review: Alibaba open-sourced the code reviewer it validated on a million real tasks
@github-trending
2 months ago
3:03Portless refuses to touch eight shapes of command, and says why for each
@github-trending
2 months ago
2:52The measurement file says 1.571. The stylesheet says 1.57.
@github-trending
2 months ago