Elamur Research

Fast and Robust Early-Exiting Framework for Autoregressive Language Models with Synchronized Parallel Decoding

Paper · 2023 · Sangmin Bae, Jongwoo Ko, Hwanjun Song et al.

Summary

A text generator that writes one token at a time typically runs its entire decoder for every new token. Some predictions can already be made partway through the decoder, so early exiting offers a way to avoid unnecessary work. The difficulty is that an early exit leaves gaps in the information that later tokens need. Filling those gaps with approximations can hurt generation quality, and checking whether to exit at every layer can take enough time to erase the speed gain. Bae and colleagues investigate both problems and propose Fast and Robust Early-Exiting, or FREE.

FREE gives a single decoder a shallow path and a full-depth path. The shallow path makes a prediction and scores its confidence. When the score clears a cutoff, the decoder emits the token and defers the remaining computation. When a later prediction needs full depth, the deeper layers process the current position together with the positions whose computation was deferred. This produces the key and value states used by Transformer attention from the layers that actually need them. It also lets the decoder compare the shallow and deep predictions for positions in the same stretch of text. An adaptive estimator uses those comparisons to update the confidence cutoff during inference.

The experiments cover text summarization, question answering and machine translation. On SAMSum, adaptive FREE scores 48.66 ROUGE-L at a reported ×1.47 speedup against its full-depth reference, which scores 49.11. On CNN/DailyMail, it scores 40.99 against a full-depth score of 41.09 and runs at ×1.65. The authors report up to ×2.16 speedup under their near-full-quality criterion. The gains vary by task. The translation experiments, for example, show smaller advantages, which the authors link to a more expensive confidence calculation over a larger vocabulary.

The experiments distinguish between repairing the information that future predictions will use and revising tokens that have already been emitted. FREE does the former. A later deep pass can supply accurate states for the existing prefix even when its preferred token differs from the shallow choice. The authors separately test a policy that goes back and revises earlier choices. Its extra decoding time often outweighs the modest quality gains. The main results therefore concern measured task quality and end-to-end decoding time, with both evaluated on the sequences that FREE actually produces.

Deep dive: Fast and Robust Early-Exiting Framework for Autoregressive Language Models with Synchronized Parallel Decoding

FREE speeds up text generation by exiting early on confident predictions and processing deferred attention states together when deeper decoding is needed. · about 36 minutes to read

The problem and its context

Why depth is a decision for every token

In autoregressive text generation, a prediction becomes part of the input for the next prediction. A token is an individual unit in the generated sequence. Before the decoder can decide what to emit next, it needs the sequence it has already emitted. Within each step, the usual decoder computes a stack of layers in succession. A deep stack and a long generated sequence therefore create two different sources of serial work. The decoder must move through its layers, then use the result to advance the output by one position.

The paper begins from an observation behind earlier early-exiting methods. Intermediate layers sometimes already favor the same next token as the final layer. Other positions need more computation before the decoder settles on its final prediction. A rule that uses the same depth for every position cannot take advantage of that difference. An early-exiting rule tries to recognize the positions at which an intermediate prediction is strong enough to use. It runs deeper layers for the remaining positions.

A prediction at an intermediate layer requires a classifier that can read the representation at that depth. The authors explain that early-exiting systems often share the classifier across layers because predicting over the entire vocabulary requires a large set of parameters. A shared classifier still has to be evaluated wherever the decoder checks for an exit. For policies that use probabilities to score confidence, those checks can include computing scores across the vocabulary and normalizing them with a softmax. A decoder can save layer computation on an individual token and still incur substantial costs in deciding where to stop.

There is also a difference between the cost of a prediction and the cost of a completed response. A very shallow decoder can produce a token quickly. If it then generates redundant or unusually long text, the extra decoding steps can offset the saving on each step. The paper treats this as part of the latency problem. The user waits for the whole output, and the number of positions in that output depends on the decoder's decisions.

Why earlier tokens still need attention states

Self-attention lets the decoder use the prefix when it predicts the continuation. In a given layer, a current position can consult earlier positions through their keys and values. A key participates in deciding how strongly to attend to a position, while a value carries information that can be combined into the resulting representation. These states depend on the layer. A decoder can store them in a cache, so a future step can read them without recomputing every earlier position.

An early exit interrupts the production of those states. Suppose one position exits at a shallow layer and a subsequent position needs the full decoder. The deeper layers now need states for the earlier position, even though that position never passed through them. Adaptive depth is consequently a decision about both the current prediction and the information available to later ones. A good shallow prediction can still leave a poor cache if the mechanism used to supply its missing states is unreliable.

The conventional solution examined by the authors is state copying. It takes the hidden representation at the exit layer and reuses it as a substitute for representations that would otherwise be produced by deeper layers. The deeper layers can project those substitutes into keys and values without running their full attention and feed-forward computations on the exited position. This addresses the immediate need for cache entries. It assumes that representations from the shallower layer are adequate inputs to the deeper projections. Agreement on the next token and similarity of the underlying representations are separate properties, so agreement alone gives limited information about whether copying will work.

Earlier work had found copying acceptable on small T5 decoders, as the authors describe it. FREE starts by asking how that approach behaves when the decoder is larger or the generated sequence is longer. A longer continuation makes more subsequent decisions depend on the prefix, and a deeper decoder gives more room for intermediate and final representations to differ. Those are reasons to test the approximation under those conditions. The paper does so using summarization settings with different decoder sizes and output lengths.

How previous methods decided when to exit

The paper traces token-level adaptive depth to earlier work by Elbayad and colleagues, in which intermediate decoder layers could make next-token predictions. It then discusses CALM, the approach by Schuster and colleagues that serves as its conventional early-exiting baseline. CALM explored ways to measure confidence, a threshold that decays during generation, and calibration intended to control risk. The authors describe those experiments as concentrating on relatively small decoders. They also point to the additional calibration data and statistical tests required by the calibration procedure.

A threshold defines how much confidence is needed to commit to a shallow prediction. An aggressive cutoff can increase the fraction of early exits. A more conservative one sends more positions through the full decoder. The practical question is where to set the cutoff for the task at hand. A score measures how strongly the shallow classifier favors a prediction. The score alone does not say how closely the shallow and deep paths agree on that task, or how their disagreements affect completed outputs. FREE looks for evidence about agreement during ordinary decoding.

This work belongs to a broader line of research on efficient inference. The paper also places it alongside non-autoregressive translation and speculative decoding. Earlier work on non-autoregressive machine translation pursued the parallel generation of output positions. In the paper's account of speculative decoding, an inexpensive predictor proposes a stretch of text, and a larger predictor checks the proposals together. Acceptance and resampling govern how generation continues. The authors also discuss related approaches that correct errors by rolling back part of the output.

FREE adopts the opportunity to use multiple positions in the same deeper computation. Its primary decision is still an early exit within a single network. It emits a shallow prediction as soon as that prediction passes the confidence test. The later deep computation supplies layer states and evidence for threshold estimation. The paper studies rollback separately, because regenerating text changes the work required to finish the current response. This distinction matters when comparing methods that all use parallel computation but use its results for different decisions.

The method, step by step

Following a stretch of output through the decoder

FREE divides the decoder at a chosen layer. The shallow path runs from the input of the decoder to that layer. The deep path uses the same initial layers and continues through the rest of the stack. The split is fixed for a trained configuration. The routing decision is made afresh as generation proceeds. The paper calls this arrangement the shallow-deep module.

Imagine the decoder has already written a prefix. It computes a shallow prediction for the next token. If that prediction is confident enough, the decoder emits it and records that the corresponding position still lacks its deeper states. The new token can immediately be used in the shallow computation for the following step. If several successive positions exit early, the record of deferred positions grows. The shallow part of the decoder continues to compute the states it needs as it goes.

Eventually, the shallow path may propose a token whose confidence falls below the cutoff. The current position then needs the deeper layers. Those layers also need the previous positions that have been processed only at shallow depth. FREE takes the saved shallow representations for that stretch and processes them together with the current position through the remaining layers. This is synchronized parallel decoding. It supplies the deep prediction needed at the current step and fills the outstanding entries in the deeper attention caches.

The positions in the group already have a known prefix when this deep computation runs. Each position must still obey the decoder's causal order, meaning that it can use its predecessors and cannot look ahead to later positions. Processing the group together is possible because FREE already knows the tokens it emitted during the shallow steps. The deeper layers are computing representations for that existing stretch of output. The generation of new text still advances token by token.

The deep pass also yields predictions at earlier positions in the group. These can be compared with the shallow predictions that were made there. For an earlier token that has already been emitted, the comparison is a record of agreement or disagreement. In standard FREE, the record contributes to future confidence decisions. The current token, which reached the deep branch before being emitted, is chosen using the deep prediction.

FREE decoding and threshold adaptation

The steps in order.

FREE decoding and threshold adaptationStep 1: Compute the shallow next-token prediction1. Compute the shallow next-token predictionStep 2: Compare shallow confidence with the cutoff2. Compare shallow confidence with the cutoffStep 3: Emit confident tokens and defer deeper states3. Emit confident tokens and defer deeper statesStep 4: Group deferred positions with the next deep request4. Group deferred positions with the next deep requestStep 5: Run the remaining layers across the group5. Run the remaining layers across the groupStep 6: Record where shallow and deep predictions agree6. Record where shallow and deep predictions agreeStep 7: Update the cutoff during early inference7. Update the cutoff during early inference

The decoder and its exit rule

The paper describes the underlying network using the stacked blocks introduced in Attention Is All You Need. Each block uses attention and a feed-forward network. Attention incorporates information from other positions available to the decoder. The feed-forward network transforms the representation at a position. The paper writes the progression of a hidden state through the stack in the following form.

h₍ₜ₊₁₎⁽ˡ⁾ = Transformerₗ(h₍ₜ₊₁₎⁽ˡ⁻¹⁾), l ∈ [1, L]

Here, t indexes an already generated token, and t + 1 is the prediction step that follows it. The superscript l identifies the current layer. L is the total number of layers, and [1, L] denotes the available layer indices from the first through the last. h is the hidden state, a vector representing the position at the indicated depth. At depth 0, that vector is the embedding output for the previously emitted token yₜ. Transformerₗ is the operation of layer l. The recurrence displays the flow through depth while leaving the attention context implicit.

p(yₜ₊₁ ∣ h₍ₜ₊₁₎⁽ᴸ⁾) = softmax(Wᴸᵀ h₍ₜ₊₁₎⁽ᴸ⁾)

Here, p gives the probabilities of possible values of the next token yₜ₊₁, conditional on the last layer's hidden state h₍ₜ₊₁₎⁽ᴸ⁾. Wᴸ is the classifier's weight matrix at depth L, and ᵀ signifies its transpose. The matrix product gives a score for each vocabulary entry. softmax converts the scores into a probability distribution. In greedy decoding, the entry with the highest probability is the prediction. An early-exiting decoder can read an intermediate state through a classifier in the same way.

ŷₜ₊₁⁽ˡ⁾ = argmaxᵧ p(y ∣ h₍ₜ₊₁₎⁽ˡ⁾)

Here, ŷₜ₊₁⁽ˡ⁾ is the greedy prediction at layer l for the next position. y ranges over the vocabulary, and argmaxᵧ selects the entry that maximizes the conditional probability p. The state h₍ₜ₊₁₎⁽ˡ⁾ is the representation at that layer. The paper denotes a layer's confidence score by c, with the layer identified by a superscript. The confidence score is used for routing, while the vocabulary probabilities determine the predicted token. In FREE, only the shallow boundary needs an early-exit check. The last layer provides the prediction when the decoder continues to full depth.

For comparison, the paper expresses the missing representation supplied by conventional state copying as follows.

h₍ₜ₊₁₎⁽ⁱ⁾ = h₍ₜ₊₁₎⁽ˡ⁾, ∀ i ∈ [l + 1, L]

Here, l is the layer at which the position exited, i is any deeper layer index, and ∀ means that the assignment applies to every index in the stated range. t + 1 again identifies the decoding step, L is the final layer, and h denotes its hidden state at the specified depth. Copying uses that substitute to compute the attention keys and values needed by subsequent positions. With synchronization, the corresponding representations come from the actual deeper blocks. Because the shallow path is a prefix of the deep path, the saved representations are at the same boundary for every position waiting to be processed.

Training a decoder that can predict at both depths

An intermediate representation typically serves as input to the layers above it. For early exiting, it also has to support a useful vocabulary prediction by itself. The paper starts from an objective used in earlier systems, in which every eligible layer can be trained to make a prediction. It writes this as a weighted combination of layer losses.

ℒ = ∑ᵢ₌₁ᴸ αᵢ ℒᵢ, with ∑ᵢ αᵢ = 1

Here, ℒ is the combined objective, i is the layer index, and L is the depth of the decoder. ℒᵢ is the negative log-likelihood loss at layer i. It penalizes the classifier when it gives a low probability to the target token. αᵢ is the contribution assigned to the loss from that layer, and ∑ denotes summation. The weights add up to 1. The paper describes both an earlier uniform choice, 1/L, and a depth-weighted choice, in which each layer's index is divided by the sum of the layer indices.

FREE concentrates the prediction losses at the shallow boundary and the final layer. The weights assigned to these two prediction losses are as follows.

α₍Lₛ₎ = Lₛ ∕ (L + Lₛ),     α₍L₎ = L ∕ (L + Lₛ)

Here, Lₛ is the number of layers in the shallow path, and L is the number in the full decoder. α₍Lₛ₎ weights the prediction loss measured at the shallow boundary, while α₍L₎ weights the one measured at the full depth. Since the full path includes more layers, its prediction loss has the larger weight. The shallow prediction still has an explicit target, so the classifier at that depth can learn to use the representation produced there.

The authors add a layerwise knowledge distillation loss during fine-tuning. Distillation here means asking representations in the shallow path to resemble selected representations from the deep path. The additional target concerns the hidden states, whereas the prediction losses concern the probability given to the target token. The distillation term can supply a training signal even when the two paths already agree on the top token.

ℒKD = (1 ∕ Lₛ) ∑ᵢ₌₁ᴸˢ MSE(Hₛ⁽ⁱ⁾, Hᴅ⁽ᵐ⁽ⁱ⁾⁾)

Here, ℒKD denotes the knowledge distillation loss, and Lₛ is the shallow depth. The summation runs over shallow layer indices i. Hₛ⁽ⁱ⁾ denotes the hidden states of shallow layer i, and Hᴅ⁽ᵐ⁽ⁱ⁾⁾ denotes the hidden states at the deep layer assigned to it by the mapping m. MSE is the mean squared error between the two sets of states. Averaging over shallow layers gives one distillation loss to add to the weighted prediction objective.

The paper considers three ways of choosing the deep layer. One uses the last layer of the full decoder as the source for distillation. Another fixes a uniform mapping along the depth of the stack, an approach the paper associates with work including TinyBERT. The dynamic option looks for close representations among the deep layers, subject to ordering the matches consistently through the stack.

m(i) = argminⱼ MSE(Hₛ⁽ⁱ⁾, Hᴅ⁽ʲ⁾), with m(1) ≤ ⋯ ≤ m(Lₛ)

Here, i indexes shallow layers, j indexes candidate deep layers, and m(i) is the selected deep index for shallow layer i. argminⱼ selects an index with the smallest eligible mean squared error. Hₛ⁽ⁱ⁾ and Hᴅ⁽ʲ⁾ are the hidden states being compared. The inequalities indicate that the mapped deep indices occur in nondecreasing order from the first shallow layer to the last. A higher shallow layer therefore receives its target from the same depth as, or a later depth than, the one assigned to the preceding shallow layer. The authors use this dynamic variant, called KD-dyna, for the shallow-deep experiments.

Why synchronization saves work on the critical path

When the shallow path succeeds repeatedly, the computation that would ordinarily happen above the shallow boundary stays off the immediate path to the next prediction. Once the deeper layers are needed, the accelerator can process the waiting positions together. Their representations are still computed layer by layer. Within a layer, however, operations for the group can be scheduled together instead of each position requiring its own trip through the remaining stack. The gain depends on how efficiently the hardware handles the resulting work.

The cache produced by synchronization has a particular meaning. It represents the sequence that the decoder has actually emitted. If a shallow token differs from the one a full-depth greedy run would have chosen, the two runs may now have different prefixes. Accurate deep states for the FREE prefix cannot make those prefixes identical. They do make it possible for a later deep step to attend to the existing sequence without the additional approximation introduced by copying hidden states across layers.

In an implementation with state copying, an exit decision can be followed by immediate work to construct approximate entries for the deeper cache. FREE defers the deeper computation until it is needed. When the current token uses the shallow route, it only needs the cache at shallow depth. When the current token uses the deep route, synchronization supplies the missing deeper cache entries before they are needed. The timing of the computation follows the access pattern of the decoder.

Turning agreement into an adaptive cutoff

The threshold estimator uses observations gathered while processing early inputs. An observation pairs a shallow confidence score with an indicator of whether the corresponding shallow and deep predictions agree. A synchronized deep pass produces both predictions for positions it processes, including deferred positions. The paper reports that confidence tends to cluster towards the high end of its range for agreement and toward the low end for disagreement. It fits a separate distribution for each case.

The distributions are Beta distributions. Their support matches the interval from 0 to 1, and their shapes can represent observations concentrated toward either end. The density in the paper is as follows.

p(x ∣ α, β) = [Γ(α + β) ∕ (Γ(α)Γ(β))] xᵅ⁻¹ (1 − x)ᵝ⁻¹

Here, x is a confidence value between 0 and 1. α and β are the shape parameters, and Γ is the gamma function. The bracketed factor normalizes the density, and the powers of x and 1 − x determine how it varies over the interval. The expression p(x ∣ α, β) is a density at a confidence value. Later, the mixture uses the two densities to estimate the probability of an agreement label given that value.

The algorithm distinguishes class 1, for matching predictions, from class 0, for differing predictions. For each class it uses the average and variance of the shallow confidences assigned to that class. The paper writes the statistics with an agreement indicator. To express the class-specific calculation in a single notation, the indicator below selects the observations whose agreement label is k. That includes disagreements when fitting the disagreement component.

c̄ₖ = (∑ᵢ₌₁ᴺ γᵢₖ cᵢ⁽ᴸˢ⁾) ∕ (∑ᵢ₌₁ᴺ γᵢₖ)

Here, c̄ₖ is the mean confidence for class k, N is the number of accumulated observations, and i indexes those observations. cᵢ⁽ᴸˢ⁾ is the confidence read at shallow depth Lₛ for observation i. γᵢₖ is 1 when the agreement label of observation i equals k, and 0 otherwise. The numerator sums the selected confidence scores and the denominator counts the selected observations.

sₖ² = (∑ᵢ₌₁ᴺ γᵢₖ (cᵢ⁽ᴸˢ⁾ − c̄ₖ)²) ∕ (∑ᵢ₌₁ᴺ γᵢₖ)

Here, sₖ² is the empirical variance for class k. N, i, γᵢₖ and cᵢ⁽ᴸˢ⁾ refer to the same observations, and c̄ₖ is their class-specific mean. Each selected observation contributes its squared distance from that mean. Dividing by the count gives the variance used in the fitting expressions.

αₖ = c̄ₖ [c̄ₖ(1 − c̄ₖ) ∕ sₖ² − 1]

Here, αₖ is the first Beta shape parameter for class k, c̄ₖ is its mean confidence, and sₖ² is its confidence variance. The term in brackets uses the mean and variance to set the scale of the shape parameter.

βₖ = αₖ(1 − c̄ₖ) ∕ c̄ₖ

Here, βₖ is the second Beta shape parameter for class k. It uses αₖ, the first parameter from the preceding calculation, and c̄ₖ, the same class-specific mean. The paper describes its fitting step as maximum likelihood estimation. Its displayed update specifies the parameters directly using the empirical mean and variance.

After fitting the two components, FREE evaluates how strongly each density supports agreement at a candidate confidence value. The paper combines this information with the prior weight of each class.

p(k = 1 ∣ λ꜀) = p(k = 1)p(λ꜀ ∣ α₁, β₁) ∕ [∑ⱼ∈{0,1} p(k = j)p(λ꜀ ∣ αⱼ, βⱼ)]

Here, λ꜀ is the confidence value under consideration, and p(k = 1 ∣ λ꜀) is the fitted posterior probability of agreement at that value. p(k = 1) is the prior weight of agreement. The denominator sums a prior-weighted density for each class j in {0, 1}, so it incorporates disagreement as well. αⱼ and βⱼ are the Beta parameters for class j. The authors give both classes a prior weight of 0.5 because their observed frequencies are strongly imbalanced. The posterior is thus based on a deliberately balanced mixture.

λ꜀ = argminλ {λ ∣ p(k = 1 ∣ λ) ≥ ζ}

Here, λ is a candidate threshold, λ꜀ is the selected cutoff, and argminλ selects the smallest qualifying candidate. The condition after the vertical bar requires the fitted posterior p(k = 1 ∣ λ) to meet or exceed ζ, the target posterior condition. The experiments use 0.4 for ζ. The authors set it in conjunction with the equal class weights. It is a decision rule in the fitted mixture, distinct from a target value for a task metric such as ROUGE-L.

The calibration procedure starts with an empty collection of observations and an initial exit threshold of 0.9 in the experiments. It generates an early response, accumulates its comparison data, refits the confidence distributions and uses the resulting threshold for subsequent inference. The algorithm denotes the update limit by T, which the experimental setup sets using 3% of the total sample count. The ordinary forward passes therefore serve two purposes during that period. They generate outputs for the incoming inputs and collect the evidence needed to set a cutoff. The authors identify fast_robust_early_exit as the implementation accompanying the paper.

Experiments and results

Tasks, configurations and timing

The evaluation includes several kinds of conditional generation. SAMSum contains 16K messenger-style conversations with summaries. CNN/DailyMail is the article summarization setting, drawn from a collection of over 300K English news articles. Multi-News contains 45K news articles and associated summaries, with source links for the documents represented in a summary. BIGPATENT contains 1.3M patent records, but the paper uses its Fixed Constructions category. These settings cover dialogue, individual news articles, groups of news articles and patent documents. Multi-News and BIGPATENT also give the authors settings with relatively long outputs.

For question answering, the authors use SQuAD, which the paper describes as a collection of 87.6K reading comprehension tasks with questions based on Wikipedia articles. The translation benchmark is IWSLT 2017. The dataset description specifies German-to-English translation, although the main setup calls the benchmark En-De. The appendix's training configuration identifies mT5-large for translation. The authors use T5-large for the other shorter-context headline experiments and LongT5-base for Multi-News and BIGPATENT. They use smaller T5 variants in their re-evaluation and direct size comparisons, and T5-3B in a separate scaling experiment.

Fine-tuning uses AdaFactor with a learning rate of 1e-4. The recipe varies across tasks. SAMSum uses 20 epochs and CNN/DailyMail uses 3. Both have input and output length caps of 512 and 128, respectively. Multi-News and BIGPATENT each use 3 epochs, with an input cap of 2048 and an output cap of 512. SQuAD uses 10 epochs and caps input and output at 512 and 30. The IWSLT configuration uses 2 epochs, an input cap of 1024 and an output cap of 128. These caps describe the training configuration. A generated output can end earlier, and the evaluation times the work needed to reach completion.

The authors report ROUGE-L for their summarization comparisons, following the ROUGE approach to scoring overlap with a reference summary. By using the longest common subsequence, ROUGE-L can give credit for words that occur in the same order even if other words separate them. SQuAD uses F1 to assess overlap with the reference answer, and IWSLT uses the BLEU score for translation quality. These task metrics are distinct from the agreement labels used to fit the exit threshold. Agreement compares two decoder predictions, whereas the reported benchmark scores compare generated outputs with task references.

For latency, the authors run 500 inference predictions for each timed dataset and configuration on a single server with a single GPU. They use compiled PyTorch execution, batch size 1 and greedy decoding with a beam size of 1. The measurement includes the decoding steps through completion. Relative speedup expresses the time saving against a full-depth reference. A score below ×1.00 indicates a slowdown, and a score above it indicates acceleration. The comparisons use fine-tuned full-depth references corresponding to the training setup of each method. A small difference between those full-depth quality scores can therefore exist before any early exits are enabled.

Comparing adaptive depth, fixed depth and full depth

The main comparisons include full decoding, static exiting and CALM. A static exit assigns the same decoder depth to every generated token. Sweeping that depth provides a baseline for the quality and latency achievable without checking confidence to route each position. CALM represents conventional adaptive exiting. The authors also test two versions of FREE. FREE† uses the shallow-deep module and synchronized parallel decoding with a fixed threshold. FREE uses the same basic architecture with the adaptive estimator.

In the quality and latency plots, the authors sweep the exit threshold for CALM and FREE† between 0 and 1. For static exiting, they vary the depth. They display the outer tradeoff curves, which show settings that offer useful combinations of latency and quality. They report a larger area under the curve for FREE† across their summarization comparisons. CALM fares poorly even against static exiting in those plots. The contrast gives context to the speed claim. An adaptive policy can offer a finer allocation of layer computation, but its advantage is contingent on the cost of implementing that allocation.

For the tabulated near-full-quality comparison, the authors select the smallest fixed threshold that achieves 99% of the corresponding full-depth score for CALM and FREE†. For SAMSum, the full-depth reference associated with CALM scores 48.82 ROUGE-L. CALM scores 48.37 at ×0.72. The full-depth reference associated with FREE has a score of 49.11. With the selected fixed threshold, FREE† reaches 48.65 at ×1.50, and adaptive FREE reaches 48.66 at ×1.47. Both FREE configurations approach the score of their full-depth reference while reducing measured decoding time.

On CNN/DailyMail, CALM scores 40.78 against its full-depth reference of 41.15 and runs at ×0.86. The shallow-deep reference scores 41.09 at full depth. FREE† produces 40.89 at ×1.80, while adaptive FREE produces 40.99 at ×1.65. The adaptive threshold on this dataset yields a slightly higher ROUGE-L score and a more modest speedup than the fixed threshold chosen through the sweep. The fixed setting is a useful comparison because it shows what threshold selection can deliver when the authors can inspect multiple settings. The adaptive version derives its setting during early inference.

Relative decoding speed on SAMSum

Adaptive FREE speeds up decoding, while CALM takes longer than its full-depth reference.

Relative decoding speed on SAMSumFull-depth reference: 1.00Full-depth reference1.00CALM: 0.72CALM0.72FREE with selected fixed threshold: 1.50FREE with selected fixed threshold1.50FREE with adaptive threshold (this paper): 1.47FREE with adaptive threshold (thispaper)1.47
The numbers
System or settingrelative speedup
Full-depth reference1.00
CALM0.72
FREE with selected fixed threshold1.50
FREE with adaptive threshold (this paper)1.47

ROUGE-L on CNN/DailyMail with the shallow-deep decoder

Adaptive FREE stays close to the full-depth reference and scores above the selected fixed-threshold setting.

ROUGE-L on CNN/DailyMail with the shallow-deep decoderFull-depth shallow-deep decoder: 41.09Full-depth shallow-deep decoder41.09FREE with selected fixed threshold: 40.89FREE with selected fixed threshold40.89FREE with adaptive threshold (this paper): 40.99FREE with adaptive threshold (thispaper)40.99
The numbers
System or settingROUGE-L
Full-depth shallow-deep decoder41.09
FREE with selected fixed threshold40.89
FREE with adaptive threshold (this paper)40.99

The authors report adaptive FREE attaining up to ×2.16 at their 99% preservation criterion. This is a reported maximum across the evaluation. The individual scores on SAMSum and CNN/DailyMail show the more informative comparison for a particular setting, where the quality metric, training reference and speedup can all be identified. The threshold-tuned and adaptive points are close in those two examples, although which one has the higher quality depends on the dataset. The evidence for adaptation is that it approaches a useful part of the speed and quality curve without a separate threshold sweep for each evaluated condition.

Question answering, translation and a smaller full decoder

For SQuAD, the authors report that both variants of FREE have better quality and latency tradeoffs than CALM and static exiting. They also compare FREE† using T5-large with a directly trained T5-base decoder. This tests a different alternative to full-depth T5-large. A smaller decoder avoids the machinery of adaptive depth and applies its smaller stack consistently. To bring the comparison points near one another in quality, the authors choose the FREE† threshold manually.

At a threshold of 0.1 on SQuAD, FREE† scores 90.95 F1 at ×2.76, relative to the full-depth T5-large score of 91.82 at ×1.00. The directly trained T5-base scores 90.50 at ×1.86. The two ways of reducing computation therefore lead to distinct operating points in the question-answering setting. On CNN/DailyMail, the authors set the FREE† threshold to 0.2. It scores 40.17 ROUGE-L at ×2.07. The directly trained T5-base scores 40.22 at ×2.06, relative to the full-depth T5-large score of 41.09. Here the smaller full decoder and early-exiting larger decoder end up close in both measures. The ×2.76 result concerns a manually chosen setting for FREE†, separate from the reported maximum for the adaptive version under the 99% criterion.

For IWSLT 2017, the relative advantages of FREE are smaller than in the other test settings. The authors attribute this partly to the larger vocabulary of mT5. Each confidence check requires processing more vocabulary scores, which adds cost even if the decoder checks at just one intermediate location. CALM also has to evaluate large classifiers and fares worse in the translation comparison. The authors suggest a confidence measure whose cost does not depend on vocabulary size as a possible way to address the problem. The paper gives the translation result as a quality and latency curve and discusses its trend.

Scaling the decoder and changing the sampling rule

The larger-decoder experiment uses T5-3B on SAMSum and CNN/DailyMail. Because full fine-tuning is costly at that size, the authors use LoRA, a method that trains low-rank updates to selected weights. They use rank 64 for updates targeting self-attention and feed-forward layers. The quality and latency curves retain the pattern seen with T5-large. FREE compares favorably with the baselines on both ROUGE-L and latency. This experiment extends the evidence to another size within the T5 family and shows an instance of adapting the shallow-deep framework with a less expensive fine-tuning method.

The paper also checks two departures from greedy decoding on SAMSum. Top-k sampling restricts the choice to the highest-probability vocabulary entries. With k = 50, full-depth decoding scores 44.34 ROUGE-L at ×1.00, CALM scores 42.35 at ×0.78, and FREE scores 43.58 at ×1.30. Nucleus sampling instead takes the smallest set whose cumulative probability crosses the chosen mass. With p = 0.92, the full decoder scores 45.84 at ×1.00, CALM scores 44.48 at ×0.82, and FREE scores 45.78 at ×1.31. Both comparisons use the full-depth result under the same sampling rule as the speed reference. They show that the gains survive at these sampling settings, with quality closest to full depth in the reported nucleus run.

What the ablations show

Agreement at an exit can conceal damage to the cache

The paper first tests copying under unusually favorable exit decisions. Its oracle chooses the earliest layer whose predicted token agrees with that of the last layer. This uses information a real early-exit rule would not have at decision time. The point is to reduce the role of poor confidence decisions in the diagnostic. If quality still degrades, agreement between classifiers has failed to protect the system against all the consequences of early exiting.

On SAMSum with T5-small, full-depth decoding scores 44.84 ROUGE-L, and oracle exiting with copying scores 44.17. With T5-large on the same dataset, the corresponding scores are 48.82 and 47.58. On Multi-News with LongT5-base, the full-depth score is 37.62 and the oracle-exit score is 29.63. On BIGPATENT with LongT5-base, the scores are 49.68 and 44.99. The losses are more pronounced in the long-output settings shown here. The comparison on SAMSum also shows a larger loss with the larger T5 decoder on the same task.

To investigate the states used by copying, the authors measure their cosine similarity to the final-layer states. Cosine similarity measures how closely two vectors align in direction. On SAMSum, the similarity between the last-layer state and the oracle-exit state is 0.913 for T5-small and 0.809 for T5-large. On Multi-News and BIGPATENT with LongT5-base, the similarities are 0.724 and 0.686, respectively. Hidden states can thus disagree substantially in direction while the classifier still favors the same token. This gives a reason why the token agreement built into the oracle does not resolve the cache problem. It is evidence about the representations the method actually reuses, independent of whether the vocabulary prediction at the exit appears successful.

The authors also compare synchronized parallel decoding with state copying while holding the shallow-deep module fixed. This comparison makes the mechanism clearer than a comparison between FREE and CALM in their entirety. Both configurations have the same kind of shallow and deep routes, and the authors vary how the deeper computation handles previously exited tokens. With a threshold of 0.5, synchronized decoding gives 48.65 ROUGE-L on SAMSum, 41.00 on CNN/DailyMail and 38.78 on Multi-News. State copying at that threshold gives 43.92, 40.71 and 36.55, respectively. Synchronization yields the better ROUGE-L score in all the tested dataset and threshold pairs in this comparison.

ROUGE-L on Multi-News at a confidence threshold of 0.5

Computing the deferred states with the deeper layers yields a higher score than constructing them by state copying.

ROUGE-L on Multi-News at a confidence threshold of 0.5State copying: 36.55State copying36.55Synchronized parallel decoding (this paper): 38.78Synchronized parallel decoding (thispaper)38.78
The numbers
System or settingROUGE-L
State copying36.55
Synchronized parallel decoding (this paper)38.78

The differences vary with the threshold and dataset. On Multi-News at 0.1, state copying scores 29.34 and synchronized decoding scores 33.98. At 0.9, the scores are 38.43 and 39.16, respectively. Synchronization improves quality in both settings, and the aggressive threshold still gives a lower score than the conservative one. The decoder is making more commitments on the shallow path at a permissive cutoff. Accurate cache states address one consequence of early exits. The quality of the shallow choices remains a separate part of the overall result.

Exiting earlier can increase end-to-end time

The authors run a static-exit diagnostic on SAMSum with T5-small and T5-large. In static exiting, every position uses the same depth, so the comparison shows how well each depth can act as a complete decoder. Exiting at the first or second layer of T5-large gives nearly zero ROUGE-L. The authors also observe abnormally long outputs when shallow layers of that decoder are available for adaptive exits. They exclude the first two layers from the early-exit candidates for base decoders and the first four for large decoders in subsequent comparisons.

The cost breakdown explains why even a conventional system with more reasonable exit depths can be slow. The authors measure components of decoding across three summarization datasets. They compare full depth with early exiting at thresholds of 0.9, 0.7 and 0.5. The confidence computations take a meaningful share of the time, especially when softmax must run over a large vocabulary at many layers. State copying also leaves work after the nominal exit because the deeper cache still needs key and value projections. Together, these costs can push total decoding time above that of the full-depth baseline. Counting the number of skipped Transformer blocks would miss both sources of overhead.

Within FREE, the authors compare shallow depths of 4, 6, 8 and 12 layers. On SAMSum at threshold 0.5, the 4-layer variant scores 46.95 ROUGE-L at ×1.09, while the 6-layer variant scores 48.65 at ×1.50. The 12-layer variant scores 48.74 at ×1.28. The weakest shallow depth in this comparison has both lower quality and a smaller speedup than the intermediate depth. The authors suspect that errors and redundant text explain part of the result, in line with the long outputs observed in their earlier diagnostic. Their ablation reports the joint outcome in quality and latency. It does not break out the contribution of each possible cause.

CNN/DailyMail shows how the choice of depth depends on the quality target. At the threshold of 0.3, the 6-layer variant scores 40.60 at ×2.07. The 8-layer variant scores 40.95 at ×1.69, and the 12-layer variant also scores 40.95, at ×1.55. A deeper shallow path pays for more computation each time it is used, and it can also make stronger predictions. The comparison is about the balance between these effects once the exit rate, quality of predictions and output lengths are all allowed to vary. Six layers work well in these tests, which is the basis for the authors' choice in much of the evaluation.

Thresholds depend on the task, and early observations can be enough

The preliminary threshold sweep shows how much the best cutoff can vary for conventional early exiting. The authors consider thresholds from 0 to 1 with a step size of 0.1. In the column targeting an approximately 5% drop in task performance, the selected cutoff is 0.7 on SAMSum, 0.5 on CNN/DailyMail, 0.0 on SQuAD and 1.0 on IWSLT. These values come from the same threshold grid and performance criterion. Their spread motivates treating the threshold as a quantity to estimate for the inference setting. It also shows why evaluating a single fixed cutoff across every task would entangle the quality of the routing mechanism with the suitability of that particular choice.

The calibration-size ablation compares the adaptive cutoff from early samples with fits using larger fractions of the data. On SAMSum, the estimated cutoff is 0.51 using 3%, 0.49 using 10% and 0.48 using 100%. The reported SAMSum outcomes are 48.66 ROUGE-L at ×1.47 with 3% and 48.69 at ×1.51 with 10%. On BIGPATENT, the cutoff is 0.54 at all three sample sizes. Using 3% gives 49.47 ROUGE-L at ×1.58, while using 10% gives 49.39 at ×1.63. The small calibration fraction gives thresholds close to the full-sample estimates in those two settings. The reported quality and speed still depend on which run is evaluated, even when the displayed thresholds match.

The distillation comparison studies the other stage that affects the shallow classifier. The authors vary the threshold for decoders trained with a weighted average of prediction losses or with the different distillation mappings. They report modest differences overall. The dynamic mapping gives a better tradeoff in their comparison, with the uniform mapping doing less well on SAMSum. This supports their use of KD-dyna for the rest of the experiments. It says less about the magnitude of the loss design's contribution to the full framework, since the paper describes the curves as close.

Revising emitted tokens adds a different cost

Synchronization supplies a deep prediction for a deferred position, so it also gives the decoder an opportunity to reconsider a shallow decision. The authors test a refinement policy that can remove the generated continuation after a detected error and resume generation from there. A refinement threshold controls which shallow predictions the policy accepts. This test makes it possible to compare the benefits of rollback with the cost of repeating work.

On SAMSum at an exit threshold of 0.3, FREE without refinement scores 47.60 ROUGE-L at ×1.80. Using refinement with a threshold of -1.0 gives 48.31 at ×1.50. Using 0.1 gives 48.27 at ×1.12. On CNN/DailyMail at the same exit threshold, the corresponding results are 40.60 at ×2.07, 40.78 at ×1.67 and 40.75 at ×1.21. In these runs rollback improves overlap with the reference and slows generation. At the CNN/DailyMail exit threshold of 0.7, the unrefined score of 41.08 at ×1.53 is higher than those of the refinement settings, which obtain 40.86 at ×1.51 and 40.85 at ×1.35. Refinement can therefore consume additional time even in a setting where its measured quality is worse.

The authors use this comparison to explain why the standard version retains its shallow commitments. The cache repair and the threshold update can use the deep pass even if it disagrees with a shallow prediction. Revising the output introduces the cost of regenerating whatever follows the changed position. The experiments expose that cost in the quality and latency tradeoff. They do not supply an upper bound on the extra delay introduced by rollback.

Judging summaries beyond reference overlap

The authors supplement ROUGE-L with automated judgments intended to resemble human evaluation. They draw 100 CNN/DailyMail instances at random and compare the full-depth decoder with FREE using ChatGPT. Relevance, informativeness, fluency, and coherence each receive a score on a 1-to-5 scale. The full-depth outputs receive scores of 4.73, 3.83, 3.87 and 3.77 in that order. FREE receives 4.68, 3.84, 3.84 and 3.72. The largest values for each system come from the same criterion, relevance, and the scores are close on all four criteria.

The authors also ask for a preference between the paired summaries and repeat each comparison with the order reversed. The full-depth output wins 101 comparisons and FREE wins 99. This is a complementary quality test under the benchmark condition where the full-depth decoder has a ROUGE-L score of 41.09 and FREE scores 40.99 at ×1.65. The similarity of judgments supports the claim that the speedup in this setting comes with little change in measured summary quality. The comparison is specific to the sampled articles and to the evaluator and prompts used in the experiment.

Limitations

Limits identified by the authors

The authors identify the cost of additional fine-tuning as a limitation. An existing full-depth decoder needs to learn to predict effectively at the shallow boundary, and FREE uses a training objective that also aligns selected hidden states. The T5-3B experiment illustrates a way to reduce the fine-tuning burden through LoRA. Its evidence concerns the tested adapter configuration and summarization datasets. The paper gives no general estimate of the training cost needed to adapt other checkpoints or of how much traffic would be required to recover that cost through faster inference.

The other stated limitation is the choice of shallow depth. It is a configuration decision that persists throughout generation. The depth ablation shows that cutting too much from the shallow path can hurt both generation quality and speed, but the paper leaves open how to choose the boundary for different decoder architectures. The adaptive cutoff can change how often the shallow path is used. It leaves the cost and prediction quality of that path, as determined by the chosen depth and training, outside its control.

Limits of the evidence

The principal speed measurements describe batch-size-1 inference with compiled execution on one GPU. Synchronized decoding benefits when the hardware can process the deferred positions together efficiently. Batched requests, different hardware, or a workload with a different distribution of shallow runs could change the saving. In particular, the end-to-end times answer how long it takes to finish a generated response under the tested setup. They do not characterize the distribution of delays between streamed tokens or the scheduling of parallel groups under concurrent requests. A group of deferred positions is processed precisely when the current request needs a deep step, which makes those deployment questions distinct from mean time to completion.

The tests of size and architecture are concentrated in the T5 family. The paper's T5-3B results extend the range of decoder sizes examined, and the long-output experiments test a different summarization regime. The role of vocabulary cost is already visible within the evaluated family, in the mT5 translation setting. The paper gives evidence that the design can transfer across several sizes and tasks within this group. More general claims about other architectures or about the speedup from changing the accelerator would require measurements under those conditions.

The adaptive cutoff estimates agreement with the deep decoder under a balanced mixture of confidence distributions. Agreement is a useful signal because full-depth decoding is the quality reference, but both paths can agree on an incorrect answer. They can also disagree on tokens that lead to comparably good outputs. The fitting criterion therefore operates at token level and the reported quality criterion is evaluated at the response or dataset level. The paper demonstrates an empirical relationship between the two. Its posterior threshold is neither an exact-output guarantee nor a bound on a task-level score. The sampling experiments likewise show empirical scores and speedups for the stated rules rather than equality with the full-depth output distribution.

The estimation procedure depends on confidence observations from the early portion of inference. The calibration-size ablation suggests that those observations can yield a stable estimate on SAMSum and BIGPATENT. It leaves open how adaptation behaves if the beginning of the workload differs substantially from the rest, or if the two types of agreement labels are scarcely represented during the updates. The displayed moment formulas require observations in both classes and depend on their estimated variances. The threshold rule also depends on a fitted posterior meeting the specified condition somewhere on the confidence range. Those are conditions of the estimator. The paper's ablation focuses on sample fraction and does not give a separate robustness analysis for such edge cases.

Finally, the longer-output oracle experiments vary dataset and decoder family together in some comparisons. They show that copying can go wrong under those conditions. They offer weaker evidence for how much of the difference comes from output length alone, as opposed to architecture or the task. The comparison with a shared shallow-deep module is stronger evidence about the state-handling decision itself. On quality, the additional summary evaluation is confined to sampled CNN/DailyMail articles and an automated judge. It broadens the evidence beyond word overlap while leaving direct human judgments, other summarization domains and analogous evaluations for translation and question answering open.

What came after

Efficiency as a system problem

Later papers cite FREE across work on inference, resource use and adaptive computation. The citation establishes a connection, while the topics stated by the later papers show where the connection is most relevant. One recurring distinction is between reducing decoder work on an individual generation step and changing the system conditions under which that work can be performed.

LLM in a flash addresses inference under limited memory. FREE's contribution concerns the timing and depth of decoder computation, whereas limited-memory inference foregrounds where the resources required for that computation can reside. The relationship is at the level of inference cost. Both topics make a latency claim depend on a concrete execution setting, and the citation alone does not establish that the later method adopts FREE's synchronization or calibration.

Towards Efficient Generative Large Language Model Serving surveys serving from algorithmic methods through system design. FREE offers an example of a decoding decision whose value depends on the execution environment. A shallow exit changes the path through the network, and a later deep step changes the number of positions available for parallel processing. This makes it pertinent to a survey that treats serving performance as the joint result of an algorithm and the system that runs it.

LLM Inference Unveiled surveys inference and brings a roofline perspective to it. The point of contact with FREE is the distinction between reducing the amount of work and completing the remaining work efficiently. Processing deferred positions together can improve the opportunity for parallel execution even though the deeper network still has states to compute. A Survey of Resource-efficient LLM and Multimodal Foundation Models takes a broader view of resource efficiency. FREE contributes a case of input-dependent decoder computation within that scope. The citation does not by itself extend FREE's text-generation results to multimodal settings.

Parallel checking and selective depth

LogitSpec pursues faster retrieval-based speculative decoding through next-next-token speculation. Its subject connects to FREE's use of parallel computation over consecutive positions. The critical question in speculative decoding is how to use drafts in deciding which tokens can be accepted. FREE uses shallow predictions to continue immediately and can later gather deep predictions about the same positions to estimate a threshold. These are distinct roles for information gained by processing several positions together.

LongSpec studies efficient drafting and verification for lossless speculative decoding over long contexts. The stated emphasis on losslessness distinguishes its goal from the empirical quality preservation studied by FREE. FREE's experience with longer generated outputs makes it a relevant antecedent for thinking about the cost of deeper computation across many positions. Its experiments measure the quality of the generated responses, while LongSpec's title identifies verification and losslessness as central to its own setting.

Single-Pass, Depth-Selective Reading for Multi-Aspect Sentiment Analysis brings the question of selective depth to a reading task. The common concern is whether processing can take place at different depths within a single pass through a task. In FREE, test-time depth selection decides how to predict the next token, and the attention cache makes that decision affect later positions. In multi-aspect sentiment analysis, the cited work's stated goal concerns reading for multiple aspects. The citation links those uses of selective depth without establishing that reading requires the same cache repair mechanism.

Other forms of adaptive computation

CSE-UOI at SemEval-2026 Task 6 uses a two-stage heterogeneous ensemble with complexity gating for political evasion detection. The relevant similarity is that a decision about difficulty can route an input towards further computation. The title describes gating at the level of a staged detection system. FREE's gate instead controls the depth used for each next-token prediction within one decoder. The two settings illustrate how the unit being routed determines what must be preserved between an inexpensive path and a more expensive one.

HatePrototypes focuses on interpretable and transferable representations for detecting implicit and explicit hate speech. FREE also studies intermediate representations, in its case to understand whether a state from one layer can stand in for a state at a deeper layer. The later work's stated aim concerns interpretation and transfer in detection. Its citation gives a connection to this broader interest in the properties of representations, with no specific reuse of FREE's decoder established by the citation.

Less Languages, Less Tokens addresses efficiency in cross-lingual chain-of-thought reasoning through a unified logic framework. Its title foregrounds the amount of text produced. FREE foregrounds the decoder depth used per token, and its static-exit analysis shows that output length can offset a saving on an individual token. This is the point at which the two efficiency questions meet. End-to-end generation cost depends on both how much computation each step requires and how many steps the system takes to finish.

Cite

Cite as Sangmin Bae, Jongwoo Ko, Hwanjun Song and Se-Young Yun. 2023. Fast and Robust Early-Exiting Framework for Autoregressive Language Models with Synchronized Parallel Decoding. Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.18653/v1/2023.emnlp-main.362

@inproceedings{bae2023fast,
  title = {{Fast and Robust Early-Exiting Framework for Autoregressive Language Models with Synchronized Parallel Decoding}},
  author = {Sangmin Bae, Jongwoo Ko, Hwanjun Song and Se-Young Yun},
  booktitle = {Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  doi = {10.18653/v1/2023.emnlp-main.362},
  url = {https://doi.org/10.18653/v1/2023.emnlp-main.362}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/bae-2023-fast-robust-early-exiting-framework/