Label-Looping: Highly Efficient Decoding for Transducers
Paper · 2024 · Vladimir Bataev, Hainan Xu, Daniel Galvez et al.
Summary
A speech recognizer that processes several recordings together can spend time waiting for the slowest recording at each step. In a Transducer, one recording may be ready to move on from a short stretch of audio while another still has several text tokens to emit from the corresponding part of its own audio. A conventional batched decoder makes them advance together. This paper reorganizes greedy decoding, the process of choosing the most probable next symbol at each step, so that recordings can move through audio independently while still sharing the work of updating their transcript histories. Speech & spoken language
The authors call the method label-looping. A Transducer can emit a text token or a special blank that leaves the transcript unchanged. Instead of completing all emissions at one audio frame before advancing the batch, label-looping searches across frames for the next text token in each recording. Each recording can start that search from a different frame and travel a different distance. A recording that finds a token waits at that point while the search continues elsewhere in the batch. The decoder can then update the text-history predictor for those newly emitted tokens together. The authors also store the growing transcripts, timestamps and scores in GPU tensors, which lets the implementation handle updates across recordings in parallel. GPU & parallel computing
On LibriSpeech test-other, the paper reports a total-runtime speedup of 2.0X for conventional recurrent neural network Transducers, or RNN-Ts, and 2.1X for Token-and-Duration Transducers at batch size 32. The gains are larger when timing excludes the audio encoder. The duration-aware system can advance through multiple frames following a prediction, and the new decoder uses the duration predicted for each recording. Its timing baseline uses a shared advance and can produce variable recognition outputs, so that comparison measures runtime against an approximate procedure. The authors also show that label-looping can be combined separately with TorchScript and CUDA Graphs. They release the decoder through NeMo. NeMo
Deep dive: Label-Looping: Highly Efficient Decoding for Transducers
Label-looping speeds up greedy speech recognition by batching transcript updates and letting each recording advance through audio frames at its own pace. · about 31 minutes to read
The problem and its context
Why time and text advance separately
A Transducer takes in audio and produces text, but the two sequences have different boundaries. The encoder processes the recording and supplies a sequence of vectors, called frames, for the decoder. A frame represents part of the encoded audio. A token represents part of the transcription. The decoder can get through a frame without writing anything, and it can write several tokens before it leaves another frame. Consequently, neither the number of tokens already emitted nor the frame currently being inspected tells the decoder where it stands on the other sequence. Both positions matter to the next prediction.
The paper situates Transducers alongside connectionist temporal classification, or CTC. Both recognize speech from a sequence of frames and use a special blank symbol to accommodate the mismatch between the lengths of the audio and the transcription. CTC makes a conditional independence assumption for token predictions at different frames. A Transducer conditions its next prediction on the text it has emitted so far as well as the encoded audio. The paper presents that access to text history as a source of better recognition accuracy, with some extra computation. The history is also where the opportunity for label-looping arises. Several predictions can inspect different parts of the audio while referring to the same text prefix. Sequence Transduction with Recurrent Neural Networks
The architecture distributes this work across an encoder, a prediction network and a joiner. The encoder supplies the audio representation. The prediction network, or predictor, supplies a representation of the sequence of tokens chosen so far. The joiner combines both representations and gives the decoder a distribution over the output vocabulary, which includes the blank. After the joiner chooses a blank, the decoder moves forward in the audio and can keep using the same predictor output. After a text token, the transcript has grown and the predictor must incorporate that token. In an ordinary Transducer, the decoder remains on the current audio frame at that point, which gives the system the chance to emit another token there.
Greedy decoding follows a single chain of these decisions for each recording. At each step it chooses the highest-scoring symbol available under the current audio position and history. Beam search, by comparison, maintains several candidate transcripts and can spend work on their alternative continuations. The authors focus on improving greedy search because, in their account of prior work, it offers a favorable speed and accuracy tradeoff when the recognizer has been trained on enough data from the relevant domain. Their problem is therefore how to execute the same kind of local decisions efficiently for many recordings at once.
What a shared frame index costs
For a single recording, an ordinary frame-based decoder can stay on a frame until it emits a blank and then advance. A batch implementation can express the same idea with a shared frame index. It processes the recordings at that index until each has finished its emissions there. This gives the batch a simple rule for choosing the next frame. It also couples the schedules of recordings whose speech and partial transcripts are otherwise independent.
Imagine that a recording reaches a blank promptly, while another still needs more text tokens from the current frame. The first recording has all the information it needs to inspect the next frame. Under a shared frame index, it must wait for the other recording. A different member of the batch can cause the delay at the next frame. Even recordings with equal encoded lengths can incur these waits, because the distribution of token emissions across their frames can differ. The paper uses equal audio lengths to simplify its presentation of conventional decoding and notes that a working decoder also has to check where each recording ends.
The baseline schedule also affects predictor computation. In the conventional implementation described in the paper, a round of work can contain a mixture of text emissions and blanks. The decoder selectively keeps updated predictor state and output where a text token justifies the change. Some of the computation therefore produces values that the decoder discards. A separate source of overhead is how the implementation records the results. The conventional procedure walks through the batch in a loop to decide which partial transcriptions need updating. The shared frame schedule, selective predictor updates and sequential bookkeeping are distinct costs, even though all three arise in the same implementation.
These costs matter in batched inference because putting recordings together is supposed to make better use of parallel computation. A batch can have a large nominal size while only some rows can use a particular operation's result. Making an individual calculation cheaper can help, but the schedule also determines how many times the calculation runs and how much of the batch can make use of it. Label-looping addresses that schedule by asking what work several recordings are likely to be ready for together.
How earlier work reduced decoding work
The authors describe several ways previous research made Transducers more efficient. Some work changed the encoder. The paper cites Transformer and Conformer encoders as replacements for the earlier recurrent encoders based on long short-term memory, or LSTM, networks, and describes these replacements as improvements in both efficiency and recognition accuracy. Other work changed the predictor itself. The paper reports that replacing an LSTM predictor with a stateless network accelerated execution with a small recognition penalty. A stateful predictor carries a recurrent state forward through the recognized text, while a stateless one avoids that recurrent state. Both still supply the joiner with text context. Transformer and attention · Attention Is All You Need · Conformer
Other approaches changed how quickly the decoder can cross the audio. Multi-blank Transducers introduce special blanks that permit a jump over several frames. Token-and-Duration Transducers, or TDTs, make duration a separate prediction. With that separation, a decoder can advance after emitting a text token as well as after emitting a blank, and the advance can span several frames. The paper also describes earlier work that used CTC to anticipate blanks for a Transducer. Each technique changes how much work the decoder has to do along the time axis.
A further line of work changes how the search expands. The paper describes a method that constrained how many labels could be emitted per frame, and several beam-search methods that changed how candidate paths were expanded. Label-looping addresses a different part of inference. It changes when the operations for independent recordings are batched together. The trained recognizer still supplies the probabilities for greedy selection. That distinction explains why the same scheduling idea can apply both to ordinary Transducers and to ones that predict durations.
The method, step by step
Start from the current audio and the current transcript
Consider what the joiner needs to make one decision. It needs an encoder representation for the current frame and a predictor representation for the current transcript prefix. The prefix is the ordered sequence of text tokens accepted so far. At the beginning of decoding the prefix is empty. Later, it is the recognizer's own partial output. Every time the decoder asks for another decision, it must supply the audio position and text context belonging to the same recording.
The blank is what lets the decoder separate those two inputs. When the selected symbol is blank, the transcript stays as it was. The predictor representation used for that decision is still valid for a new decision at a later frame. The joiner can keep the text-side input and take a new audio-side input. When the selected symbol is a text token, the prefix changes. The decoder records the token and prepares a new predictor representation before it asks the joiner what should follow.
The time update for an ordinary Transducer can be written as two cases. For a blank, it is:
t′ = t + 1
Here t is the current encoder frame index and t′ is the index after the emission. The 1 is the advance by one frame after a blank, and = gives the value assigned to the new index.
For a text token, the time update is:
t′ = t
Here t again denotes the current frame index, t′ is the resulting frame index, and = means they have the same value. The decoder adds the selected token to the transcript on this branch. Holding the frame index permits a subsequent decision at the same frame, this time with the updated text history.
Seen from the text side, the interval between two accepted tokens consists of whatever blank steps the decoder needs to take before it reaches the next text emission. That interval can be empty if the next decision at the same frame is a text token. It can also consume all the remaining audio if the recognizer produces only blanks to the end. The predictor representation stays fixed throughout the search for a text token. The audio input to the joiner changes each time a blank advances the frame index.
Change which loop contains the search
The conventional frame-looping schedule makes frames the outer unit of work. At a shared frame, the inner loop keeps making decisions while some recordings still need to emit text there. Label-looping makes the next transcript token the outer unit of work. Its inner loop searches through the audio for that token. Recordings keep their own frame indices, so rows in the same operation can consult different frames. They can also have different distances to travel before they emit a token.
An outer iteration begins with predictor output for the current text prefixes. The joiner examines the corresponding audio positions. For each recording still searching, a blank advances its position so that the joiner can examine the next frame. A text token completes that recording's search for the current iteration. Its output can be recorded, and its next decision waits until the predictor can use the new history. A recording that reaches the end of its encoded audio also leaves the current search. The inner loop continues for the recordings that still have audio and still need to find their next token.
Once that inner search finishes, the decoder can start another round with the new histories where tokens were found. The useful outputs of the round have a common role: each extends its own recording by the next token. The word chosen in one row can be unrelated to the word chosen in the next. The recordings need neither a shared vocabulary choice nor a shared timestamp. They are aligned by the stage of transcript generation at which they need the predictor. The process ends when there is no recording left to decode.
Greedy decoding when the batch advances by labels
The steps in order.
The schedule requires two distinct tests during the inner loop. One is whether a recording has already found a token in this round. If so, the search must keep that result while other rows catch up. The other is whether a recording has reached its last usable frame. A row that runs out of frames stops participating even if it has produced no token in the current round. The masks implementing these tests allow the batch to carry rows with different search states and different audio lengths. They also keep a row that has already found its token from acquiring another token before its predictor is updated.
This distinction helps explain what is meant by swapping the loops. The new order arranges evaluation across the batch, while each individual recording still follows its own sequence of greedy decisions. A joiner evaluation uses that recording's current frame and predictor output. A blank changes the frame used for its next evaluation. A text token changes its history before the next evaluation. An utterance can wait for other utterances between operations without changing either input to its own next decision. That is how the decoder can use a different batch schedule and still execute the same greedy procedure.
Read the change in the paper’s example
The paper illustrates the schedule with a batch whose two transcriptions are CAT and DOG. In the illustrated alignment, CAT begins with C before taking a blank. It crosses more audio with another blank before finding A and then T on the same frame. DOG starts with a blank and finds D later than the first recording finds C. It then crosses frames with blanks before finding O and G together at a later frame. The blank symbols mark advancement through audio. The visible letters mark emissions that extend the text prefix.
Under frame-looping, the first frame contains a text emission for CAT and a blank for DOG. DOG is already ready to examine another frame, but the batch still has to finish with CAT at the current frame. When the batch reaches the point where DOG emits D, CAT can be the recording waiting to move on. Later, CAT can emit A and T while DOG still needs to advance in the audio to reach its remaining text emissions. The example makes the source of the wait visible without relying on differences in total audio length.
Under label-looping, the first search groups together finding C and finding D. C can be saved while the other row advances through its initial blank to get to D. The next round uses the histories ending in C and D and looks for A and O. A and O also come from different audio positions. The following round finds T and G, with each recording still able to use the frame that supplied its previous token. Trailing blanks can then finish the audio traversal. At every stage the blank steps belong to the recording that took them. The useful predictor computation groups emissions by how far the individual transcripts have grown.
The difference is especially clear when both letters in a recording occur at the same frame. A and T share a frame, but they need different predictor outputs. O and G likewise require a text-history update between them. Conversely, the blank steps between C and A can use a single predictor output after C even though they inspect different frames. The important boundary for the predictor is the point at which a token becomes part of the history. The important boundary for the time index is the blank in an ordinary Transducer.
Use the longest transcript to organize predictor work
The paper describes the number of predictor calls in its label-looping schedule in terms of the length of the longest hypothesis in the batch. A hypothesis is the recognition output accumulated for a recording, including its transcript and related information. As long as a recording still has tokens to emit, it has a sequential dependency across those emissions. To predict what follows a token, the decoder needs a representation that incorporates the token. The longest chain of such dependencies determines how many sequential rounds of useful token-history work the batch must support.
Grouping useful calls by label progress lets shorter transcripts share these rounds with the longer transcript while they still have tokens. A shorter transcript can finish while other rows remain active. The improvement concerns how the algorithm schedules the predictor across recordings, instead of a guarantee that every row in every kernel call always contributes equally. Blank searches can still take unequal amounts of time, and the joiner still has to examine the frames needed by each greedy path. Some rows can be ready for the next stage while others continue searching. The schedule puts that variability in the inner loop, where repeated joiner evaluations can reuse the predictor result.
The authors considered ways to avoid unnecessary predictor work while maintaining the conventional frame-based order. A decoder can try to call the predictor only after finding new text or use a changing batch size to evaluate just the relevant rows. The paper reports little practical speed improvement from these attempts. This matters because skipping selected rows may reduce one form of redundant work while keeping the predictor updates scattered across frame-based rounds. With label-looping, the schedule itself brings those updates together. The paper also reports that, after reducing the work in a joiner call, pursuing further savings by avoiding all possible additional joiner computation did not improve performance in the authors’ tests.
Store the batch as tensors
Changing the loop order gives the GPU more opportunities to act on the batch together. The data structure makes it possible to use those opportunities when recording the results. Conventional bookkeeping can give every recording its own hypothesis object and visit those objects in turn. The paper introduces a batched structure, BatchedHyps, whose fields are CUDA tensors. CUDA is the GPU environment used in the implementation. PyTorch tensor operations can apply an update across the batch while a mask indicates which rows should count the update. The information stored this way includes the growing token sequences, their lengths, scores and timestamps. PyTorch
The transcript buffer has the following shape:
[B, max_length]
B is the number of recordings in the batch. max_length is the current token capacity of each row. The brackets describe the tensor dimensions, and the comma separates the recording axis from the token-position axis. The current transcript length is tracked separately for each row, so a fixed-width buffer can hold hypotheses that have accumulated different amounts of text.
In the simplified pseudocode, current_lengths supplies the next free position for each transcript. The tensor operation writes the candidate label at that position across the rows. A mask then controls which lengths advance:
current_lengths ← current_lengths + add_mask
current_lengths is the vector of transcript lengths before the update when it appears on the right and the updated vector when it appears on the left. add_mask marks which rows accept a label in the operation. + denotes elementwise addition using the mask as the increment, and ← stores the result. A row whose length stays the same can have a candidate value in its next free slot without that value counting as transcript text. On a subsequent accepted append, the same slot can be overwritten and included in the valid prefix.
This is what makes rectangular storage compatible with asynchronous generation. All rows have a representation of the same shape, while each maintains the boundary of its own valid transcript. Time information can likewise differ across rows. The decoder can process a set of candidate results together and update the meaningful part of each hypothesis according to the state of that recording. The pseudocode illustrates the token write and length update. The full structure also supports the corresponding operations on scores and timestamps through masked tensor work.
The initial transcript capacity is chosen in proportion to audio length. If a transcription exceeds the reserved space, the capacity doubles. Starting with a smaller reservation makes sense because the decoder only learns the final number of tokens by generating them. Expanding the buffer accommodates a longer result while the valid lengths continue to identify how much text each row already contains. Although the storage grows as needed, the representation continues to allow one tensor operation to handle an append across the batch.
Apply the same schedule to predicted durations
The ordinary Transducer uses the selected symbol to decide how time should change. Blank means advancing by one frame, while a text token means staying at the current frame. TDT separates symbol choice from duration choice. On a prediction it supplies a token and an amount by which to advance through the audio. An advance can accompany a text token, and the amount can cover multiple frames. The two decisions determine different parts of the decoder's state. The token determines whether the transcript changes, and its accompanying duration determines the time update.
t′ = t + d
t is the recording's current frame index, t′ is its next frame index, and d is the duration predicted for that recording's current decoding step, expressed as a frame advance. + adds the advance to the current position, and = specifies the resulting index.
The TDT decoder still looks for the next non-blank emission because that is what requires a fresh text-history representation. During the search, blank predictions can move the audio position by their predicted durations while keeping the predictor output valid. When the search finds a text token, the decoder records it and also applies the predicted time advance. The next round then begins with both the new history and the updated audio position. Preserving the duration update on the text-token branch is essential: otherwise the next predictor output would be paired with the wrong position in the audio.
The paper refers to the batch's mapping from recordings to frame indices as b2time. Independent entries in that mapping give the duration-aware decoder a place to apply different advances. An approximate batch procedure can take the minimum predicted duration across recordings and use it to move the batch together. Label-looping can instead apply the actual prediction in each row. Thus exact batched greedy TDT decoding preserves the frame advances that belong to each utterance's own sequence of decisions. Here exactness concerns following those greedy decisions and durations. The criterion does not require exploring other candidate transcripts or finding the highest-scoring transcript over all possible alignments.
Prepare the inputs that the joiner will reuse
The joiner receives outputs from the encoder and predictor. In the architecture described in the paper, each output first passes through a linear projection, which maps it into the space in which the joiner combines the two inputs. A projection of an encoder frame depends on that frame's representation. It can therefore be computed before the loop starts consulting frames. A predictor projection depends on the current predictor output. It can be computed when that output is produced and retained while the decoder searches through blanks.
The two projections have different opportunities for reuse. An encoder frame can be revisited when successive text tokens are emitted at the same position. The projected audio representation remains valid across those decisions, even when the text history changes. The projected text representation can be reused through several blank steps, even when the audio position changes. Computing the projections at their points of change leaves the joiner with less work to repeat at each encounter between a frame and a history.
The paper notes that frame-looping can also move the projections outside repeated joiner evaluations. Its predictor updates are more frequent, however, and the baseline filters some predictor outputs after computing them. Precomputation on that schedule still leaves some projected results with little or no useful work to do. Label-looping provides a natural place to produce a predictor projection once per outer round and reuse it across the inner search. Projection precomputation and loop ordering are separate changes whose effects can reinforce one another.
Where training fits
The method changes inference. The decoder receives encoded audio and uses the predictor and joiner of an already trained speech recognizer. It has no separate training stage for deciding when a row should advance, when its hypothesis should be extended or which results a mask should apply. Those choices follow from the selected symbol, the frame boundary and, for TDT, the predicted duration. Likewise, the projected representations use the linear transformations that are already part of the recognizer. The change lies in when those transformations run and how long their outputs are retained.
In the experiments, the input data supply recordings to decode and reference transcriptions with which to measure word errors. The references do not guide individual greedy choices. The CAT and DOG example likewise illustrates how the scheduling operates for given alignments. In practice the decoder discovers the sequence of blank and text decisions as it executes the recognizer. Neither the alignment nor the transcript length is given to the loop in advance. The authors make the ordinary and duration-aware implementations available in NeMo.
Experiments and results
What was measured
The main comparisons use the LibriSpeech test-other split. The paper describes LibriSpeech as a speech recognition corpus drawn from public-domain audiobooks. The authors test ordinary and duration-aware Transducers at Large and XXL scales. RNNT-L and TDT-L each have 114M parameters. RNNT-XXL and TDT-XXL each have 1.1B parameters. The main configurations use a Fast-Conformer encoder with 8X sub-sampling and an output vocabulary of 1024 units produced by byte pair encoding, or BPE. Sub-sampling reduces the number of frames that reach the decoder. BPE vocabulary units can represent pieces of words, so the sequence of emitted tokens need not have the same boundaries as the sequence of words used for error measurement. Subword tokenization · Neural Machine Translation of Rare Words with Subword Units
For conventional Transducers, the baseline is the public NeMo batched decoder that follows the frame-looping procedure. The duration-aware baseline comes from earlier TDT work and advances using the smallest duration predicted for the batch. The comparison therefore has different interpretations in the two families. For RNN-T, it times two schedules for batched greedy decoding. For TDT, it times label-looping with per-recording advances against approximate batched decoding with shared advancement. Both comparisons measure a change in execution time, but the TDT baseline's recognition outputs can vary. The authors use it specifically as a timing reference.
The main speed metric is the inverse real-time factor, written RTFx. It says how much audio is processed per unit of computation time. A larger value indicates a faster system for the same input audio. The paper defines it by the following ratio:
RTFx = audio_length ÷ decoding_time
RTFx is the inverse real-time factor. audio_length is the duration of the input audio and decoding_time is the elapsed time in the part of recognition being measured. ÷ divides the durations in matching units, and = states how the metric is defined. The audio duration is the same kind of quantity in the full-runtime and decoder-only reports. The scope of the timed work determines which denominator the authors use.
The full-runtime measurement includes the encoder, whose job is to turn audio into frames. The non-encoder measurement isolates the decoding stage more closely. This distinction is important because a change in the schedule of predictor and joiner calls directly affects the latter stage. It can have a smaller effect on the full pipeline when the encoder takes substantial time. Both measurements are relevant: non-encoder timing shows the direct scale of the intervention, and full timing shows the effect on the measured recognition run as a whole.
All of the reported experiments use an NVIDIA RTX A6000 GPU and bfloat16 precision. The authors perform two warm-up runs before measuring and average the timings from the third through fifth runs. The purpose of warming up is to let caching needed for efficient execution take effect before the timed runs. The reported performance thus describes a decoder after warm-up on the stated hardware. Word error rate, or WER, provides a separate check on the recognized text at the word level. A lower WER means fewer word-level errors relative to the reference.
Conventional Transducers
On LibriSpeech test-other, the conventional Transducer experiments show a speed advantage for label-looping across the evaluated batch sizes. The paper describes the relative improvement as larger at larger batches. In a frame-looping batch with more recordings, there are more opportunities for one row to need another token at the current frame while other rows are ready to advance. The resulting wait can recur at many frame indices. Label-looping lets the rows advance independently during their blank searches and reserves the shared predictor stage for the next token each recording has found.
The paper reports a total-runtime speedup of 2.0X at batch size 32 for conventional Transducers. When encoder work is excluded, the gain at batch size 32 is around 2.6X for both RNNT-L and RNNT-XXL. The authors report WER of 3.9% on LibriSpeech test-other for RNNT-L and 2.7% for RNNT-XXL. Those error rates accompany the comparison across recognizer sizes. The reported acceleration comes from reorganizing the decoder's work with the trained recognizers in place.
The difference between total and non-encoder speedups illustrates how to read the benchmark. The predictor, joiner and bookkeeping make up only part of the pipeline. A quicker decoder reduces the time the complete system spends on those operations, while it still has audio encoding to perform. The non-encoder results answer how much the intervention sped up the area it targets. The total-runtime result answers how much of that improvement carries through to the full recognition pass under the measured conditions. They describe the same change at two scopes of timing.
Token-and-Duration Transducers
The duration-aware experiments show larger reported decoder-stage gains. On LibriSpeech test-other, both TDT-L and TDT-XXL achieve over 3.8X speedup in non-encoder computation compared with the approximate duration baseline. The paper reports a total-runtime speedup of 2.1X for TDT at batch size 32. For label-looping, WER on the same split is 3.7% for TDT-L and 2.8% for TDT-XXL. The paper reports fluctuating WER for the approximate baseline. Accordingly, the baseline provides a comparison of timed execution instead of a fixed accuracy target for the exact decoder.
Total-runtime speedup over each family’s baseline on LibriSpeech test-other at batch size 32
Label-looping yields a slightly larger total-runtime gain for the duration-aware Transducer against its own baseline.
The numbers
| System or setting | Runtime speedup (X) |
|---|---|
| Conventional Transducer with label-looping | 2.0 |
| Token-and-Duration Transducer with label-looping (this paper) | 2.1 |
Each chart row uses the baseline for its own Transducer family. The figures are relative speedups, so the larger value for TDT does not rank the absolute decoding times of TDT and RNN-T. Nor does it isolate the effect of predicting durations. The baselines have different advancement rules, and the TDT comparison combines an execution change with preserving each utterance's own predicted duration. The experiment shows that independent advancement and useful batching can coexist even when the recognizer may choose a different jump for each recording on each decision.
This is a substantive property of the TDT implementation. A shared advance can create a different sequence of audio positions than the sequence an utterance's own predictions would produce. A decoder that maintains separate time indices can follow those predictions and still group the predictor calls. The authors describe their implementation as the first openly available exact batched greedy TDT decoder of general application. The reported runtime shows that this exact implementation can also be faster than the approximate comparison procedure on the evaluated configurations.
Combining the decoder with execution optimizations
The authors also test whether the new schedule works alongside optimizations at another level of execution. They report combinations with TorchScript, a compilation approach, and CUDA Graphs, which optimize GPU calls. The comparison uses the Large RNN-T and TDT configurations at batch size 32. The paper gives an overall headline of up to 3.2X speedup when label-looping is combined with compilation or GPU-call optimization. The two execution techniques appear in separate combinations because the authors say they are incompatible with each other in this setup.
The combined results answer a practical question about whether reducing the amount of work through scheduling leaves room for reducing the overhead of running that work. The separate combinations show that it does in these tests. The other timing comparisons in the paper use the label-looping changes without these extra execution optimizations. The distinction matters when attributing gains: the baseline comparisons support the algorithmic changes, while the combination experiment shows what can happen when an additional execution technique is applied to the revised decoder.
What the ablations show
Moving the projections out of repeated evaluations
The paper directly tests projection precomputation by comparing decoding with the encoder and predictor projections prepared in advance against decoding with those projections computed as needed. The analysis uses RNNT-Large on LibriSpeech test-other in bf16 precision, with the encoder excluded from the measured time. The authors report over 20% speedup in this decoding-only comparison when both sets of projections are precomputed.
This experiment tests what happens when the joiner's inputs are prepared at the times when they can change. During blank traversal, a new frame can require a new audio vector but the predictor vector stays valid. During multiple text emissions on a frame, the projected audio vector can be reused even as the predictor vector changes. If both projections are performed inside every joiner evaluation, each kind of repeated input can bring repeated projection work. Moving both projections outward gives the algorithm access to the same representations with fewer recalculations. Excluding the encoder from the timing makes it easier to observe the effect on the operations the comparison changes.
The reported figure treats the two projections together. The experiment therefore supports the value of the combined precomputation strategy in the tested condition. It does not attribute a share of the reported improvement to the encoder projection, the predictor projection or a particular kind of blank run. The paper gives a reason to expect a smaller payoff on the original schedule: it generates predictor outputs more frequently and discards some of them. The comparison supplies a direct measurement within the revised decoder, while the account of the original schedule explains why identical placement of projections need not produce an identical gain there.
Changing the density of encoder frames
The main recognizers use 8X sub-sampling, so the authors also test a publicly available Conformer-Large Transducer with 4X sub-sampling. They use LibriSpeech test-other and bf16 precision for this comparison. The paper reports speedups up to 1.8X for total runtime and 2.6X for non-encoder computation, with WER of 3.7% for the configuration on the same split.
The result checks whether label-looping remains useful when the decoder receives frames from an encoder with a different sub-sampling rate. That is a meaningful change for a method whose inner loop traverses encoder frames. The frequency with which a recognizer can issue frame-level decisions and the amount of audio work in the pipeline can affect how the timing breaks down. The alternate recognizer still benefits, especially in the portion of computation that the decoder redesign directly targets. Since the comparison uses a different checkpoint and a different encoder configuration, it shows that the gains extend to that configuration. It does not isolate the marginal effect of changing the sub-sampling rate in an otherwise identical recognizer.
Testing other ways to reduce unnecessary work
The authors discuss two refinements intended to reduce waste within the conventional schedule. One waits to evaluate the predictor until a new text token has been found. The other varies the predictor batch size so that it handles only the rows that need work. The authors report that these attempts failed to produce a significant practical speed improvement in their tests. That finding supports the decision to organize the schedule around token emissions instead of relying only on selective execution inside a frame loop. The paper gives a qualitative account of these attempts, so their individual performance effects remain unquantified.
The authors give a similarly qualitative account of the remaining joiner work. After using precomputed projections to make the repeated calls lighter, they tried to avoid further unnecessary computations in the joiner and observed no performance improvement. This observation is consistent with the implementation benefiting more from removing expensive repeated work than from pursuing every conditional saving in the inner loop. It leaves open which further changes could help with another joiner architecture or a different execution environment. Timing the final implementation is what establishes whether a reduction in nominal operations is also a reduction in elapsed time.
Together, the observations clarify the division of work between the loops. The outer loop groups changes to the text representation, where each extra round has predictor cost. The inner loop accommodates differences in audio position, where repeated joiner calls are lighter and can reuse already projected inputs. The authors' measurements support that division in the evaluated configurations. They do not separately assign a numeric contribution to the loop swap, batched hypothesis storage and all remaining joiner operations.
How much did a wider search buy?
In initial experiments, the authors also ran beam search on the RNN-T recognizers they evaluated. They observed less than 0.1% absolute WER improvement and a several-fold increase in decoding time. This comparison changes the search strategy, so it answers a different question from the projection study. It helps explain why the authors put their effort into the greedy path. In their tested setting, following additional candidate transcripts incurred a substantial time cost for a small improvement in word errors.
This finding is about the speech recognizers and evaluation regime studied in the paper. A beam can help when a locally favored continuation leads to a worse overall transcription, but the initial experiments showed little measured benefit from following alternatives here. Label-looping keeps the computational scope of greedy search and improves the schedule for carrying it out. The beam comparison supplies context for choosing that scope. The projection comparison measures a more specific change within it.
Limitations
Limits the authors identify
The authors flag the approximation in the duration-aware baseline. Taking the shortest predicted duration in the batch as the advance can produce nondeterministic recognition results. The reported baseline WER fluctuates, and the paper includes the procedure for timing only. As a consequence, the TDT timing gains cannot be read as measurements against a prior exact batched implementation performing the same sequence of duration decisions. The paper also refers readers to the released implementation for the full TDT algorithm because of space constraints. Its written description explains the central change to time advancement, while the implementation is the source for the complete procedure.
The authors state that TDT-L was unavailable publicly at the time of publication because of legal requirements and describe plans to retrain and release a checkpoint. This is a limit on reproducing that particular comparison from the released materials at publication. The open availability of the decoder is a separate matter from the availability of each recognizer used in the benchmark. In particular, a subsequent retraining would produce the checkpoint used for a subsequent measurement, and the stated plans supply no measured result for it.
For the extra execution optimizations, the paper gives a dedicated comparison and explains that TorchScript and CUDA Graphs are incompatible in this setup. Its combination evidence concerns separate pairings with label-looping. The authors also identify a larger or more sophisticated predictor as a direction for future work. Reducing redundant predictor calls makes it reasonable to ask whether a stronger predictor could become affordable. The experiments measure the speed of decoding with the evaluated predictors. They leave the recognition gains and costs of a redesigned predictor to future evaluation.
Limits visible in the evaluation
The speed measurements concern one named test split, a specified GPU and bfloat16 arithmetic. They characterize the evaluated LibriSpeech test-other workload after warm-up, with the tested configurations of encoders, predictors and joiners. Other workloads could have different patterns of text emissions, blank runs and utterance lengths. Those features determine how frequently members of a frame-synchronous batch wait and how many joiner evaluations the new method must perform. The experiments establish gains under the reported conditions. They do not establish a portable speed multiplier for different audio, devices or numerical formats.
The timing protocol describes repeated runs with the cache warmed. That is an appropriate condition for identifying steady execution behavior, while leaving other operating conditions unmeasured. For example, the report does not give the cost of bringing up a decoder for a cold request, forming batches from incoming audio or waiting for a batch to fill. It also does not report a distribution of delays for individual recordings within each batch. A larger batch can improve the measured ratio of processed audio to computation time while the time an individual request experiences depends on how the service forms and schedules that batch. Full-runtime RTFx for the benchmark and user-facing request latency answer different questions.
The paper's explanation of predictor calls describes the minimum sequential rounds implied by the longest transcript. It does not give a corresponding lower bound on all computation in the decoder. Rows can differ in the number of blanks they traverse, and masks still have to represent which rows are looking for a token and which have finished. Joiner evaluations, GPU calls, buffer growth and score or timestamp updates all have their own costs. The experiments show the aggregate effect of the implementation and directly test precomputation, but the results do not apportion every contribution among these mechanisms. In particular, a fixed amount of useful predictor work does not determine how fast the entire inner frame search runs.
The accuracy evidence also has a specific scope. The RNN-T tables report error rates for the tested recognizers, and the TDT tables give the label-looping error rates alongside a timing comparator with variable output. The schedule provides a reason to expect the same local greedy decisions when the inputs and advancement rules are preserved. WER is an aggregate measure of recognized words, so matching it would not by itself establish agreement in every emission, score or timestamp. Exact greedy decoding is an algorithmic property of following the prescribed greedy path. Recognition quality is a separate property of the trained recognizer and the decisions on that path.
Finally, the beam-search observations are initial experiments on the evaluated RNN-Ts. They support prioritizing greedy speed in that setting. The test does not establish that a wider search will yield similarly small accuracy differences on other data, for predictors trained under different conditions or with other search settings. Likewise, the paper describes support for stateful and stateless predictors, but the headline timings are tied to the named recognizers. The design explains why changing the predictor's implementation need not invalidate label-looping. Performance with a particular replacement still depends on how its cost fits into the rest of the recognition pipeline.
What came after
The authors made the RNN-T and TDT implementations available in NeMo. They also showed within the paper that label-looping could be paired separately with TorchScript and CUDA Graphs, and proposed studying larger predictors as a future direction. Those are implementation and research steps described by the authors. Subsequent work building on label-looping is undocumented here. NeMo
Cite
Cite as Vladimir Bataev, Hainan Xu, Daniel Galvez, Vitaly Lavrukhin and Boris Ginsburg. 2024. Label-Looping: Highly Efficient Decoding for Transducers. arXiv:2406.06220.
@misc{bataev2024label,
title = {{Label-Looping: Highly Efficient Decoding for Transducers}},
author = {Vladimir Bataev, Hainan Xu, Daniel Galvez, Vitaly Lavrukhin and Boris Ginsburg},
year = {2024},
doi = {10.1109/slt61566.2024.10832333},
eprint = {2406.06220},
archivePrefix = {arXiv},
url = {https://doi.org/10.1109/slt61566.2024.10832333}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/bataev-2024-label-looping-highly-efficient-decoding/
References
- Alex Graves, Santiago Fernández, Faustino Gomez, and Jürgen Schmidhuber, “Connectionist temporal classification: labelling unsegmented sequence data with recurrent neural networks,” in ICML, 2006. OpenAlex ↗ · Scholar ↗
- Alex Graves, “Sequence transduction with recurrent neural networks,” in ICML, 2012. our card
- Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin, “Attention is all you need,” NeurIPS, 2017. our card
- Anmol Gulati, James Qin, Chung-Cheng Chiu, Niki Parmar, Yu Zhang, Jiahui Yu, Wei Han, Shibo Wang, Zhengdong Zhang, Yonghui Wu, and Ruoming Pang, “Conformer: Convolution-augmented Transformer for speech recognition,” in Interspeech, 2020. our card
- Mohammadreza Ghodsi, Xiaofeng Liu, James Apfel, Rodrigo Cabrera, and Eugene Weinstein, “RNN-transducer with stateless prediction network,” in ICASSP, 2020. OpenAlex ↗ · Scholar ↗
- Hainan Xu, Fei Jia, Somshubra Majumdar, Shinji Watanabe, and Boris Ginsburg, “Multi-blank transducers for speech recognition,” ICASSP, 2022. OpenAlex ↗ · Scholar ↗
- Hainan Xu, Fei Jia, Somshubra Majumdar, He Huang, Shinji Watanabe, and Boris Ginsburg, “Efficient sequence transduction by jointly predicting tokens and durations,” in ICML, 2023. OpenAlex ↗ · Scholar ↗
- Wei Kang, Liyong Guo, Fangjun Kuang, Long Lin, Mingshuang Luo, Zengwei Yao, Xiaoyu Yang, Piotr Żelasko, and Daniel Povey, “Fast and parallel decoding for Transducer,” in ICASSP, 2023. OpenAlex ↗ · Scholar ↗
- Zhengkun Tian, Jiangyan Yi, Ye Bai, Jianhua Tao, Shuai Zhang, and Zhengqi Wen, “FSR: Accelerating the inference process of transducer-based models by applying fast-skip regularization,” in Interspeech, 2021. OpenAlex ↗ · Scholar ↗
- George Saon, Zoltán Tüske, and Kartik Audhkhasi, “Alignment-length synchronous decoding for RNN transducer,” in ICASSP, 2020. OpenAlex ↗ · Scholar ↗
- Juntae Kim, Yoonhan Lee, and Eesung Kim, “Accelerating RNN transducer inference via adaptive expansion search,” IEEE Signal Processing Letters, vol. 27, pp. 2019–2023, 2020. OpenAlex ↗ · Scholar ↗
- Juntae Kim and Yoonhan Lee, “Accelerating RNN transducer inference via one-step constrained beam search,” arXiv:2002.03577, 2020. OpenAlex ↗ · Scholar ↗
- Rohit Prabhavalkar, Takaaki Hori, Tara N. Sainath, Ralf Schluter, and Shinji Watanabe, “End-to-end speech recognition: A survey,” IEEE/ACM Transactions on Audio, Speech, and Language Processing, vol. 32, pp. 325–351, 2023. OpenAlex ↗ · Scholar ↗
- Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al., “PyTorch: An imperative style, high-performance deep learning library,” in NeurIPS, 2019, vol. 32. our card
- Oleksii Kuchaiev, Jason Li, Huyen Nguyen, et al., “Nemo: a toolkit for building ai applications using neural modules,” in NeurIPS Workshop on Systems for ML, 2019. our card
- Shinji Watanabe, Takaaki Hori, Shigeki Karita, Tomoki Hayashi, Jiro Nishitoba, et al., “ESPnet: End-to-end speech processing toolkit,” in Interspeech, 2018. OpenAlex ↗ · Scholar ↗
- Mirco Ravanelli, Titouan Parcollet, Peter Plantinga, Aku Rouhe, Samuele Cornell, Loren Lugosch, et al., “SpeechBrain: A general-purpose speech toolkit,” in Interspeech, 2021. OpenAlex ↗ · Scholar ↗
- Dima Rekesh, Nithin Rao Koluguri, Samuel Kriman, Somshubra Majumdar, Vahid Noroozi, et al., “Fast Conformer with linearly scalable attention for efficient speech recognition,” in Automatic Speech Recognition and Understanding Workshop (ASRU), 2023. OpenAlex ↗ · Scholar ↗
- Rico Sennrich, Barry Haddow, and Alexandra Birch, “Neural machine translation of rare words with subword units,” in Proc. the 54th Annual Meeting of the Association for Computational Linguistics, 2016. our card
- Vassil Panayotov, Guoguo Chen, Daniel Povey, and Sanjeev Khudanpur, “Librispeech: an ASR corpus based on public domain audio books,” in ICASSP, 2015. OpenAlex ↗ · Scholar ↗
- Daniel Galvez, Vladimir Bataev, Hainan Xu, and Tim Kaldewey, “Speed of light exact greedy decoding for rnn-t speech recognition models on gpu,” in Interspeech 2024, 2024, pp. 277–281. OpenAlex ↗ · Scholar ↗