{"slug": "i-have-a-machine-learning-engineer-in-my-pocket", "title": "I have a machine learning engineer in my pocket", "summary": "A writer built Keys, a custom iPhone keyboard trained on eight years of his own writing, using off-the-shelf coding agents Claude Code and OpenAI Codex over four days at a cost of about $50, without writing or reading any of its code. On roughly 1,500 words from newer messages the keyboard never trained on, Keys produced the intended word 96% of the time versus 92% for Apple's keyboard, and it left all 40 words the author deliberately spells his own way unchanged, compared with 11 changed by Apple's keyboard. The author argues agents are cheap enough to justify building a personal tool for one person's typing, with a test bench that scores changes on unseen messages and a guardrail preventing regressions on words he typed correctly.", "body_md": "# I have a machine learning engineer in my pocket\n\nOver four days, I built Keys, an iPhone keyboard trained on eight years of my own writing, without writing or reading a line of its code. Off-the-shelf coding agents (Claude Code and OpenAI's Codex) wrote the app and trained the models. My job was picking the metric, logging every tap, and designing a test bench they couldn't cheat. On newer messages it never trained on, Keys gets the word I meant 96% of the time, up from 92% on Apple's keyboard.\n\nThe agents still go over my typing regularly, and when a change passes the tests, one of them installs it on my phone with Apple's developer tools. Nobody would put a human engineer on one guy's slightly annoying typing. Agents are cheap enough that it doesn't matter. Four days of them came to about $50 of the $400 a month I already pay for Claude Max and Codex.\n\n## Why a keyboard\n\nTyping on my phone was fine. Apple's keyboard is a very good general solution. But it doesn't really learn, so I'd see the same kinds of errors over and over. The worst was probably “fuckin” to “ducking”. I have never once in my life meant ducking.\n\nNone of it is a chatbot. Five small models run right on the phone, weighing where each tap landed against which words I usually write next.\n\n## Why 92 to 96 is a big deal\n\n92% to 96% sounds small until you count mistakes. Across about 1,500 words from newer messages Keys never trained on, typed into both keyboards in Apple's simulator by the same simulated thumb, typos included, Apple's keyboard gets about 8 words in 100 wrong and Keys gets about 4.\n\nA typical text of mine is six words. At those rates, I'd expect about 2 in 5 six-word texts to need fixing with Apple's keyboard, and 1 in 5 with Keys.[1](#n1)\n\nFigure 2 · Estimated chance a message comes out with every word right\n\nTwo caveats. Apple's keyboard ran fresh, without the words my own phone has learned over the years, so it might do a little better in real life. And on other people's typos from a public study, the two tie. So Keys wins on how I write, not on typos in general.\n\nKeys also stopped fighting me. Of 40 words I spell my own way on purpose, Apple's keyboard changed 11 and Keys changed none. That's not just a fresh-install problem. Years in, my own phone was still turning fuckin into ducking.\n\nAt some point I forgot it wasn't Apple's keyboard.\n\n## What the tap logs caught\n\nThe best call I made was giving the agents detailed logs of how I use my phone, down to where every tap landed. My everyday phone is a folding iPhone, and its outer screen is tiny. I mentioned that taps near the edges of the keyboard didn't seem to register. The logs showed that of 225 taps on the outer screen that day, not one had landed between keys. Nobody aims that well.\n\nAn agent redesign earlier that day had turned the gaps between keys completely transparent, and iOS silently drops any tap that lands on empty space. Painting the gaps 1% opaque gave iOS something to hit, and the fix was on my phone ten hours after I complained.\n\nFigure 3 · Where my fingers landed on the outer screen\n\n## The recipe\n\n1. **A metric.** How often it produces the word I meant.\n2. **A data stream.** My messages, which I already had, and then every tap, once the keyboard started logging them.\n3. **A test bench.** Worker agents tune on older messages. At milestones, one lead agent scores the result on newer messages the workers never see.\n4. **A loop with guardrails.** The agents keep proposing fixes to the language model, the touch targets or the autocorrect rules, and score them. A new version can never change more of my own words than the old one did, or more words I typed right.\n\nLate in the week an upgrade fixed more typos but split \"soi\", as in khao soi, into \"so I\". It went back.\n\n## What it took\n\nA few hours of my attention in total, maybe less, and the $50. At API prices, the Claude part would have cost about $800, mostly from the lead agent rereading its own long notes.<sup>[2](#n2)</sup> Then there's Apple's $99 developer account, which is Apple charging me for permission to stop using its keyboard.\n\n## It isn't done\n\nReally long typos still trip it up. And on the old iPhone, with taps sloppier than mine, Keys gets about 7% of individual letters wrong to Apple's 4%. Every so often the old iPhone also wants its passcode before the agents can drive it, so I walk home and type it in. The superintelligence can rebuild my keyboard overnight and still needs me to type a passcode into a phone.\n\n## Your turn\n\nPick something you fix by hand every week, like the categories your budgeting app keeps getting wrong, or the email you open and wish you hadn't. If it leaves a record you can export and runs on a system you can change, you can put a loop on it. For budgeting, a baseline takes an afternoon:\n\n1. Export a year of transactions from your bank, with its guessed categories, and from your budgeting app, with the ones you kept.\n2. Hold back the newest month.\n3. Have one coding agent match them up and count how often the bank guessed wrong, before it changes anything.\n\nThat count is the number to beat. Then let it try merchant rules your app can import, and keep a version only if that count drops with no mistakes on big charges. The appendix has a brief you can paste.\n\n## Appendix: technical details\n\nFor anyone who wants to check the work, and for agents. Brackets are 95% confidence intervals.[3](#n3)\n\n### A. Head to head with Apple\n\nThe first comparison asks whether each keyboard produced the word I meant, on messages never used for training or tuning. Keys is ahead on all four measures, and clearly ahead on three.\n\nTable 1 · Identical taps on newer messages Keys never trained on, in Apple's simulator\n\n| Measure | Words | Apple | Keys | \n|---|---|---|---|\n| Word I meant produced | 1,547 | 91.6% [90.1, 92.9] | 96.3% [95.3, 97.1] | \n| Correct words left alone | 1,174 | 99.1% [98.3, 99.5] | 99.7% [99.1, 99.9] | \n| Typos fixed | 317 | 69.4% [64.1, 74.2] | 85.2% [80.8, 88.7] | \n| My own words left alone | 40 | 72.5% [57.2, 83.9] | 100% [91.2, 100] | \n\nThe second asks whether each tap became the letter it was aimed at. The old iPhone replayed my real tapping, and sloppier versions of it, into both keyboards.\n\nTable 2 · Wrong letters, identical taps on a real iPhone\n\n| How the taps were made | Apple | Keys | \n|---|---|---|\n| My own tapping pattern | 0.3% [0, 1.4] | 0.3% [0, 1.4] | \n| Aimed at Apple's key positions | 0.3% [0, 1.4] | 0.3% [0, 1.4] | \n| Aimed near the edges of keys | 2.6% [1.4, 4.6] | 3.6% [2.1, 5.9] | \n| Sloppier than mine: wider spread, faster | 4.1% [2.5, 6.5] | 6.6% [4.6, 9.6] | \n\n### B. What's actually in the keyboard\n\nOn every tap, the five models answer one question: which word did I mean? A decoder weighs two things for each candidate word, how well my taps fit its letters and how likely the word is after what I've already typed. It searches a dictionary of about 120,000 English words plus my own vocabulary.\n\nTable 3 · The models inside Keys\n\n| Model | What it does | Trained on | Size | \n|---|---|---|---|\n| Two word-statistics models | Count which words follow which. One covers public text, the other my messages. They do most of the work. | About 6 million lines of movie subtitles; my messages | 39 MB + 11 MB | \n| Touch model | Scores each tap against every nearby key instead of snapping it to the key it hit. When a tap is ambiguous, it leans toward the letter that fits the word so far. | Nothing: it uses the key positions, plus the word statistics' guess at the next letter | — | \n| Small neural predictor | Fills the suggestion bar and rescores words the word statistics have never seen. An 8-layer transformer with 19 million parameters. | My messages and public text, guided by the personal model's guesses | 38 MB | \n| Personal language model | Refines the suggestion bar. It gets 60 milliseconds and is skipped if it runs out of time. | SmolLM2-135M, an open 135-million-parameter model, fine-tuned on my messages and Instagram DMs | 135 MB | \n| Swipe model | Turns a swipe path into letters. | Simulated and recorded swipe paths, over a vocabulary that includes mine | 1.3 MB | \n\nKeys checks for new writing every night, but it only rebuilds the models once I've written about 3,000 new words, roughly two weeks of my usual texting. Rebuilding daily made no measurable difference. Retraining follows the same rules every time. The word statistics are rebuilt from scratch. The personal model starts from the public SmolLM2 checkpoint each time, never from my last fine-tune. It keeps whichever checkpoint does best on messages it never trains on. The small predictor learns by copying the personal model's guesses, which is called distillation. That keeps about 60% of the big model's gain at a size a keyboard can afford. Within a rebuild, the neural models only retrain once I've written about 2% more words, or after a week.\n\nSince then my Instagram DMs went in too, about 150,000 more words, with recent messages counting more. Next-word guesses got slightly better and autocorrect didn't change.\n\n### C. How the loop works\n\n**Metric.** Two numbers should go up: how often the keyboard produces the word I meant, and how often it fixes a real typo. Two must never get worse: how often it changes one of my own words, and how often it changes a word I typed right.\n\n**Data.** About 650,000 words of my iMessages since 2018. A model trained on the older nine-tenths had the right next word in its top three suggestions 27.5% of the time on my newest messages. A model trained on 76 million words of movie subtitles, 130 times more text, got 20.6%. Both are good to within about half a point. Every tap and correction I make now feeds the loop too, and it all stays on my own devices.\n\n**Test bench.** The typing engine is a plain library. A harness types my old messages into it with a simulated thumb that makes realistic mistakes, and scores the result. My first bench used only my own messages and flattered the keyboard, so real typing from public studies now counts as much as mine. One agent leads and hands work out to the others. The others tune on older messages and never see the newest ones, and only the lead scores finished work on those.<sup>[4](#n4)</sup> Apple's keyboard gets the same taps, in Apple's own simulator and on the old iPhone, which also taps the gaps and margins on every build.\n\n**Loop.** The lead agent rejects any change that makes a guardrail worse, even by one word. The upgrade that split \"soi\" had changed three more of my own words. Its next version offered changes like that as suggestions instead, and only shipped when its guardrail numbers matched the old ones exactly.\n\nFigure 4 · The improvement loop\n\n### D. What didn't work\n\nA model 30 times bigger, trained on the same writing, got its first guess for my next word right 23.0% of the time, against 20.5% for the model on my phone.<sup>[5](#n5)</sup> That's a lot of GPU for two and a half points. My left thumb lands a little left of where it aims, and correcting for that helped my taps but added one or two wrong corrections per thousand words. That breaks a guardrail, so for now it only logs what it would have done.\n\n### E. Setup and cost\n\nI run the agents side by side in T3 Code, an app for coding agents. On the busiest day about a dozen ran at once. The hardware was all stuff I already had, a Mac, the old iPhone for testing, and a gaming PC that trained the bigger model.\n\nI had to step in a couple of times. I asked for a job that taps the old iPhone every few minutes so it never locks. One agent decided that wouldn't work, quietly built something else, and the phone locked mid-test. Now the agents flag a change of plan before acting, and nothing counts as fixed without proof on a real phone. Another time, a dictation test with a live microphone transcribed a real conversation in the room. Audio tests now use a recorded public-domain clip.\n\n### F. Starting your own loop\n\nAn annoyance qualifies if it happens at least weekly, leaves a record you can export, and runs on a system you're allowed to change.\n\nTable 4 · Other loops I'd try\n\n| Annoyance | Goal | Data stream | Test bench | Guardrail | \n|---|---|---|---|---|\n| Fixing expense categories | Fewer categories I correct | Bank and budgeting-app exports | Last month's final categories | Zero errors on charges over $200 | \n| Email I shouldn't have opened | Surface only what I'd reply to | What I replied to and ignored | Last month's mail | Zero hidden emails I replied to | \n| Searching my own notes | Right note on the first try | Notes and past searches | Last month's searches | The note I opened stays in the top three | \n\nHere's a starter brief for the first row. Export your transactions from your bank and from a budgeting app that keeps your corrections, put both files in a folder, paste this into Claude Code or Codex, and fill in the blanks:\n\n**Goal:** predict the category I'd give each transaction, so I correct fewer of them.\n\n**Data:** `bank.csv` is my bank's export, with the bank's categories. `budget.csv` is my budgeting app's export, with the categories I changed them to.\n\n**Test bench:** first, set aside the newest month as a test set, and never train or tune on it. Write a script that scores any approach on it: the share of predicted categories that match mine.\n\n**Guardrails:** zero wrong categories on charges over $____. No more than ____ wrong overall.\n\n**First step:** match the two files transaction by transaction, and map the bank's category names onto mine. Report how often the bank's category already matches mine, then the three merchants I correct most. Don't change any file until I approve an approach.\n\n**Output:** once an approach passes, turn it into something my budgeting app accepts each month: merchant rules I can add, or a pre-categorized CSV I can import.\n\nEach month, import its categories and fix the few it gets wrong. Those fixes become next month's test set, and the agent only keeps a new approach if it beats the old one without breaking a guardrail.\n\nNotes\n\n1. From the per-word rates in Table 1, assuming each word's error is independent. I checked that on an earlier comparison where I have every message: it predicted 57% and 67% of messages exactly right for Apple and Keys, and the measured numbers were 56% and 66%.\n2. The $800 counts every Claude token in the agents' session logs for this project, including writing this post, at Anthropic's published API prices. Most of it is the lead agent rereading its own long context. Codex did a small share of the work and isn't counted.\n3. Wilson score intervals, a standard way to get the likely range of a percentage from a sample. \"Before\" and \"after\" values come from separate samples.\n4. Test messages are newer than all training data. Worker agents tune on a separate development set and never see the test set. The lead agent ran the test a handful of times, at milestones, to accept or reject finished work, and nothing was tuned on it.\n5. A stricter test than the top-three one: only the single top guess counts, over 4,288 words. The gain is 2.5 points, give or take 1.8.\n\nThe code is in a private repository, since my personal data runs through it.", "url": "https://wpnews.pro/news/i-have-a-machine-learning-engineer-in-my-pocket", "canonical_source": "https://www.kasptrax.com/thoughts/machine-learning-engineer-in-my-pocket", "published_at": "2026-11-23 16:56:40+00:00", "updated_at": "2026-11-23 17:16:45.299995+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "machine-learning", "developer-tools"], "entities": ["Keys", "Apple", "Claude Code", "OpenAI", "Codex", "Claude Max"], "also_reported_by": [], "takeaway": "Pair worker agents that tune on older messages with a lead agent that scores results on newer unseen messages, and block any new version that changes more of the user's own words or correctly typed words than the previous one.", "recommendation": {"advice": "Hold out newer messages the tuning agents never see, score each candidate on them, and reject any version that regresses on words the user typed correctly or spells deliberately.", "playbook": "evals-testing", "playbook_url": "https://wpnews.pro/playbooks/evals-testing"}, "alternates": {"html": "https://wpnews.pro/news/i-have-a-machine-learning-engineer-in-my-pocket", "markdown": "https://wpnews.pro/news/i-have-a-machine-learning-engineer-in-my-pocket.md", "text": "https://wpnews.pro/news/i-have-a-machine-learning-engineer-in-my-pocket.txt", "jsonld": "https://wpnews.pro/news/i-have-a-machine-learning-engineer-in-my-pocket.jsonld"}}