Grapheme-to-phoneme conversion (G2P) is the task of predicting the pronunciation of a written word as a sequence of phonemes, the abstract sound units of a language. In Speech & language AI, G2P sits at the front of text-to-speech pipelines and supplies pronunciations to speech recognition lexicons, so any error it makes becomes an audible mispronunciation or a missed word.
The difficulty depends on the orthographic depth of a language. Finnish and Spanish spell almost as they sound, while English, French and Danish have many irregular spellings, silent letters and borrowed words. A single English letter sequence such as “ough” maps to at least five different sounds, which is why purely rule-based conversion fails for English and why modern systems combine dictionaries with learned models.
How grapheme-to-phoneme conversion works
A G2P system takes a normalized word as input and outputs a phoneme string, usually in an inventory such as the International Phonetic Alphabet (IPA) or a machine-friendly set such as ARPAbet for American English. Input normally arrives after text normalization, which has already expanded numbers, abbreviations and symbols into ordinary words.
Production systems rarely rely on one method. The typical design is a lexicon-first cascade: the word is looked up in a curated pronunciation dictionary, and only out-of-vocabulary words such as new names, brands, typos and rare compounds are passed to a statistical or neural model. The following table shows the main stages and what each one contributes.
| Stage | Input | Output | Main purpose |
|---|---|---|---|
| Text normalization | Raw text with digits and symbols | Spoken-form words | Remove non-word tokens |
| Lexicon lookup | Normalized word | Known pronunciation | Exact answers for common words |
| Homograph resolution | Word plus sentence context | Selected variant | Choose between spellings with several readings |
| Model prediction | Unknown word | Predicted phonemes | Cover out-of-vocabulary words |
| Post-lexical rules | Phonemes in sequence | Connected-speech form | Apply reduction, linking and stress shifts |
Stress and syllable boundaries are often predicted together with the phonemes, because lexical stress changes vowel quality in English and is essential for natural prosody later in the pipeline.
Approaches and model families
G2P methods have evolved from hand-written rewrite rules through joint-sequence models to neural sequence-to-sequence models. Each family still has a role, because accuracy, data needs and controllability differ sharply between them.
| Approach | Training data | Strengths | Weaknesses |
|---|---|---|---|
| Rule-based systems | None, expert-written rules | Transparent, predictable | Poor coverage of irregular spellings |
| Joint-sequence models | Aligned dictionary entries | Robust with small lexicons | Limited context window |
| WFST-based models | Aligned dictionary entries | Fast, easy to combine with rules | Feature engineering required |
| Neural seq2seq models | Tens of thousands of entries | Highest accuracy on irregular words | Can hallucinate implausible output |
| Multilingual neural models | Lexicons from many languages | Transfer to low-resource languages | Quality varies by script |
Joint-sequence models learn graphones, paired units of letters and phonemes, from aligned dictionaries and decode them with an n-gram model. Neural approaches use encoder-decoder transformers or recurrent networks that read the whole spelling and generate phonemes one at a time, which captures long-range spelling cues such as the silent final “e” in English.
Some recent end-to-end speech synthesis models skip explicit G2P and learn pronunciation from characters directly. In practice, most commercial systems still keep an explicit phoneme layer, because it allows engineers to correct pronunciations without retraining the acoustic model.
Measuring G2P accuracy
G2P quality is measured mainly with word error rate, the share of words whose predicted pronunciation differs from the reference in any phoneme, and phoneme error rate, the edit distance between predicted and reference phoneme strings divided by reference length. Both are computed on a held-out portion of the lexicon, which must not share words with the training set.
| Metric | What it counts | Typical use |
|---|---|---|
| Word error rate | Words with at least one wrong phoneme | Headline comparison of systems |
| Phoneme error rate | Insertions, deletions and substitutions | Fine-grained error analysis |
| Stress accuracy | Correctly placed primary stress | Prosody-sensitive synthesis |
| Listening tests | Errors judged audible by people | Final product validation |
Reported English word error rates for strong neural models on standard dictionaries usually fall in the low twenty percent range or below, depending on the lexicon and whether stress is scored. Shallow orthographies reach near-perfect accuracy with simple rules. Numbers are only comparable when the same lexicon, split and phoneme set are used, because dictionaries disagree on many entries.
Where G2P fits among related speech technologies
G2P is a component technology rather than an end product. It feeds text-to-speech, where it determines what the neural vocoder eventually pronounces, and it expands speech-to-text lexicons so that an acoustic model can recognize words it never saw in training transcripts.
- Text normalization runs before G2P and decides which words exist; G2P then decides how they sound.
- Prosody prediction runs after G2P and uses its stress and syllable marks to shape pitch and timing.
- SSML lets authors bypass G2P with explicit phoneme tags for names and technical terms.
- Phoneme-to-grapheme conversion is the inverse task, used for spelling unknown spoken words in recognition output.
Limitations and common failure modes
Most G2P errors cluster around a few predictable categories. Knowing them helps teams decide where manual lexicon entries pay off and where a model is good enough.
| Failure | Example | Cause | Remedy |
|---|---|---|---|
| Homographs | “read”, “lead”, “wind” | Spelling ignores tense or meaning | Context-aware disambiguation |
| Proper names | Surnames, places | Origin-specific spelling rules | Custom lexicon entries |
| Loanwords | “genre”, “chorizo” | Source-language pronunciation | Language-origin tagging |
| Acronyms | “NASA” versus “FBI” | Read as word or letter by letter | Normalization rules and lists |
| Dialect mismatch | “tomato”, “schedule” | Lexicon built for another accent | Accent-specific lexicons |
A frequent mistake is to treat a single dictionary as ground truth. Pronunciations vary by accent and speaking style, and a model trained on one variety will sound wrong to listeners of another. Another risk is silent regression: retraining a neural G2P model can fix rare words while breaking common ones, so teams should freeze high-frequency entries in the lexicon.
Put simply
Grapheme-to-phoneme conversion is how a computer works out how a written word should sound. Letters do not always tell you the sound. In English, “through”, “tough” and “though” look similar but rhyme with nothing in common.
A G2P system works like a careful reader with a pronunciation dictionary. It first checks the dictionary, and when a word is missing, it makes an educated guess based on spelling patterns it has learned. The result is a list of speech sounds that a talking app can actually say. Good G2P is why a voice assistant says names correctly.
In practice
A navigation app team prepares a new voice for a country with thousands of regional place names absent from its standard dictionary. Early test drives reveal that the synthetic voice mispronounces roughly one street name in eight, which drivers find distracting and sometimes confusing.
The team extracts every street and town name from the map database, runs them through a neural G2P model, and sends the 2,000 lowest-confidence predictions to a linguist for review. Corrected entries go into a custom lexicon that the speech engine checks before the model. After the update, listening tests on a random sample show that audible mispronunciations drop sharply, and drivers stop reporting street names as wrong.