AboutAbout the project
Chat models that run as brainfuck programs
Five real chat models, from 135 million to 1.54 billion weights, each written out as one brainfuck program: SmolLM2-135M, Qwen2.5-0.5B, Qwen2.5-1.5B, Qwen3.5-0.8B and Qwen2.5-Coder-0.5B. brnfck-qwen3.5-0.8b-vision runs Qwen3.5-0.8B with its part for pictures as well.
In short
Brainfuck is a programming language made as a joke. It has eight commands: step left, step right, add one, take one off, read a letter, print a letter, and two for repeating. This site runs four real chat models in it. Each is one program of 1 to 11.4 billion characters. The only thing a program reads is your question, and the only thing it prints is the answer. brnfck-smollm2-135m, the smallest, is fast and often wrong. brnfck-qwen2.5-0.5b and brnfck-qwen2.5-1.5b are slower and get simple sums and facts right. Brainfuck runs each of them faithfully, mistakes included. brnfck-qwen3.5-0.8b runs Qwen3.5-0.8B, a newer generation than Qwen2.5. Its model has the same kind of layers as Qwen3.8-27B, a much larger model: 18 of its 24 layers keep a memory of fixed size, and after every three of them comes one that looks back at every earlier word piece. A fifth program, brnfck-qwen3.5-0.8b-vision, runs the same model with its part for pictures: it reads a picture before the question.
What is the capital of France?The capital of France is Paris.
What is 12 + 30?12 + 30 equals 42.
What is 12 + 30? (Answer with the number only, e.g. "7"; no words!)12 + 30 = 32
Open the Chatbot Ask the small, faster model Read how it works first
brnfck-qwen2.5-0.5b starts a download of 749 MB and needs about 4 GB of free memory. brnfck-smollm2-135m downloads 180 MB and needs about 1.5 GB of memory. Both need a desktop computer. Not the moment? How it works needs nothing.
What this is
A chat model is a very long list of numbers, called weights, and a fixed recipe of sums. Here five such models, SmolLM2-135M, Qwen2.5-0.5B, Qwen2.5-1.5B, Qwen3.5-0.8B and Qwen2.5-Coder-0.5B, are each written out as a single program in which every character is one of the eight commands. Almost all of a program writes the model's numbers into memory. The last part does the thinking. The only thing a program reads is your question, and the only thing it prints is the answer. brnfck-qwen3.5-0.8b-vision reads a picture first.
- chat programs, of five models counted
- 6
- different commands, and nothing else counted
- 8
- input command in each program of text: it reads your question counted
- 1
- characters in the program of brnfck-qwen2.5-1.5b counted
- 11,430,468,880
"Counted" means counted in the program file itself; for brnfck-smollm2-135m you can repeat the count in your browser (on How it works, under "How do I know it is real?"). "Measured" means timed on one computer.
The models, compared
The same idea at four sizes. A bigger model answers better, and you wait longer for it. brnfck-qwen3.5-0.8b runs Qwen3.5, a newer generation than Qwen2.5, with a different kind of layer. brnfck-qwen3.5-0.8b-vision runs the same model with its part for pictures.
| brnfck-smollm2-135m | brnfck-qwen2.5-0.5b | brnfck-qwen2.5-1.5b | brnfck-qwen3.5-0.8b | brnfck-qwen3.5-0.8b-vision | |
|---|---|---|---|---|---|
| Model | SmolLM2-135M-Instruct | Qwen2.5-0.5B-Instruct | Qwen2.5-1.5B-Instruct | Qwen3.5-0.8B [8] | Qwen3.5-0.8B with its part for pictures [8] |
| Made by | Hugging Face | Alibaba Cloud | Alibaba Cloud | the Qwen team of Alibaba Cloud | the Qwen team of Alibaba Cloud |
| Weights | 135 million | about 494 million | about 1.54 billion | about 752 million, in the text part | about 853 million: 752 million in the text part, 101 million in the part for pictures |
| Program, in characters | 1,030,902,380 | 4,169,659,608 | 11,430,468,880 | 7,709,034,855 | 8,931,101,427 |
| Of which write the tape | 1,004,387,443 | 4,100,831,733 | 11,334,697,744 | 7,448,657,450 | 8,214,809,705 |
| Tape, in cells of 32 bits | 188,012,789 | 657,597,114 | 1,827,870,014 | 1,067,424,772 | 1,197,356,368 |
| Start-up | about 9 to 16 s | 33 to 47 s | 2 min 27 s | 2 min 10 s to 2 min 37 s in the browser; 103 s from the command line | 1 min 40 s in the browser, then 13 min 43 s for the picture and the question; 86.5 s from the command line, then 650 s |
| Time for one word piece | about 0.6 to 1.0 s | about 2.3 s | 7 to 12 s | about 5.6 s in the browser; 5.56 s from the command line (median) | 6.59 s from the command line (median) |
| Same next word piece as the original model | 94.8% (345 of 364) | 96.6% (477 of 494) | 97.2% (318 of 327) | 95.1% (214 of 225), its whole-number version against the original | 97.5% (79 of 81) on four photos, its whole-number version against the original |
| Simple sums and facts | often wrong | usually right | usually right | usually right | not asked: it is asked about pictures |
| Download the program | brnfck-smollm2-135m.bf, 1.03 GB | brnfck-qwen2.5-0.5b.bf, 4.17 GB | brnfck-qwen2.5-1.5b.bf, 11.43 GB | brnfck-qwen3.5-0.8b.bf, 7.71 GB | brnfck-qwen3.5-0.8b-vision.bf, 8.93 GB |
| Where it runs | in your browser | in your browser, about 4 GB of memory | in a desktop browser, about 8 GB of free memory (ran in one desktop Chromium browser), or from the command line, about 10 GiB free | in your browser, about 5 GB of memory | in a desktop browser, about 7 GB of free memory, or from the command line |
Each program can be downloaded as it is: one text file of nothing but the eight commands. Nothing is fetched until you press a button.
SmolLM2-135M-Instruct, Qwen2.5-0.5B-Instruct, Qwen2.5-1.5B-Instruct, Qwen3.5-0.8B and Qwen2.5-Coder-0.5B-Instruct were published under the Apache 2.0 licence [1] [2] [8]. Each program holds only the eight commands, with one output command. The programs of text have exactly one input command; brnfck-qwen3.5-0.8b-vision has three: one reads the picture, two the question (its first character, then the others). Brainfuck has whole numbers only, so each model was first converted to whole numbers. The row "Same next word piece as the original model" of Table 1 says how often that version agrees with the original [7].
Where to go
- Chat: brnfck-smollm2-135mAsk the program of 135 million weights a question and watch the answer arrive, one word piece at a time. Fast, and wrong more often.
- Chat: brnfck-qwen2.5-0.5bA model of 494 million weights: slower, and right more often.
- Chat: brnfck-qwen3.5-0.8bQwen3.5-0.8B, a model of 752 million weights with the same kind of layers as Qwen3.8-27B, a much larger model. A download of 1.36 GB.
- Looking at a picturebrnfck-qwen3.5-0.8b-vision reads a picture and a question. Where every square of the picture looks, layer by layer, and what the program said about four photos.
- How it worksOne question followed from your keyboard to the first printed word. No programming needed.
- Program mapEvery character of a program on one map: zoom from the whole of it down to single commands. As one line, as rows, folded into a square, or as an outline. For brnfck-smollm2-135m, brnfck-qwen2.5-0.5b, brnfck-qwen2.5-1.5b and brnfck-qwen3.5-0.8b.
- Inside the programA walk through each of brnfck-smollm2-135m, brnfck-qwen2.5-0.5b, brnfck-qwen2.5-1.5b and brnfck-qwen3.5-0.8b: its parts one by one, one block of weights taken apart, the engine, where the time goes, and all four side by side. All measured.
- Start hereWhere learning starts. The language the models are written in: eight commands, a machine to try them on, and where to go for a playground, patterns, challenges and a reference.
- Brainfuck basicsThe language in ten short lessons, for complete beginners.
- Build toward a chatbotEleven lessons with puzzles, for when you want to try every trick of the chat programs yourself.
- Questions and caveatsThe last part of How it works. What "pure" means and does not mean, how it was checked, the numbers, the credits.
Questions people ask first
How it was built
Twelve steps, each one small enough to test before the next. Figure 4, under the list, shows what they did to the length of the program.
- A tiny network that answers fixed questionsA small recurrent network that answers a fixed set of questions. It showed that a brainfuck program can do the sums of a neural network at all.
- Faster building blocksBrainfuck can only count. Dividing and rounding a number by counting took 1.2 to 1.5 million steps. By pushing bits out of a cell one at a time (the "bit peel") it takes about 100. You can try it in lesson 5 of the model lessons, "peeling off bits".
- A story model, weights written into the programA real language model with 260 thousand weights that writes children's stories [3]: 4,597,324 characters of brainfuck, and about a third of a second for a story of 64 word pieces.
- An engine that reads its weights as inputWriting every weight as plus signs does not scale. So the program became an engine: it reads the model's numbers first, the way a music player reads a song.
- A chat model with 135 million weightsSmolLM2-135M-Instruct [1], converted to whole numbers because brainfuck has no others. The converted model picks the same next word piece as the original in 94.8% of the tested cases (345 of 364) [7].
- Cutting text into word pieces, in brainfuckThe model reads word pieces, not letters. The program finds them itself, with a lookup table (a hash table) laid out on the tape.
- One program from text to textThe engine of step 4 and the text handling of step 6 joined: 30,841,969 characters that read 355,761,802 bytes of model data, then your question, and print the answer.
- The self-contained programThe model data that the program of step 7 read moved into the program itself: a billion characters that write the weights onto the tape. Nothing is read but the question. This is brnfck-smollm2-135m on this site.
- brnfck-qwen2.5-0.5b: 494 million weightsQwen2.5-0.5B-Instruct [2] as one program of 4,169,659,608 characters. It still runs in the browser: the chat with brnfck-qwen2.5-0.5b.
- brnfck-qwen2.5-1.5b: 1.54 billion weightsQwen2.5-1.5B-Instruct [2] as one program of 11,430,468,880 characters. Its tape of 1,827,870,014 cells takes 6.81 GiB, so it needs an interpreter with 64-bit memory. It runs from the command line, and on 11 October 2026 it ran from start to answer in one desktop Chromium browser: the chat with brnfck-qwen2.5-1.5b. Ready in 2 min 27 s, then 9.0 seconds per word piece (measured).
- brnfck-qwen3.5-0.8b: a different kind of layerQwen3.5-0.8B [8], about 752 million weights, is the smallest model with the same kind of layers as Qwen3.8-27B, a much larger model. 18 of its 24 layers are Gated DeltaNet layers: a memory of fixed size, whatever the length of the conversation. The other 6 look back at every earlier word piece, one after every three DeltaNet layers. As one program it has 7,709,034,855 characters. Its tape of 1,067,424,772 cells takes 3.98 GiB and fits a 32-bit memory, unlike that of brnfck-qwen2.5-1.5b. All 11 checks pass: only the eight commands, one input and one output command, the tape equal to Qwen3.5-0.8B as loaded, in 1,018 SHA-256 sums, and the reference answer to “What is the capital of France?”, 30 word pieces, to the letter. The program follows its whole-number recipe exactly, with weights of 10 bits; that recipe picks the same next word piece as the original model at 214 of 225 positions (95.1%). Compare the models explains the new kind of layer. Ask it yourself there runs Qwen3.5-0.8B in floating point with its DeltaNet layers in whole numbers: close to the program, but not what it computes. The chat with brnfck-qwen3.5-0.8b.
- brnfck-qwen3.5-0.8b-vision: a pictureQwen3.5-0.8B [8] also has a part that was trained on pictures, about 101 million weights: 12 layers that look at a picture of 256 by 256 pixels in squares of 16 by 16, and turn every block of four squares into one word piece for the text model. brnfck-qwen3.5-0.8b-vision is brnfck-qwen3.5-0.8b with that part at the end of its tape: one program of 8,931,101,427 characters that reads the 196,608 bytes of the picture, then the question. Its tape of 1,197,356,368 cells takes 4.46 GiB, so it needs 64-bit memory, as brnfck-qwen2.5-1.5b does. All 21 checks pass: only the eight commands, the tape equal to the loaded model, and for six questions about four photos the text of the reference to the letter. Looking at a picture shows where every square looks. The chat with brnfck-qwen3.5-0.8b-vision.
Has this been done before?
An earlier public project (lobotoml) ran a neural network of 7 neurons in brainfuck, for the XOR function [4]. We looked for an earlier language model or chat model in brainfuck and found none. Our search was limited, so we do not claim to be the first.
The chat programs run models that were trained elsewhere. The four programs on Trained in brainfuck, brnfck-train-names-bigram-756, brnfck-train-names-mlp-7k, brnfck-train-names-attn-10k and brnfck-train-shakespeare-attn-55k, train one themselves: they start from random weights, learn from a list of names or from Shakespeare step by step, and print a second program that writes with what they learned.
Limitations
- The answers can be wrong. brnfck-smollm2-135m is often wrong, also on simple sums. brnfck-qwen2.5-0.5b, brnfck-qwen2.5-1.5b and brnfck-qwen3.5-0.8b usually get simple sums and facts right but are still wrong on harder facts: brnfck-qwen3.5-0.8b puts Leeuwarden on the Baltic Sea. The original models make the same kind of mistakes. Do not rely on what any of them says. How it works says why: "Why are the models wrong so often?"
- The numbers were rounded. Brainfuck has whole numbers only. The converted models of brnfck-smollm2-135m, brnfck-qwen2.5-0.5b and brnfck-qwen2.5-1.5b pick the same next word piece as the originals in 94.8%, 96.6% and 97.2% of the tested cases, not in all [7]. For brnfck-qwen3.5-0.8b it is 95.1%; for brnfck-qwen3.5-0.8b-vision, on four photos, 97.5% (79 of 81).
- The models were not made in brainfuck. They were trained by Hugging Face and by Alibaba Cloud in the usual way. Brainfuck only runs them.
- It is heavy. brnfck-smollm2-135m needs a download of 180 MB and about 1.5 GB of free memory; brnfck-qwen2.5-0.5b 749 MB and about 4 GB of memory. brnfck-qwen2.5-1.5b needs a recent desktop browser, a download of about 2.1 GB and about 8 GB of free memory; a phone cannot run it. brnfck-qwen3.5-0.8b needs 1.36 GB and about 5 GB of memory, and cannot yet clear its memory after an answer, so the Chatbot loads it again for each question. brnfck-qwen3.5-0.8b-vision needs a desktop browser with 64-bit memory, a download of 1.51 GB and about 7 GB of free memory, and is loaded again for each question too. The chats have only been tried in one desktop Chromium browser.
- It needs a fast interpreter with cells of 32 bits. The result is identical to running one command at a time, but one at a time would take far too long. How it works has the details: "Why is it this fast?"
The full list is on How it works, under "What does "pure brainfuck" mean, and what does it not mean?"
Notes and sources
- SmolLM2-135M-Instruct, the model of brnfck-smollm2-135m. Made by Hugging Face and published under the Apache 2.0 licence: huggingface.co/HuggingFaceTB/SmolLM2-135M-Instruct.
- Qwen2.5-0.5B-Instruct and Qwen2.5-1.5B-Instruct, the models of brnfck-qwen2.5-0.5b and brnfck-qwen2.5-1.5b. Made by Alibaba Cloud and published under the Apache 2.0 licence: huggingface.co/Qwen/Qwen2.5-0.5B-Instruct and huggingface.co/Qwen/Qwen2.5-1.5B-Instruct.
- llama2.c, a project by Andrej Karpathy, published under the MIT licence, and the tinyllamas collection of model files that belongs to it (also MIT). The small story model stories260K of step 3 of "How it was built" comes from there.
- lobotoml, an earlier public project: a neural network of 7 neurons in brainfuck, for the XOR function.
- Brainfuck, a language designed by Urban Müller in 1993.
- Measurements of this project. Character counts are counted in the program files; times were measured on one desktop computer with the program file on its own disk. The full tables are on How it works, under "The numbers".
- Agreement with the original models. The same next word piece in 345 of 364 tested cases for brnfck-smollm2-135m (94.8%), 477 of 494 for brnfck-qwen2.5-0.5b (96.6%) and 318 of 327 for brnfck-qwen2.5-1.5b (97.2%). For brnfck-qwen3.5-0.8b, 214 of 225 answer positions (95.1%): its whole-number recipe, which the program computes bit for bit, against Qwen3.5-0.8B in floating point; with 8-bit weights it would be 209 of 225. See How it works, "What does "pure brainfuck" mean, and what does it not mean?"
- Qwen3.5-0.8B, the model of brnfck-qwen3.5-0.8b and brnfck-qwen3.5-0.8b-vision. Made by the Qwen team of Alibaba Cloud and published under the Apache 2.0 licence: huggingface.co/Qwen/Qwen3.5-0.8B. Its weights and layers are from its model files; the counts are counted in the program file, and the times were measured on one desktop computer, in the browser and from the command line.
From here
- Ask brnfck-qwen2.5-0.5bbrnfck-qwen2.5-0.5b, in your browser. A download of 749 MB.
- How it worksOne question followed from your keyboard to the first printed word. No programming needed.
- Inside the programThe parts of the program, one by one, measured.
- Program mapEvery character of the program as one picture, to zoom into.
- Start hereThe path from eight commands to programs like these.