ASR token-level timestamps: interpret subword intervals
A token-level timestamp pairs each token produced by a speech recognizer with a start and end time. A token is a unit in a model's vocabulary, so it is not always a word: one word may be split into several subword tokens, while a character-based model may produce intervals for individual character units. Treating token times as word boundaries, or comparing timestamps from different models directly, can therefore be misleading.
ASR token-level timestamps: interpret subword intervals
A token-level timestamp pairs each token produced by a speech recognizer with a start and end time. A token is a unit in a model's vocabulary, so it is not always a word: one word may be split into several subword tokens, while a character-based model may produce intervals for individual character units. Treating token times as word boundaries, or comparing timestamps from different models directly, can therefore be misleading.
How are token times produced?
CTC-based forced alignment matches an existing transcript to a model's frame-level audio output. The alignment algorithm handles repeated emissions and blank frames to find which frame span corresponds to each transcript token; consecutive spans with the same label may then be merged. The torchaudio 2.5.0 tutorial's merge_tokens() creates a TokenSpan for each transcript token, containing its start and end frame and a score. These values are frame indices first. To convert them to seconds, you need that model's frame stride and the audio's start offset. torchaudio CTC forced alignment tutorial, 2.5.0
Not every ASR system outputs a timestamp token for each text token. For example, Whisper's default result provides segment-level start and end times. When word_timestamps is enabled, a separate alignment step groups the emitted text tokens into word intervals against the audio. The cited version's implementation uses cross-attention patterns and dynamic time warping; it also has language-dependent paths that split tokens into word groups using spaces or Unicode boundaries. This behavior depends on the model and tokenizer, so identical boundaries are not guaranteed across languages or models. OpenAI Whisper v20240930 transcribe.py · Whisper tokenizer.py
Why token times differ from word times
If an English word is split into model tokens such as play and ##back, each token interval may cover only part of the word. In languages without spaces, token boundaries may instead represent morphemes or character fragments, making word timestamps difficult to derive without language-specific segmentation rules. A space or punctuation token may also have no one-to-one match with an audible sound.
A timestamp is an interval selected by an aligner. It is not a perfect measurement of the physical point where a phoneme begins or ends. Boundaries can vary with frame stride, the distribution of CTC blank frames, cross-attention patterns, transcript normalization, and how silence is handled. An aligner does not independently determine whether the transcript is correct, so it can produce plausible-looking intervals for incorrect text. The existing forced alignment guide explains the general process of matching a transcript to audio; this article focuses on interpreting the output units and their times.
A safe workflow for using token intervals
**Record the units and versions.** Store the model, decoder, and tokenizer versions; language; audio sample rate; time reference (whole file or chunk); and whether the output represents tokens, words, or segments.
**Convert time coordinates to seconds.** If CTC alignment returns frame indices, convert them using the model's frame stride and add the chunk's start offset when processing a cropped recording. Do not infer the stride from the sample rate or token count.
**Group tokens into words only when needed.** Preserve the original token boundaries and token-to-character mapping. For word-level tasks, merge adjacent tokens using the same tokenizer's boundary rules, then document how spaces, punctuation, and compounds are handled.
**Sample-check boundary error.** Prepare human-labeled boundaries for speech that covers varied speakers and acoustic conditions, then compare token or word starts and ends. Report the share within a chosen tolerance or the mean/median absolute error, and state both the tolerance and the boundary convention.
**Separate transcript errors from alignment errors.** First verify that the recognized words are correct, then evaluate their timing. Flag intervals containing incorrect words for human listening and review the result against its intended use, such as captions, search, or speaker-level analysis.
If your analysis needs word times, check whether the model actually emits word-level output or whether token/frame alignments are post-processed into words. Recording that distinction helps explain why the same audio may receive different boundaries when processed with another model or version.
References
[PyTorch torchaudio, CTC forced alignment API tutorial (2.5.0)](https://docs.pytorch.org/audio/2.5.0/tutorials/ctc_forced_alignment_api_tutorial.html)
[OpenAI Whisper v20240930, `transcribe.py`](https://github.com/openai/whisper/blob/v20240930/whisper/transcribe.py)
[OpenAI Whisper v20240930, `tokenizer.py`](https://github.com/openai/whisper/blob/v20240930/whisper/tokenizer.py)