The speech recognition model in this paper is an encoder-decoder. The encoder turns the audio into a sequence of vectors, one for every short slice of time, which I call encoder frames or encoder steps. The decoder reads those vectors and writes the transcript one token at a time, where a token is a word or a piece of a word. The encoder uses full self-attention, so every frame looks at every other frame in the clip, and it uses rotary position embeddings, RoPE, to tell the frames where they sit in time. A model like this is accurate, and it is awkward to serve.
The first cost is the obvious one. Self-attention compares every frame with every other frame, so its work grows with the square of the number of frames. A thirty second utterance costs far more than ten three second ones. The model is served on a GPU, the graphics processor that does its arithmetic, and the long utterances in the tail are where its time goes.
The second cost is quieter, and it needs two words unpacked. A tensor is the block of numbers a layer works on, and its shape is how many numbers it has along each axis. For the encoder one axis is time, so a longer clip is a wider tensor. Real audio arrives at every length, so every request puts a different shape through the encoder.
A kernel is the small program that does one layer's arithmetic on the GPU. A fast serving stack compiles or autotunes its kernels, which means it tries many ways of running the same arithmetic and keeps the fastest. The fastest way depends on the exact shape, so the stack either keeps one kernel per shape it has seen or keeps retuning when a new shape arrives.
The old fix was absolute positional embeddings, where position zero means the start of the utterance and every position has its own learned vector. Audio was then padded or bucketed to a few maximum lengths, which ties the model to a fixed set of positions. RoPE handles lengths it has not seen, but a RoPE encoder is still served as one pass over the whole clip whose shape changes on every request.
TACE takes a trained encoder-decoder as it is and changes only how the encoder is run. The waveform is cut into chunks of a fixed duration and every chunk is padded to the same number of samples. The chunks go through the encoder together as one batch, and their outputs are stitched back into one sequence, so the decoder never learns anything changed.
What is lost is attention between chunks. A short round of post-training recovers most of it, using the original full-context model as a teacher and only training small low-rank corrections to the weights, which is what LoRA means and which I explain below. Accuracy is measured as word error rate, the fraction of words the transcript gets wrong, after normalising case and punctuation. Over seven public speech corpora the encoder runs 1.33 times faster on average and 2.05 times faster on half-minute clips, and the word error rate rises by less than five points.
Rotary position embeddings
Attention works with two vectors per frame. Each frame produces a query, which is what it is looking for, and a key, which is what it offers to be found. The attention score between two frames is the dot product of one frame's query with the other frame's key, and the scores decide how much each frame listens to each other frame.
A dot product is a single number made from two lists of numbers of the same length. Multiply the first entry of one by the first entry of the other, do the same for every position, and add the results up. It is large when the two lists point the same way and near zero when they have nothing in common, so it is a natural score for how well a query matches a key.
Some maths follows. It is one line long, and then it is over.
RoPE is how position gets into those scores. It splits each query and key vector into pairs of coordinates and rotates the pair belonging to position by an angle , with a different for each pair. Write for the rotation at position . The attention score between a query at step and a key at step is then
because rotating both vectors by the same angle leaves their dot product alone, and what survives is a rotation by the difference between the two positions.
So the score depends on and on nothing else about position. A stretch of audio encoded with its positions counted from zero produces the same attention scores it would have produced with positions counted from four seconds in, as long as the same keys are present. That is what makes a chunk a legitimate thing to hand the encoder on its own.
With absolute positional embeddings this would not work. Index zero means the start of the utterance and the model has learned that, so a chunk starting at second four would be lying to it. What RoPE does not give is attention across chunks. That is the price, and the rest of TACE after the cut is there to pay it back.
Chunking and stitching
Let be the waveform and the original encoder, including its convolutional front end. The front end is a short stack of convolutions that turns raw audio samples into frames and reduces their number by a fixed factor. Pick a chunk duration seconds and a left context seconds. TACE crops
with nothing prepended to . Each chunk covers its own seconds plus the last seconds of the chunk before it.
A convolution needs a picture. It is a short list of weights that slides along the audio, and at each stop it multiplies the samples under it by those weights and adds them up to make one output. So every output depends on a small window of input around it, the width of the list. The front end stacks a few of these and steps along in jumps, which is how thousands of samples a second become a few dozen frames a second.
The left context is there for two reasons. The first is the front end. Each output frame of a convolution depends on a window of input around it, and at a hard cut that window runs into padding where there was speech, so the first few frames of a chunk come out wrong. This is the boundary artifact that the overlap sweep later measures. The second reason is attention. Without the left context the first frames of a chunk would have nothing to their left to attend to.
Each crop is padded to a fixed sample count, so every chunk has the same shape through the front end and through every transformer layer. A batch is a set of inputs the GPU works on side by side as one tensor, and the batch axis is the axis that counts them. The chunks are stacked along the batch axis and encoded in one call, . This is the fixed-shape execution the serving stack wanted. The kernel always sees one shape, and the only thing that varies with utterance length is how many chunks are in the batch.
Stitching drops the overlap and concatenates,
so every encoder step of the utterance appears once, taken from the chunk that had it in its own seconds rather than in its left context.
The token awareness in the name is in the drop. The front end reduces the frame rate by a fixed stride, so it emits one encoder step for every fixed number of samples, and seconds is therefore a fixed whole number of encoder steps . and are written in seconds because that is how people think about audio. But removes a whole steps from the front of each chunk's states, so the seam lands on a step boundary and the stitch is a plain slice and concatenation on the device. Doing it in seconds and rounding would put the seam off by up to a frame at every boundary.
The attention matrix shows what chunking removes. Draw the attention for the whole utterance as a square, with one row per encoder step acting as a query and one column per step acting as a key. Full-context attention fills the square. Chunked attention keeps only blocks along the diagonal, one per chunk, each as tall as the chunk and wider by the left context, and leaves everything else empty.
Within a block the computation is identical to the original model's, by the RoPE argument above. Off the blocks there is nothing, and that empty region is where the chunked model and the original differ.
The stitcher
The concatenation has a seam every seconds where two chunks that never saw each other meet. Rather than hand straight to the decoder, TACE runs a small transformer encoder over it, . It has two layers and four attention heads, where a head is one independent set of query and key projections, and it works at the same vector width as the base encoder.
A head needs unpacking. A projection is a matrix that turns a frame's vector into a shorter one, and an attention layer has one matrix for making queries and one for making keys. A head is one such pair, with its own scores and its own weighted sums. Four heads run four of these side by side on the same frames, so each can look for a different kind of relation, and their outputs are joined back together. The vector width is how many numbers each frame carries between layers.
Its job is to let states on one side of a seam attend to states on the other, which is the one thing the chunked encoder cannot do. Left unrestricted that attention would range over the whole utterance again, so it can be limited to a local window around each boundary, which is where the damage is.
The stitcher trains jointly with the rest under the losses in the next section, with gradients flowing through both it and the chunked encoder. Its forward time is reported separately in the tables as the stitch cost, 1.74 ms per utterance at the recommended setting.
Post-training against the teacher
The chunked encoder sees less context than the model it came from, and the decoder was trained on states produced with the full context. The fix is distillation, which means training one model to copy the outputs of another. The original model, run with full context on the whole utterance, is the teacher, and the chunked model is the student. Two things can be matched, the encoder states and the decoder's output distribution, and TACE matches both.
Let be the teacher's encoder states and the student's stitched states, two sequences of the same length with one vector per encoder step. The state loss is a squared error with a mask,
which pulls each student state toward the teacher state at the same step. The teacher's states are a cloud of points in the encoder's hidden space, one per frame, and this loss drags the student's cloud onto it point by point. is a mask of weights. It zeros the padded steps, and it can weight the steps near a seam more heavily, since that is where the two clouds differ.
The second loss is on what the decoder does with those states. Both decoders are run with teacher forcing, which means that at every step they are given the correct transcript so far, , and each produces a probability distribution over the next token, a list of how likely it thinks each possible token is. The Kullback-Leibler divergence between two such lists is a single number that is zero when they agree and grows as they drift apart. Taken from the teacher's distribution to the student's, it measures how much worse the student's guesses are when the teacher's are taken as right. Summing it over the transcript gives
The combined objective is
The two losses do different jobs. The state loss gives a dense target at every frame. The KL loss only responds to state errors that the decoder actually responds to, and it is measured on the thing that ships, the transcript. The first says the states should look like the teacher's, the second says the transcript should come out the same.
The weights that move are LoRA adapters. LoRA stands for low-rank adaptation. It leaves a weight matrix frozen and learns a correction , with and for a small rank . The product of a tall thin matrix and a short wide one can only change along at most independent directions, so the correction costs a small fraction of the parameters.
Adapters go on the attention projections of both encoder and decoder. The base weights are untouched, so conversion is cheap and the deployed model keeps the same interface and the same decoding procedure. Tools that sit on top of the decoder, such as fusing its scores with a separate language model, keep working.
Streaming
Because chunks are encoded once and their states appended, audio can arrive while the model runs. Each new chunk is encoded, its overlap dropped, and its states appended to a buffer that is never recomputed.
The decoder does not redo its earlier work either. A cache is a store of results that were already computed, kept so they are not computed again. The decoder keeps one for its own past attention and for its projections of the earlier encoder states, so when new states arrive it only has to process those. Compute grows in a straight line with the number of chunks and never revisits earlier audio, which is what a streaming model promises, without a streaming architecture.
Streaming models such as Emformer get there by adding explicit memory modules and training the streaming behaviour in from the start. TACE gets it as a side effect of fixed-shape execution on a model that already exists, with its encoder-decoder interface unchanged.
Results
The evaluation uses seven corpora from the End-to-end Speech Benchmark, ESB, which covers different kinds of speech. Here is what each one is.
| corpus | what it is |
|---|---|
| AMI | recordings of meetings, several people talking over each other |
| Earnings22 | company earnings calls, with many accents and financial terms |
| GigaSpeech | podcasts, YouTube and audiobooks |
| LibriSpeech clean | audiobooks read aloud by speakers that are easy to transcribe |
| LibriSpeech other | the same audiobooks with harder speakers |
| TED-LIUM | TED talks |
| VoxPopuli | European Parliament speeches |
The averages give each corpus equal weight, with the left context s. SPGISpeech, a corpus of financial earnings calls, is reported separately. Times are GPU milliseconds per utterance. WERn is normalised word error rate and ΔWERn is how many points it rose over the base model.
| setting | C | WERn | ΔWERn | base enc ms | TACE enc ms | stitch ms | speed-up enc / enc+stitch |
|---|---|---|---|---|---|---|---|
| base | – | 14.33 | – | 18.20 | – | – | 1.00 / 1.00 |
| TACE | 1 s | 22.08 | +7.75 | 18.20 | 13.73 | 1.77 | 1.33 / 1.17 |
| TACE | 2 s | 19.29 | +4.96 | 18.20 | 13.71 | 1.74 | 1.33 / 1.18 |
| TACE | 5 s | 27.01 | +12.68 | 18.20 | 14.19 | 1.73 | 1.28 / 1.14 |
Two-second chunks are the setting we recommend. One-second chunks are a touch faster on average and blow the five-point budget, since there are twice as many seams. Five-second chunks have fewer seams and did badly anyway.
Our reading of the five-second result needs two terms. The receptive field is the span of audio a frame can see, which after chunking is its own chunk plus the left context. Overfitting is when a model fits the particular conditions it was trained under so closely that it does worse when those conditions change. We read the result as sensitivity to the chunk size seen in post-training, and as the optimiser overfitting to the smaller receptive field.
The left context is the one knob worth exposing. Taking it away entirely at s raises the average encoder speed-up to 1.89 times in the overlap sweep and costs 8.69 points. That is the front end's boundary artifact and the lost context showing up together. A context of 0.2 s gave 3.92 points at 1.34 times in its own sweep, though each sweep was a separate evaluation run with its own base timing, so the rows are not finely comparable. The execution path stays the same across every setting, so the knob trades quality for compute without touching the kernels.
The corpora do not suffer equally. Conversational speech is hit hardest at the seams. AMI goes from 13.32 to 20.87 normalised word error rate and Earnings22 from 44.00 to 58.18. Read speech holds up, with LibriSpeech clean going from 3.48 to 4.68.
Every corpus speeds up more as its utterances get longer, and grouping utterances by duration shows the pattern the quadratic cost predicts. Below five seconds there is nothing to save, 0.96 times, since a short clip is only one or two chunks and attention over so few frames was never the cost. From there the speed-up climbs through every bucket to 2.05 times at 25 to 30 seconds, where quadratic attention is most expensive. The stitch overhead is nearly flat in length, so the encoder-only and encoder-plus-stitch curves track each other on long audio.
What it does not say
- The quality gap at the seams is real, two to five points in most buckets and more on conversational speech.
- A mismatch between the chunk size used in post-training and the one used at test time hurts, so the chunk length is decided when the model is converted, not when it is served.
- There is one base model, in the style of Moonshine, a small open speech model, and one post-training recipe. The LoRA ranks, loss weights and step counts are in the companion logs rather than the paper.
- The stitcher is small and its window is optional, and we have not separated how much of the recovery comes from the stitcher and how much from the LoRA adapters.
What stands is this. A deployed full-context speech model can be turned into one that runs on fixed shapes, encodes chunks in parallel and only ever appends to its memory, without touching its decoder. RoPE is what makes the cut legitimate. The obvious next things to try on the remaining gap are losses that weight the seams, varying the chunk size during post-training, and a limited amount of attention across chunks.
References
- Jeffries et al., Moonshine: speech recognition for live transcription and voice commands, 2024.
- Su et al., RoFormer: enhanced transformer with rotary position embedding, 2021.
- Hu et al., LoRA: low-rank adaptation of large language models, 2021.
- Hinton, Vinyals and Dean, Distilling the knowledge in a neural network, 2015.
- Shi et al., Emformer: efficient memory transformer based acoustic model for low latency streaming speech recognition, 2020.
- Gulati et al., Conformer: convolution-augmented transformer for speech recognition, 2020.
- Yao et al., Zipformer: a faster and better encoder for automatic speech recognition, 2024.