[Prompt] Claude Code's voice dictation is clearly streaming speech recognition: my words appear as I speak, and then it sometimes goes back and corrects earlier words based on the surrounding context. How is that achieved? What is the technique called, and what is actually happening in the model and in the connection when a word that's already on screen gets rewritten? (Claude Code's speech vendor is not publicly named; the program streams to Anthropic's own server using a Deepgram-style protocol.)
[Response] Corn: Here's a number that took the glamour out of this topic for me. When Google measured how often a streaming recognizer rewrites words it has already put on screen, nearly half of the rewrites weren't the machine hearing anything differently. They were "ok" becoming capital O, capital K, a comma appearing, a numeral turning into a word.
Herman: Forty-seven point six percent, in their on-device study. Capitalisation was about a quarter of all the instability on its own. The other fifty-odd percent is genuine, the model changing its mind about what you said, but the flicker you see is much more cosmetic than it feels.
Corn: Which is a mildly insulting thing to learn about the flicker. I watch a word get rewritten and feel like I've witnessed a drama. It was a capital letter.
Herman: Half the time, yes.
Corn: Daniel's question is about exactly that flicker. When he dictates into Claude Code, his words appear as he speaks, and then earlier words sometimes get corrected once the sentence around them is clear. He asked how that's achieved, what the technique is called, and what is actually happening in the model and on the connection when a word already on screen gets rewritten. He wondered if it was something like stitching, and he believes Deepgram is under the hood.
Herman: The live version has its own vocabulary. Stitching is what you do in batch transcription, cutting a long recording into overlapping pieces and gluing the transcripts back together. What Daniel is watching is interim results, also called partial results, which keep getting revised until they're finalised. As for whose engine is behind it, nobody has said publicly, but I can show you what the program itself gives away, which is a nice bit of detective work.
Corn: Go on. You've been wanting to say "I read the strings" for a day.
Herman: I did read the strings. Version two point one point three three two of the installed program, which is today's. The app captures audio at sixteen kilohertz and streams it over a WebSocket. The destination is Anthropic's own server, not a Deepgram address. The word Deepgram doesn't appear anywhere in the program. The server sends back three kinds of message that I'd describe as interim transcript, final transcript and endpoint.
Corn: So far that's consistent with Anthropic running its own recognizer.
Herman: It is, and then the control vocabulary gets suspicious. There's a keep-alive message to stop the connection timing out, a close-stream message, an endpointing setting in milliseconds, an utterance-end setting in milliseconds, and a list of key terms. Every one of those is a word-for-word match with Deepgram's live streaming API. And the log lines say things like "finalize resolved" and "sending close stream".
Corn: A Deepgram-style protocol. Not a Deepgram receipt.
Herman: Right. The docs say only that audio goes to Anthropic's servers, that you need a claude.ai login, and that it costs no tokens. Not a vendor named anywhere. There's one third-party write-up of an earlier version that says Deepgram sits behind an Anthropic relay, but I haven't been able to check it, and I'd treat it as a rumour with good manners. The overlap could equally be a Deepgram-compatible service or something built in-house that copied a successful interface.
Corn: People copy successful interfaces. It's the only reason anything is called "OpenAI-compatible".
Herman: So: Deepgram-shaped, vendor unconfirmed. Now the interesting part, which is why a word changes at all.
Corn: Because I said it wrong, obviously.
Herman: Because the model decided before it had heard enough. A streaming recognizer has to emit text while you're still talking, which means it commits to a guess about the best word sequence given only the audio so far. It's running a search, a beam, holding several candidate sequences at once, and at any instant it shows you the leader. Then more audio arrives, and a rival that was trailing overtakes it. The leader on screen gets replaced.
Corn: Give me a spoken one, not an abstract one.
Herman: Say you're dictating "parse the JSON file." The first sound is "jay", and in the first half second the leading candidate is the name Jason, because that's a far commoner word in everyday speech. Then you say "file", and now "Jason file" is a bad sentence and "JSON file" is a good one, so the beam flips. The earlier word gets rewritten because of a word that came after it.
Corn: And the same thing with "write a test" starting life as "right a test".
Herman: Exactly that shape. Homophones are the textbook case. Neither word is wrong by sound. Only the following word decides it, and the following word hasn't been spoken yet when the guess goes on screen.
Corn: That's the sound-alike case. What about the cosmetic half you started with?
Herman: Numbers are the cleanest example. You say "twenty-five". The recognizer can write it as words or as digits, and while you're mid-phrase it has no idea which you want. "Twenty" alone is a fine number, so it shows the digits two and zero, and then "five" arrives and the line gets rewritten to twenty-five, or the next word turns out to be "percent" and the whole thing reformats again. Capital letters work the same way: the first word of a sentence gets a capital only once the model is sure it's the start of a sentence.
Corn: So the model heard it right the first time and then reformatted its own homework.
Herman: A lot of the time. And here's a question for you, since you type for a living and I mostly talk. When you watch text move under your eyes, does a changed capital bother you as much as a changed word?
Corn: Less, but it still pulls my eye. A moved word makes me re-read the sentence. A moved capital makes me re-read the sentence to check what moved.
Herman: Which is the design problem in one line. Both cost you attention.
Corn: How does the model leave itself able to change its mind? I'd have guessed it commits word by word and moves on.
Herman: The architectures used for streaming, transducers being the common family, do emit as they go, and the guess is often provisional by construction. Google's work found a nasty extra cause: when the model's outputs are word pieces, fragments smaller than words, it can emit half a word early, and the half-word gets rewritten into a whole different word when the rest of the sound lands. I should be careful, because I don't know what architecture Anthropic's server uses. The principle holds for any streaming recognizer, whichever decoder it is.
Corn: So much for the model. What's on the wire when the rewrite happens? Is the server saying "change word four to JSON"?
Herman: No, and this is the part I like most. There are no edit instructions. Deepgram's own documentation has a worked example, a person reading out a credit card number. Each interim response carries a time span, and each interim restates everything that isn't locked yet, from the start of that span. So the first response covers zero to one point one seconds with "yeah so". The second covers zero to two point two seconds, a longer and revised version of the same stretch. The client simply overwrites whatever it was showing for that span.
Corn: Overwrites. It doesn't diff.
Herman: It doesn't diff. Then at some point a response arrives marked final, and that locks the span. The next interim starts where the locked text ended, at three point two six seconds in their example, and the process starts again from there. The full text is the locked pieces concatenated, plus the current interim tail.
Corn: So the dimmed text in Claude Code is that unlocked tail.
Herman: That's my reading, yes, and it matches the docs: speech appears dimmed until the transcript is finalised. It's a product answer to an unsolvable problem. You can't make the guess stable, so you paint it as provisional and commit when it counts.
Corn: Nothing to do with the tap-to-release thing?
Herman: That's the commit. When you release the key, the client sends a finalise message, which tells the server to stop waiting, process whatever audio it's buffered and treat the interims as final. The response comes back flagged as coming from that request. There's also a log line about promoting an unreported interim to final, and I'm inferring that it means if the server never sends a final for the tail, the client keeps the last interim rather than losing your words. That's my guess from a log string, not something documented.
Corn: Two flags, I seem to remember. Final, and something else.
Herman: Two, and mixing them up drops words. Final means this stretch of audio is locked. Speech-final means the endpointing logic heard a pause and decided you finished a thought. You can get final without speech-final constantly, mid-sentence, because the server locks chunks as it goes. If you only listen for speech-final, you lose text.
Corn: What stops it waiting forever for a pause that never comes? People dictate in one long breath.
Herman: Two separate timers, and they do different jobs. Endpointing is the quick one, a short silence that closes a thought. Utterance end is slower and works from the other side: it measures the gap since the last word that was locked, somewhere between one and five seconds in Deepgram's version, and it fires its own event saying where the last word ended. It needs interim results turned on, because it keys off the interim stream, and interims arrive about once a second, so setting it much lower than that buys you nothing.
Corn: And if the speaker pauses mid-sentence to think, the first timer can end the thought for them.
Herman: Which is the hesitant-speaker problem we covered when we looked at why recognizers cut off people who pause. Different layer, though. That was about deciding the person has finished. This is about whether the words already shown will be kept.
Corn: Daniel could write that on his arm.
Herman: He probably has. Daniel's been fine-tuning ASR for months, so he knows the offline side. The twist is that offline you see the whole recording, and live you never do.
Corn: Is there a dial here? It sounds like you could just make it flicker less.
Herman: There's exactly one dial, and it's latency against stability. Emit later and the guess has heard more, so it changes less. Google's on-device paper measured it. Emitting partials every two hundred milliseconds instead of every fifty cost about seventy-five milliseconds of delay, and for one model it cut unstable words by seventy-one percent. Another approach, a classifier that held back partials it judged likely to change, cut revisions sharply but made the partials arrive about nineteen percent later.
Corn: So the cure for flicker is to be slow.
Herman: Which is a cure my brother is well qualified to recommend.
Corn: I'd have mentioned it myself if I'd had the energy.
Herman: Google Cloud's speech service exposes the dial directly. Each interim result carries a stability score from zero to one. At point nine it's unlikely to change, at point zero one it's very likely to. You could build your own client that only paints the words above some threshold.
Corn: Which is a UI decision. Dimmed text is a threshold of one.
Herman: Dimmed text is a threshold of "everything", all painted, all labelled provisional. It's the lazy and honest option.
Corn: Lazy and honest is most of my personality, so I approve. Now, the nearest thing to what Daniel called stitching.
Herman: Whisper-Streaming. Whisper wasn't built for live use. It wants a window of audio, so the trick is to run it repeatedly on a growing buffer and ask what it's confident about. The rule is called local agreement. You run it on the buffer, run it again after more audio has arrived, and you only emit the longest common prefix of the two outputs. If both runs agree on the first twelve words, those twelve are committed and never touched again. Edits to committed text are ignored.
Corn: Two rival opinions have to match before a word goes on the record.
Herman: And the price is about two chunks of delay, because you can't agree with anything until you've heard it twice. In that paper the average latency was around three point three seconds. It's the overlapping-buffers idea from the batch world, the one we covered when we talked about false starts and chunk seams, except here the overlap is used to decide what to trust rather than how to join.
Corn: Well, it's time for another visit to Dorothy's Kitchen, I believe. Dorothy, are you there?
Dorothy: Hello dear, it's your mother. It's Dorothy's Kitchen again.
Dorothy: Today I am going to show you how to make a glass of tap water. The ingredients are water, from the tap, and a glass. That's it. That's the whole list. I know. I know.
Dorothy: First you take the glass down from the shelf, carefully, because you know what happened last time. Then you turn the tap, slowly, and you wait. You watch it fill. You do not walk away. Timing is everything with water.
Dorothy: And if it goes wrong, and it can go wrong, you start again. I would rather not say how I know that.
Dorothy: Anyway. Have you eaten, sweetheart? Wear a cardigan, it's cold. Ring me back when you can. Bye now.
Corn: Back to the interim business. You said the final text on screen can differ from what streamed. That surprised me.
Herman: It's real. Google's two-pass work from a few years back ran a streaming first pass for the live text, then a second, heavier model that rescored the candidates once the speech was done. The rescoring cut word errors by seventeen to twenty-two percent compared with the streaming model alone. So a system can be built so that the quick draft is deliberately worse than the final answer, and the revision is the second model overruling the first.
Corn: Do you think Claude Code does that?
Herman: I don't know, and I'd be making it up. What I can say is that the protocol allows it. The final message just replaces the interim; it doesn't have to resemble it. What I'd put more weight on is the key terms.
Corn: The project name and the git branch.
Herman: Right, the docs say they're sent automatically as recognition hints, tuned for coding words like regex and OAuth and localhost. That matches the key-terms setting in the program. In Deepgram's version of this feature you pass a list of terms and the model biases toward them at decode time. No retraining, no changed weights. And on the newer model you can swap the list mid-stream.
Corn: So if I'm in a repository called something weird, the weird word is already promoted in the beam before I say it.
Herman: Promoted, not guaranteed. Say it badly and the boost won't save it. That's the "Jason" or "JSON" fight again, except now somebody's put a thumb on the scale for JSON.
Corn: I'd like a thumb on the scale for my own name.
Herman: Let me ask you something, Corn. If you could choose, would you rather see the guesses and watch them move, or see nothing until the model's sure?
Corn: Nothing until it's sure sounds tidy and feels dead. If I speak and the screen stays blank for three seconds, I assume it's broken. I'd take the flicker.
Herman: That's the same trade the engineers make, only they get to put a number on it. Silence feels like failure, so the guess goes up early and wrong, and you get dimmed text instead of a blank box.
Corn: What I want to know is, where does this go next? Deepgram has a model built for voice agents that does the same gamble one level up.
Herman: Yes, the revise-or-commit gamble moved from words to turns. The model streams an update about every quarter second. If you turn on the eager setting, it can fire an early end-of-turn event, "I think she's finished", so the agent can start drafting a reply speculatively. If the speaker carries on, a turn-resumed event fires, the draft is cancelled, and the transcript has changed. Their own quickstart says it makes something like fifty to seventy percent more calls to the language model, which is one source and I'd hold it loosely.
Corn: So the revision isn't free. Somebody pays for the speculation in tokens.
Herman: And in dictation you pay in attention. Words that move make you re-read.
Corn: I'd pay in tokens before I paid in re-reading. The tokens don't have opinions.
Hilbert: Has it ever gone back to its first answer? Mine did, twice, in the last ten minutes, and nobody told me that could happen.
Herman: Nothing I know of stops it. Each interim is a fresh best guess over the unlocked span. It doesn't remember what it showed you, so a later guess can match an earlier one without any special effort.
Hilbert: I tried it while you were on the Whisper business. Mr Okonkwo next door has had his bins out since Tuesday and I wanted to leave a note. I held the key and said "Dear Mr Okonkwo, your bins." It had the name right straight away. Then I said "bins" and it changed him to Oh Kong Quo. Then I said "have been out since Tuesday" and it changed him back.
Corn: Four versions of one man's name for a note about bins.
Hilbert: Three. The first and last were the same. Corn, you'd have enjoyed the middle one, it took its time. I wrote all of them on the back of the gas bill, because I don't trust anything that moves, and I delivered the note by hand in my own writing.
Herman: A rare surname is where the early guess and the later one fight hardest. The model leans toward common words as the sentence builds, and "bins" is a common word that drags the whole phrase around it.
Hilbert: Eleven minutes, start to finish, and the first guess was right. Mr Okonkwo's a good neighbour. He should have his name spelled the way his mother spelled it.
Corn: The revision isn't always an improvement. People forget that, I think, because the screen only ever shows you the latest word, never the one it gave up.
Herman: That's worth building a client around. Keep the previous interim hidden, and if the new one is the old one coming back, you've learned something about how sure the model really was.
Corn: Daniel asked whether this has a name, and it has several. Interim results, finalisation, stability. Stitching is the cousin who works in batch.
Herman: Local agreement is the nearest to what he guessed. And his instinct about the protocol was good even with the vendor open: the server speaks a Deepgram-style dialect, and the design is sound. Lock what you're sure of, show the rest as provisional, overwrite by time span.
Corn: What I'd like to see is a client that holds back the capitalisation pass until finalisation. If half the flicker is cosmetic, it might feel twice as stable without the model changing at all. And a first guess that was right and got talked out of it is worth keeping on screen somewhere.
Herman: A kinder client and a dimmer screen, at no cost to accuracy. Someone should build that. Thank you to Hilbert Flumingtop for producing the show.
Corn: This has been My Weird Prompts.
Herman: You'll find every episode at my weird prompts dot com.
Corn: See you tomorrow.