Weighted finite-state transducers (WFSTs): how ASR graphs work
A weighted finite-state transducer maps input symbols to output symbols while assigning costs or probabilities to paths. Learn how WFSTs combine acoustic, pronunciation, and language components in speech recognition, and what graph optimization can and cannot do.
Weighted finite-state transducers (WFSTs): how ASR graphs work
A weighted finite-state transducer (WFST) is a finite-state machine that maps an input symbol sequence to an output sequence and assigns a cost or probability to each path. In speech recognition, it provides common graph operations for connecting acoustic states, phone context, pronunciation lexicons, and language models. A WFST is not the name of one speech recognizer; it is a computational framework for representing and combining components.
What do states, labels, and weights mean?
A state represents the context processed so far. Each transition has input and output labels and a weight. A path from the start state to a final state represents one candidate mapping from input to output. Weights accumulate along paths to compare candidates. In a probability formulation, path probabilities multiply; in a log-cost decoder, costs add and the decoder can seek a low-cost path. The exact operations depend on the weight algebra (semiring) and implementation.
Imagine a toy pronunciation transducer mapping the phone sequence /k æ t/ to the word “cat,” with different costs for alternative pronunciations or words. This is only an illustration; it does not specify a real dictionary’s notation or weights.
How does ASR combine the pieces?
A traditional static Kaldi decoding graph is conceptually described as the composition H ○ C ○ L ○ G.
| Component | Mapping | In plain terms |
|---|---|---|
| H | HMM states/transitions and context-dependent phones | State sequences used by the acoustic model |
| C | Context-dependent phones and base phones | Phone units conditioned on neighboring phones |
| L | Phone sequences and words | Pronunciation lexicon |
| G | Word sequences and grammar/language-model weights | Which word sequences are plausible |
Composition connects one transducer’s output labels with the next transducer’s input labels. The decoder searches the resulting graph alongside audio frames for a low-cost word path. Real systems also handle implementation details such as disambiguation symbols, epsilon transitions, and the scale of graph versus acoustic costs; the HCLG notation alone does not describe the full build procedure.
Why optimize the graph, and what should you check?
**Composition** joins pronunciation, context, and language-model relations.
**Determinization** removes redundant paths for the same input when applicable.
**Minimization** merges states with equivalent future behavior to reduce graph size.
**Weight pushing** can redistribute costs across transitions while preserving path totals; implementations do not all use the same recipe.
Optimization can improve decoding speed or memory use, but it does not automatically fix a faulty language model or pronunciation lexicon. Check symbol-table mismatches, missing pronunciations, incorrect weight scales, epsilon/disambiguation handling, and graph-size growth. After building a graph, verify symbol compatibility and valid paths with small examples, then measure WER and resource use on representative evaluation data.
WFST decoding is especially useful when components can be represented with finite-state operations. Graph construction can become complex or large, and neural calculations that do not fit the WFST representation may need separate scoring or on-the-fly integration.
References
[Mohri, Pereira & Riley, Speech Recognition with Weighted Finite-State Transducers (2008 chapter)](https://cs.nyu.edu/~mohri/postscript/hbka.pdf)
[Kaldi, Decoding graph construction](https://kaldi-asr.org/doc/graph.html)
[Riley, Allauzen & Jansche, OpenFst: An Open-Source, Weighted Finite-State Transducer Library and its Applications to Speech and Language (NAACL HLT 2009)](https://research.google/pubs/openfst-an-open-source-weighted-finite-state-transducer-library-and-its-applications-to-speech-and-language/)