Behind the scenes: Teaching Coda to say the word you meant
How we gave Rime's highest-quality voice phoneme control in six languages, and why the lexicon mattered more than the model.
Pneumonia.
A healthcare agent, running on Coda, kept getting it wrong. The escalation landed with us, and it wasn't the first word to land in our helpdesk channel. Words with a silent letter, drug names, brand names, and surnames are exactly the words where spelling is a bad guide to sound, and they're exactly the words a caller judges a brand by. An agent that fumbles the name of the thing it's calling about sounds like it doesn't work there, and on high-stakes calls, trust erodes quickly.
On Coda v1 we had two fixes, and to be perfectly honest, both were bad. A builder could respell the word in their own text and hope some spelling landed close. But a respelling is still spelling, so some sounds stay out of reach, and the model still guesses. Or they could ask us for a rewrite rule, which applied to every customer on the platform and shipped with the next release. This is slow and not an ideal fix.
Coda v2 replaces both with a custom lexicon sent on the request:
"customLexicon": [
{ "spelling": "pneumonia", "pronunciation": "n U . \" m oU . n j @" }
]
The pronunciation is X-SAMPA, the International Phonetic Alphabet written in keyboard characters. The entry applies to that customer's requests and nobody else's, to every occurrence of the word, in English, German, Spanish, French, Italian, or Portuguese, up to 500 entries per request. A builder who doesn't want to write X-SAMPA records the word instead, and a speech-to-phoneme model running in their browser writes it for them.
This piece is about how that works and the linguistics underneath it.
The obvious design is the wrong one
The obvious way to give a model phoneme control is to convert every word to phonemes before synthesis. Most text-to-speech systems of the last two decades worked this way: a grapheme-to-phoneme step in front, a model that only ever sees phonemes behind it.
For a model like Coda, that throws away the thing it's best at. Coda was pretrained on text. Everything it knows about meaning, rhythm, emphasis, and how words sound next to each other, it learned from spelling. Convert the whole sentence to phonemes and you lose that prior, you inherit every grapheme-to-phoneme mistake on words the model was already reading correctly, you need a converter that's right for every word in six languages, and you're feeding the model an input it was never trained on.
The skeptic's version: you can have the model's natural prosody, or you can have control over the sounds, but not both.
We think you can, if only the target word changes.
Custom words in phonemes, the rest in text

Only the words you include in the custom lexicon change. Everything else in the sentence goes through the same text processing as before, so numbers, dates, and web addresses read just as they did before you added an entry. Wherever one of your words appears, its letters are swapped for its phonemes just before the text reaches Coda.
That holds even when the word is inside something else. Add “livekit” to your custom lexicon and send "Visit us at www.livekit.com": the address is still read as an address, and only livekit is pronounced with your custom pronunciation. You never trade control of one word for everything Coda does with the rest of the sentence.
Training works the same way. A word in the sentence is swapped for its phonemes, the rest of the sentence stays as written, and the model learns the phoneme span as a second spelling of the same thing, in the same sentence, with prosody, punctuation, and voice still coming from text.
The cost of that on plain text was nothing we could measure. Early in training, the phoneme-trained model had a word error rate of 9.1% against 14.1% for the base model on the same six languages, with naturalness flat and speaker similarity within 0.04.
One thing surprised us: the model picked up the new phoneme tokens quickly. Nearly all of the training work after that was about widening coverage and keeping the model's naturalness intact.
Which raises the skeptic's second question. The model has seen some tens of thousands of words as phonemes. Your brand name isn't one of them. Why should it read a new one right?
Why it works on a word it's never seen
Because phonological knowledge is generative. A finite inventory of sounds and a finite set of syllable shapes produce an unbounded set of possible words. A native English speaker can say a surname they have never heard because it's built from known units in known structures. The model is in the same position: a new word is a new sequence of that language's phonemes (each language uses a small set, from 24 in Spanish to 43 in German), in syllable shapes the model has already heard thousands of times.
That only holds if the training data has three properties, and those three properties are what the lexicon work was for. This is the part of the project that looked least like machine learning and mattered most.
Phonemes, not allophones
A language's contrasts are between phonemes. Allophones are the predictable variants: the [tʰ] in top, the [t] in stop, and the flap [ɾ] in water are all English /t/, and which one you get follows from context. The six source dictionaries we started from write 229 distinct symbols between them. We folded those to 73 phonemes. Without that step, the same sound shows up under several symbols depending on how narrowly each dictionary transcribes, each symbol is seen less often, the model learns none of them well, and a customer would have to know which variant to write.
Well-formed entries only
Every language constrains which sounds combine and where. English allows blick but never bnick, and every English word carries exactly one primary stress. In training, a replaced word's phonemes are paired with audio, so the model learns what a phoneme or a stress mark sounds like only when the transcription is faithful to the recording. An entry with a stressed schwa, an impossible cluster, or no stress at all is one where input and audio disagree. Enough of those and the marks become noise. So we admit only entries that pass a well-formedness parser, and the same parser checks every customer request at inference. What the model is asked to read looks like what it was trained on.
Every phoneme in every position
A phoneme's sound depends on where it sits in the syllable. English /t/ is aspirated at the start of a stressed syllable, flapped between vowels, and often a glottal stop at the end of a word. To produce all three, the model has to hear /t/ in all three positions, and the same goes for every phoneme in every language. Training words picked at random over-represent common sounds in common positions. The rare combinations are exactly where customers need help, because names, brands, and loanwords are where unusual combinations occur, which is also why spelling fails on them. So we choose which words become phonemes in training for the rare syllable shapes they add, and every entry carries its syllable boundaries and stress marks so the model learns where each sound is anchored.
The union of the six inventories is 73 phonemes. Add a syllable boundary, two stress marks, and two span delimiters and you get the 78 tokens we added to Coda's vocabulary. New tokens mean a new model, which is why this is Coda v2 rather than a point release on v1.
We picked sources for consistency rather than size. A model learns what a symbol sounds like only if it means the same sound in every entry, and learns stress only if every entry in a language with lexical stress marks it. For English, that meant LDC PRONLEX over the more common CMUdict, because it keeps distinctions like cot-caught the same way in every word.
A bad entry gets a 400 on purpose
Send a pronunciation that fails the parser and the whole request comes back with a 400 that names the entry and the check it failed.

Why not opt for a silent repair? A silent repair replaces what you wrote with our guess, and you hear the difference on a live call without knowing why. An ill-formed pronunciation is one the model was never trained on, so it's unlikely to come out as intended, and we'd rather tell you that than guess at what you meant. The error is immediate feedback: fix it before it reaches production.
It also keeps success meaningful. If a request succeeds, every pronunciation in it is well-formed and matches the training distribution, so we have high confidence the phoneme control is in effect. A success that might mean "we changed your input" isn't a success.
French gets one check of its own: French has no lexical stress, so a stress mark in a French entry is itself an error.
Record the word instead of typing it
The word that needs fixing is, by definition, the word a text-to-phoneme system got wrong. It's out of every dictionary, or foreign, or a brand, or a name. Asking a grapheme-to-phoneme model to guess again is asking the system that just failed to retry. Asking a builder to type X-SAMPA is asking them to learn a notation, and our conventions on top of it.
Recording gives us the intended pronunciation in the builder's own mouth. The speech-to-phoneme model's job is to fold what was said into our phonemic conventions and hand back a legal entry.

The model is a pretrained speech encoder, trained on 4.5 million hours of audio, with a CTC head that outputs X-SAMPA. It didn't need much to converge. The first version was English only, trained on about 65 hours of public audio run through our lexicon, and reached 1.31% phone error rate on the dev set. Later versions added the six-language inventory and more data, up to 1,240 hours for the version that ships. One checkpoint serves all six languages.
The single-word problem
Builders say one word. The model was trained on sentences. Our second version had never seen an isolated word, and on 1,768 held-out single-word clips it scored 34.9% phone error rate and got 33.9% of words exactly right. It also needed padded silence on both sides to work at all. The third version added an isolated-word training stream, a consistency loss between two augmented views of the same clip, and random leading and trailing silence. Phone error rate fell from 34.9% to 9.0%, and exact-word accuracy rose from 33.9% to 75.3%. The padding stopped mattering.
Linguistically legal decoding
CTC is non-autoregressive, so nothing in the architecture stops it from emitting two primary stresses in one word, or an onset the language doesn't allow. On 400 real English recordings, plain argmax decoding produces an ill-formed sequence 7.2% of the time. So we don't take the argmax. We run a beam search over the possible CTC paths, ranked by probability, syllabify each candidate, and run them in order through the same well-formedness parser that gates the serving path. The first legal candidate wins; if none is legal, we fall back to argmax, so the constraint is never worse than no constraint. It repairs 86% of the ill-formed outputs, taking validity from about 93% to about 99%. The cost is milliseconds.
Why the small model lost
We tried a 73-million-parameter student, about 100 MB, because it ran at 26 ms per word in a browser before we'd trained it. Distilled from the full model, it didn't match it on isolated words, and isolated words are the product. Int8 quantization of the full model turned out to be lossless on that metric (9.9% against 10.0%), so the full model ships: 813 MB, cached once, running on WebGPU with a WASM fallback. The browser build agrees with the server model on about 99% of phones.
Against ZIPA
The fair comparison is the one biased against us, so that's the one we ran. On the FLEURS test set, across the five languages both systems cover, using ZIPA's own labels as the reference: ours 18.7% feature error rate and 23.4% phone error rate, ZIPA 24.6% and 26.1%. Every place our lexicon disagrees with their conventions counts as our error. ZIPA covers far more languages than we do; we're ahead where the languages are shared.
How to read the numbers
The headline: on hard English words that appear in none of Coda's training dictionaries, phoneme input scores a 16.7% phone error rate against 24.5% for the same words written as text, with the same model and the same judge. Across all six languages on the shipping checkpoint, it's 17.6% against 22.3%. Call it a 20 to 50% reduction in phone errors, depending on the set.
A skeptical engineer should ask what 17% means, and the answer is that it contains the judge's own error. This is a phone error rate measured by our speech-to-phoneme recognizer listening to synthetic speech, so the recognizer's mistakes are in the number. Its floor on identical audio is 10.4%. Of the 17% on hard words, roughly 7 points is the synthesizer. That's why we always report the text baseline next to it: the relative gap is the clean claim. And 40 to 50% of the English misses are one phonological feature off, a vowel one step away or a voicing difference, which a listener often doesn't hear as wrong.
Nothing else got worse
Adding phoneme control to a model is only interesting if the model still sounds like itself afterward. Against Coda 1.0.5, the previous release, the shipping checkpoint is ahead on speaker similarity (0.9525 against 0.9481) and on all three naturalness judges we run (UTMOS 3.811 against 3.758). We'll note that the three naturalness judges rank every system identically, so they're not independent evidence, and we treat a paired listening test as the real instrument.
The four languages without a lexicon held their ground as well. Our first phoneme run drifted on them; the shipping run does not.
How this compares
Pronunciation dictionaries aren't new. Most text-to-speech APIs offer some way to override a word, and we went through the public documentation of five of them before writing this. The differences are in three places: what happens when an entry is wrong, how many languages the control actually covers, and whether a builder has to write phonetic notation by hand.
Two of those cells are the ones we'd point a builder at. Silent fallback means a dictionary that works on one model and quietly stops working on another, and a builder finds out from a caller. And English-only phoneme input means a German or Spanish deployment gets no control at all.
The models priced and marketed for agents either can't do this or do it in one language: Turbo v2.5 has no phoneme control, reading inline IPA as text, and Turbo v2 and Flash v2 honor phoneme tags in English only. Coda does it in six languages at agent latency.
The part we think is hardest to copy isn't the model. It's the lexicons. Six languages of consistent phonemic transcription, with stress and syllable boundaries added by rule and every entry checked for well-formedness, is what made the model learnable in the first place. We considered taking the raw dictionaries as they came, and a model trained on symbols that mean different sounds in different entries learns none of them well.
Find out if your difficult words are covered, and if not, add it to your custom lexicon through our audio to phoneme feature in the Rime dashboard. You can get started for free today.