Experiments with language models small enough to run on a phone. Each one starts with a question,
and most end with an answer I didn't expect. Every number here comes from a run in
lm-experiments, and this page rebuilds itself from that repo whenever I push.
a language model run by colour blending on a 2D canvas
Can a 2D canvas, using only blend modes and image scaling, run a real language model fast enough to watch?
The canvas picks the same token as a plain numpy reference on all 60 tokens of a greedy run, at about 20 tokens a second with the live tiles on and about 30 with them off.
small models answer with Wikipedia/Wikidata tools, then review (and fix) their own answer; Haiku baseline
Small models are bad at most things, but can one get one message right if it answers first and then a second pass of the same model reviews that answer, looks things up, and fixes it?
At 0.6–0.8B the model can read; it can't search. Give Qwen3 0.6B a paragraph containing the answer and it's right every time.
what happens when a phone browser takes the GPU away
Safari on iOS 27 kills WebGPU work that runs too long (a 3-second watchdog per command buffer, from the WebKit commit "Long running command buffers can hang the system"; it isn't in the release notes) and then may refuse to give the page a GPU again.
Two different kinds of GPU loss on the iPhone: a single long job loses the device but the page gets a working GPU back in ~13 ms; ~3 s of back-to-back queued work loses it with "destroyed" and the page gets no GPU at all until it reloads.
Goal: a WebLLM-loadable MLC build of LiquidAI/LFM3-1.7B (q4f16_1 weights + a WebGPU model library .wasm + mlc-chat-config.json) that loads on @mlc-ai/web-llm 0.2.87, for Squiggle's phone path (engine-webllm.js, a model's mlcRecord).
LFM3 1.7B runs in Safari on an iPhone 16 through WebLLM at 13.7 tokens a second ; a 3-bit build loses its judgement, and a long task still runs out of the tab's ~1.9 GB.
does a looked-up snippet let a small model write loops in a language it never saw?
Is knowing what a for loop does different from knowing how to spell one? If a small model already gets the concept (loop over this, step by that, body does X), then looking up a syntax snippet should be enough to write loops in a language it's never really seen. Free first test, no training.
A looked-up snippet does not let them carry that concept into a new spelling. With the snippet, Qwen3 0.6B solves 0 of those tasks in Zig and 1 in Plink; Qwen3 1.7B solves 3 in Zig and 5 in Plink.
On-device models in Squiggle keep killing the Safari tab on an iPhone 16. Apple doesn't publish how much memory a web page may use before iOS kills it. How much is it, is it one budget or separate ones for JavaScript, WebAssembly and the GPU, and is it the phone or the browser?
iPhone Safari gives a tab about 1.9 GB, one budget shared by JavaScript, WebAssembly and the GPU; Firefox on an Android phone went past every cap the test had.
tiny untrained GPT-2, Qwen3 and Gemma 4 with four ways to fill their weights at random
The idea: "i wanna make a really small model... but instead of training it lets just throw random numbers in the weights."
No random weights beat a blind guess. The best one, the standard init, lands 0.009 above uniform odds: the logits are so small that the model is close to "every token equally likely", which is why it's the least wrong.
If every weight started equal, would every neuron learn the same thing, and how much does the size of the random starting numbers matter?
Equal starting weights never become different: every layer stays one neuron copied 12 times. Scaled random learns the spiral in 12 to 60 steps; tiny random never leaves the coin-flip loss; huge random kills every ReLU.
answer from a small packet instead of the whole conversation
If a front layer reads the whole chat and writes a ~350-word packet (a gist, what the vague words in the new message point to, and only the facts that matter), can the model answer from just that packet as well as it can from the full history?
the packet matched full history at 7% of the words
A planner has to know where the agent is, what it's holding and which doors are open. A plain transformer has no table for that, so it rebuilds the state at every word by looking back over the whole plan. This run gives the model state registers: 8 small slots carried alongside the text.
The same model and tests as experiments/weird (a 6-layer GPT on FineWeb-Edu), changing only how text is cut into tokens. Lossless tokenizers are compared on bits per byte of the original text. Lossy ones predict different text, so they're compared on tests transformed the same way (BLiMP, plus next-word tests where BLiMP breaks).
Squiggle's evals (KealJones/squiggle tests/eval) drive the real app in headless Chromium. With LFM3 1.7B on Tilde, which needs WebGPU, they have so far run only on an iPhone through the phone relay: one case at a time, one run per case, and only while the phone stays awake. This asks whether a Hugging Face GPU job can do it instead.
WebGPU works on a Hugging Face T4 (webgpu-smoke-4, 2026-11-22).
A cheap test, before spending $20–40 on the full plan (Figure-it-out model plan), of the thing run 1 failed at: putting known steps together into a plan it has never seen.
Verdict: NOT YET for both trained arms. Held-out strict mean was 26% (gold) and 28% (teacher) against the 50% bar, with at least one held-out type at 0% in each. The untouched model scored 0% strict. Run 1 (SmolLM2-135M) also scored 0% on unseen plans, so this is progress, but short of the bar.
Sun 25 Oct 2026, run findout2-pilot-all-2, full numbers in hf-pilot-all-2/PILOT_RESULTS.mdRead the write-up
Registers v2 showed that state slots updated at every word, trained without any simulator, made a 3.6M-parameter planner far more reliable, especially on messy input. Training from scratch is expensive, so this tests the same ideas on top of small pretrained models.
can a pass over finished notes drop the stale lines without losing facts?
Follow-up to notes-search run 4a. The native layout made LFM3's notes small and cheap to write, but it almost never changes or deletes a line (6 changes, 1 delete in 833 passes), so old values sit next to new ones: chat 1 has "Party moved to Sunday March 22nd" and four lines still saying March 14th.
A word-overlap rule is too blunt to trust. At 60% it cleared two of test 1's stale lines and test 6's leaked score without losing an answer-key fact, but it also threw away lines that were right: run-a's 71.4 score (a later run line had different numbers), "8 inches is the corrected length" (a correction!), and test 6's "run-b: 70.3, corrected from 78.9".
If a stock small model gets a few trained memory slots (the registers-v2 design) plus a LoRA, can it pick up a half-finished plan from a fresh, nearly empty prompt using only the slots? The goal is to get close to re-reading the whole transcript, while spending a fraction of the prompt tokens.
Can a tiny model (≤ ~500 MB GGUF, running in wllama 3.8.1 on an iPhone CPU) learn the habits Squiggle's harness needs: notice what it doesn't know and look it up (checking it found the right thing), plan multi-step work and finish each step with done(result), use a recipe when the prompt has one, say what's missing with need, cope with messy…
Three small experiments on one question: if a model learns toki pona first, do English words "funnel" into the spots toki pona made for each concept (water next to telo), and does toki pona survive afterwards?
Updated after v9: planting concepts in chosen neurons works, and English will use those planted spots if the languages are mixed together during a bridge stage and the planted weights are lightly protected.
Goal (2026-10-28/29): a Gemma 4 small enough for an iPhone browser tab (wllama, CPU), by surgery on Gemma 4 E2B plus a short heal (distillation from Gemma itself; no Claude-written data).
The vocab cut is nearly free: ~99.2% of counted text covered, +1% tokens, samples identical, 4.63B → 2.72B. (Offline: 2.0% of real user writing uses tokens outside the 80K, mostly emoji and slang.)
The idea: "let's throw random math equations in front of and behind attention and MLP and just see what happens."
Two variants beat the baseline by about three times its seed spread. Both are one run each, so they're candidates, not findings. The signed log is a soft squash on how big each MLP update can be, a cousin of known stabilising tricks. It also had the best WikiText-2 perplexity of the whole run. The learned cubic gives each channel a little extra curvature to play with.
can LFM3 1.7B keep its own notes well enough to drop the chat history?
Follow-up to context-packets. There, a big model read the whole chat and wrote a ~350-word packet. Retrieval (BM25, embeddings, query rewriters, doc2query) couldn't replace it at that size: the facts that matter are throwaway corrections ("btw we moved the party") that share no words with the later question.
Runs and spend.whiteboard-1 (vLLM, a10g-small): died at model load, pip vLLM has no native LFM3 and its generic fallback can't run the conv layers, $0.08.
Follow-up to experiments/registers, same skins world, 3.6M-parameter GPT. Run 1 found that 3 taught state slots cut bookkeeping errors from 226 to 38, but seeds were noisy and periods were the only thing that triggered slot updates.
how Qwen3 0.6B copes with running out of room, resuming, and agent setups
Oct 31 – Nov 1, 2026. Question: when a small model runs out of context mid-task, what harness lets it pick up and finish? Then: does curating context, changing step size, a normal long-context agent, or a multi-agent team help?
Only word overlap beat the do-nothing baseline (3.0).
Maps all 850 words of Ogden's Basic English onto toki pona "hub" words, so a training corpus can deliberately route every English word through its hub (the mixed-bridge result in ../tiny).
What Gemma 4's own thinking does on 38 messy, real-style prompts (the kit from the Squiggle chat), as input to the training template for Squiggle's phone model (squiggle docs/harness.md).
Keep: the split-the-request list (it is natural and accurate), the constraint extraction, the one-paragraph triage for simple requests, and searching named things before explaining them.
teach a small borrowed model the loop, not the facts
The "Finding Out" paper's thesis, tested directly. We take a small pretrained model, SmolLM2-135M-Instruct, which already reads English, and teach it only the loop: notice a gap, look it up, note what it found, calculate exactly, ask the person, catch a stale assumption, check, answer.
The loop is learnable at 135M parameters. In the trained task types the model looks things up exactly when it needs to, never when the answer is already in the message, always uses the calculator, asks when only the person knows, and handles the stale-assumption case. The untrained model with examples does almost none of this.
Does learning goal-directed planning in toki pona first make a small (~3.6M parameter, 8 layers, deep and thin) model plan better in English, from only a few English examples?
The setup works. The reference model (English goals all along) solves about 80% of new episodes and 67–72% of the longer chains it never trained on. It looks things up 87–91% of the time when a fact is missing and never when it isn't.
The goals experiment (run 2) showed that teaching a skill in a small, clean language first lets a small model learn it in English from far fewer examples. This experiment tries the same recipe on real text, with about 17M-parameter Llama-style models.
No clear win this time. On English loss and grammar, simple-first and english are tied within noise. simple-first is 3 points ahead on bAbI, but most of that is one task (task 5: 74% vs 51%), and it's one seed.
Tests the "intuition block" idea: a module that pulls out the shape of a problem, with the nouns stripped away, so the lesson carries over to a domain the model has never planned in.