---
title: "Judge Decoding — paper by Bachmann et al. (2025)"
description: "Judge decoding speeds up speculative sampling by checking whether draft tokens make sense in context, with tests of speed and answer quality."
canonical: "https://research.elamur.ai/free/en/papers/bachmann-2025-judge-decoding-faster-speculative-sampling/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/) · [Constitution](https://md.constitution.elamur.ai/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/bachmann-2025-judge-decoding-faster-speculative-sampling/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2025](https://md.research.elamur.ai/free/en/papers/2025/) / Judge Decoding: Faster Speculative Sampling Requires Going Beyond Model Alignment

# Judge Decoding: Faster Speculative Sampling Requires Going Beyond Model Alignment

Paper · 2025 · Gregor Bachmann, Sotiris Anagnostidis, Albert Pumarola et al.

**Authors:** [Gregor Bachmann](https://md.research.elamur.ai/free/en/authors/gregor-bachmann/), [Sotiris Anagnostidis](https://md.research.elamur.ai/free/en/authors/sotiris-anagnostidis/), Albert Pumarola, Markos Georgopoulos, Artsiom Sanakoyeu, Yuming Du, Edgar Schonfeld, Ali Thabet and Jonas Kohler · **Year:** 2025 · **Venue:** arXiv:2501.19309 · **Licence:** [CC BY 4.0 (arXiv)](http://creativecommons.org/licenses/by/4.0/)

[Cited by **16** papers in our library of more than 163,000 papers whose bibliographies we read](https://md.research.elamur.ai/free/en/papers/bachmann-2025-judge-decoding-faster-speculative-sampling/cited-by/) · [licence](http://creativecommons.org/licenses/by/4.0/)

- [PDF](https://arxiv.org/pdf/2501.19309)
- [arXiv 2501.19309](https://arxiv.org/abs/2501.19309)

## Summary

A fast system can write a correct answer and still have most of it thrown away by a slower system asked to check its work. That is a consequence of standard speculative decoding, a technique for speeding up [text generation](https://md.research.elamur.ai/free/en/topics/text-generation/). A smaller language model drafts a stretch of text. A larger one, called the target, checks the draft in a single pass. The usual check is designed to preserve the target’s output distribution. It can therefore turn down a valid continuation whenever the draft and target favor different ways of saying the same thing. Once a candidate is rejected, the remaining draft was written for a continuation that the system may no longer follow. The authors find early rejections even when the candidate text comes from GPT-4o or from human-written Wikipedia abstracts.

Judge decoding gives the target an additional way to accept a draft token. The target already computes an internal representation as it reads each candidate. A small, trained classifier reads that representation and scores whether the candidate is acceptable in context. The authors build its training set from 500 questions paired with correct and incorrect answers. They review the answers and mark where the incorrect ones go wrong, so that an acceptable opening to a flawed answer can still serve as a positive example. At generation time, a candidate can pass through either the usual speculative check or the learned judge. The decoder keeps the contiguous run of accepted candidates and falls back to the target where that run ends.

With Llama-8B drafting for Llama-405B, the authors report accepting close to 20 draft tokens at a time, a 9.7× speedup over ordinary decoding in HuggingFace, and a generation rate of 129 tokens/s in gpt-fast. With Llama-70B as the target, they report up to 141 tokens/s in gpt-fast. In the quality experiments, judge decoding comes close to the respective targets across tests of mathematics, programming, dialogue and multiple-choice answering. A simpler rule that accepts candidates based on their rank among the target’s predictions preserves far less of the target’s advantage in those comparisons.

The extra acceptance route removes the guarantee that outputs follow the target’s distribution. Quality therefore depends on what the judge has learned and where it is used. On HumanEval, the coding score for the Llama-405B judge drops from 86.6 to 80.4% when coding examples are removed from its training data, while the Llama-8B draft scores 71.3%. Some of the ability to judge continuations carries over across tasks. The remaining gap shows why the authors still rely on examples from the intended domain when they want to retain the target’s performance.

## Deep dive: Judge Decoding: Faster Speculative Sampling Requires Going Beyond Model Alignment

Judge decoding speeds up speculative sampling by checking whether draft tokens make sense in context, with tests of speed and answer quality. · about 34 minutes to read

**In this deep dive**

1. [The problem and its context](#dd-the-problem-and-its-context)
2. [The method, step by step](#dd-the-method-step-by-step)
3. [Experiments and results](#dd-experiments-and-results)
4. [What the ablations show](#dd-what-the-ablations-show)
5. [Limitations](#dd-limitations)
6. [What came after](#dd-what-came-after)

### The problem and its context

#### Why generating a reply takes repeated work

An autoregressive language model builds a reply by choosing a token, adding it to the text it has seen, and then choosing the next token from that longer context. A token is a unit from the model’s vocabulary. Depending on how text is divided, it can be a word, part of a word, or another unit. The important feature here is the dependency between positions. Before generating the next part of a reply, the system needs to know what the reply says so far. Ordinary decoding resolves that dependency by running the network again after each choice. The underlying operation begins with [tokenization](https://md.research.elamur.ai/free/en/concepts/tokenization/).

The authors focus on very large targets. Their motivating example, Llama-3.1-405B, has 405 billion parameters. In the small-batch setting they study, moving the data needed for a decoding step can be a greater constraint than performing the arithmetic on it. This is what the paper means by a memory-bound regime. A pass that checks several known token positions can make better use of that expensive movement than a pass devoted to a single new position. The opportunities depend on the workload and the implementation, a point the authors return to when they compare timing results. Their discussion draws on earlier work on the cost of [scaling transformer inference](https://md.research.elamur.ai/free/en/papers/pope-2022-efficiently-scaling-transformer-inference/).

Speculative decoding exploits the difference between choosing tokens and evaluating tokens whose identities are already known. A faster drafter handles the sequential work of proposing a continuation. The target gets the entire proposed block and evaluates its positions together. At each position the target sees the corresponding earlier draft tokens, so it can supply the probabilities that would apply if that part of the draft were taken as context. If a long initial stretch survives verification, an expensive pass has helped generate several tokens. This is the opportunity behind [Fast Inference from Transformers via Speculative Decoding](https://md.research.elamur.ai/free/en/papers/leviathan-2022-fast-inference-transformers-speculative-decoding/).

The original guarantee is about the distribution from which generation draws. A target can assign different probabilities to multiple reasonable ways of beginning an answer. Standard speculative sampling aims to ensure that adding a drafter leaves those probabilities intact. Under greedy decoding, where the highest-scoring option determines the choice, the relevant comparison is agreement with the target’s choice. Both settings create a distinction between what is acceptable to a reader and what the verifier is required to keep. A valid phrase can be a poor match for the target’s preferred phrase. An early disagreement can halt the whole draft even if a reader would have approved the complete answer.

#### Why a better draft can still be hard to use

The paper is motivated partly by improvements in smaller language models. The authors point to strong smaller systems in the GPT family, to the gains of Llama-3.1-8B over earlier versions, and to Phi-3-mini as another example of capability in a compact system. These examples make it plausible that a smaller network will often have enough ability to solve a request outright. They also sharpen the question facing the verifier. If the drafter can solve the task but tends to use a different opening, vocabulary or structure, improved capability alone provides little assurance that more of its tokens will be kept. The paper discusses these developments through [The Llama 3 Herd of Models](https://md.research.elamur.ai/free/en/papers/grattafiori-2024-llama-3-herd-models/) and the [Phi-3 technical report](https://md.research.elamur.ai/free/en/papers/abdin-2024-phi-3-technical-report-highly/).

An individual rejection matters because a draft is a sequence of dependent predictions. Imagine a response with a valid explanation after its opening. If verification rejects an early candidate and replaces it, the later explanation was proposed after a different prefix. The decoder cannot simply jump ahead to a token that happened to pass its local check. Its verification scores were computed in the context of the original draft, including the token that was rejected. More ambitious drafting is therefore useful only when enough of that earlier material can survive. The authors describe prior work as generally keeping draft blocks short, frequently using lengths from {5, 7} and mostly staying at M ≤ 7, where M is the block length.

This constraint affects two different costs. Drafting a long block takes time because the smaller network still generates its candidates sequentially. At the same time, a short accepted prefix means that the much larger network has to run again soon. Increasing the block length can shift work from the target to the draft, but only if the verifier regularly keeps enough of the extra material. The paper’s question about verification is thus also a question about what makes a longer block economical. A faster drafter helps with the cost of making the proposal. A more permissive yet discriminating verifier can change how much of the proposal survives.

#### Where earlier methods spent their effort

Some approaches described by the authors put the work into building a better drafter. Early systems used specialized networks or smaller versions of the target. Other approaches added shallow components to the target representation to predict several upcoming tokens. Several methods used part of the target itself to draft, for instance by skipping layers. The paper also describes proposals involving other architectures and systems that try to choose the draft length dynamically. The latter address the fact that the useful amount of speculation can vary from one point in the reply to another. The options discussed include [LayerSkip](https://md.research.elamur.ai/free/en/papers/elhoushi-2024-layerskip-enabling-early-exit-inference/) and [EAGLE](https://md.research.elamur.ai/free/en/papers/li-2024-eagle-speculative-sampling-requires-rethinking/).

Other methods try to raise the probability that a proposal passes the usual check. The paper describes training a drafter to agree more closely with the target, giving the drafter access to information from the target, and presenting the verifier with a tree of possible continuations. A tree can include several competing tokens after a prefix and then additional choices after each of those tokens. Parallel verification can look for an acceptable path through that larger collection. From the perspective of ordinary speculative sampling, such methods give a verifier with a fixed acceptance rule better candidates or more chances to find a match. The paper discusses tree-based work including [SpecInfer](https://md.research.elamur.ai/free/en/papers/miao-2023-specinfer-accelerating-generative-large-language/) and [Medusa](https://md.research.elamur.ai/free/en/papers/cai-2024-medusa-simple-llm-inference-acceleration/).

The other line of earlier work that matters here concerns judgment of finished replies. The paper describes studies in which a capable language model rates answers in a way that correlates with human judgments. An evaluator can recognize that an answer works even when it differs from the response the evaluator would produce itself. Bringing that ability to decoding presents a timing problem. An interactive judge can take a substantial instruction prompt and produce reasoning of its own before giving a verdict. A speculative verifier must make decisions about incomplete continuations while there is still time to gain from the draft. The paper takes its inspiration for the kind of judgment from [Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena](https://md.research.elamur.ai/free/en/papers/zheng-2023-judging-llm-judge-mt-bench/).

### The method, step by step

#### Read the proposal before judging it

The method begins with the same division of labor as ordinary speculation. The draft takes the current text and proposes a block. The target reads that proposed block in parallel. For any candidate, a standard probability check asks how likely that candidate looked immediately before it was read. The judge uses the internal state produced once the candidate itself has been read. The distinction matters when the candidate completes a claim or introduces an inconsistency. A next-token prediction describes what the network expects to see. Its state after consuming a candidate can carry information about what the candidate has done to the meaning of the continuation.

The authors investigate this distinction by forcing Llama-405B to continue from incorrect text. In a geographical example, they give it a prefix that wrongly identifies Berlin as the capital of France. The continuation retracts that assertion and identifies Paris. The appendix uses examples from code as well. In one, the continuation calls attention to an index variable that has no definition. In another, it recognizes that changing a list without making a copy has altered the original. These examples motivate a specific design. The hidden representation after a candidate may contain evidence that the system can use to recognize a mistake without generating the corrective explanation.

The authors train a classifier to use that evidence. It receives the last hidden representation at the candidate position and returns a score for the candidate. The target also calculates its usual next-token probabilities in the same pass. The decoder can then compare the score to a threshold and combine that decision with the original speculative decision. There is no extra answer for a separate evaluator to write. A run that reaches a candidate both checks decline resumes by using the target’s ordinary decoding machinery at that position.

One round of judge decoding The steps in order.

#### How forecasting and parallel verification fit together

The paper uses a distinction between drawing tokens sequentially and running a forward pass over a given sequence. To express it, let 𝒱 be the vocabulary, whose token identifiers run from 1 through V. V is the vocabulary size. The current context s consists of L tokens from 𝒱, where L is the length of the prompt and already committed continuation. Sampling from a language model given that context is written as follows.

```
(t₁, p₁), …, (tₘ, pₘ) = LLM⁽ᵐ⁾(s)
```

LLM denotes the language model used for the operation. The superscript ⁽ᵐ⁾ indicates that it generates m tokens in succession. Each tᵢ is the token drawn at position i of this continuation. Each pᵢ is a vector with V entries, one probability for each token in the vocabulary. The probabilities come from the model’s softmax output, which expresses its scores as a distribution. At position i, the conditioning text contains s and the generated tokens before tᵢ. Each pair records the choice along with the distribution that accompanied it.

With the identities of the continuation tokens supplied, the corresponding forward pass is written differently.

```
p₁, …, pₘ₊₁ = LLM(t₁, …, tₘ; s)
```

Here LLM is the same language model run over given tokens. The semicolon in the notation separates that continuation from its existing context s. The input continuation contains m tokens, t₁ through tₘ. The vectors p₁ through pₘ give the predictions that precede those tokens, and pₘ₊₁ gives the prediction after tₘ. There is one more distribution than there are proposed tokens. The first distribution depends on s alone. The final one is useful when the decoder keeps the entire draft and can draw a further token after it.

In a speculative round the draft produces a proposal of length M.

```
(c₁, q₁), …, (cᴍ, qᴍ) = LLM_draft⁽ᴹ⁾(s)
```

LLM_draft is the smaller drafter, M is the number of proposed tokens, and s is the committed context. The cᵢ are the candidates in the order proposed. Each qᵢ is the drafter’s probability vector for its choice at position i, conditioned on s and the earlier c tokens. An entry qᵢ[cᵢ] is the probability in that vector for the proposed candidate. The target can now process the same choices together.

```
p₁, …, pᴍ₊₁ = LLM_target(c₁, …, cᴍ; s)
```

LLM_target is the larger network being used for generation. The c tokens and s are the same inputs described above. The p vectors now come from the target. The entry pᵢ[cᵢ] is the target’s probability for the proposed token given the prefix before that token, and pᴍ₊₁ describes the distribution after the complete draft. The target obtains these vectors for the given proposal without waiting for the decoder’s separate acceptance decision at each position.

The original speculative check compares the target and draft probabilities for each candidate. In the paper’s notation, its local acceptance condition is the following, applied while the preceding candidates have passed.

```
εᵢ < pᵢ[cᵢ] / qᵢ[cᵢ],     εᵢ ∼ 𝒰([0, 1])
```

The symbol εᵢ is a random draw for position i. The notation 𝒰([0, 1]) means a uniform distribution from 0 to 1. The bracketed expressions select the entries for cᵢ in the target and draft vectors, respectively, and the slash forms their ratio. When the target assigns at least as much probability as the draft, the candidate passes the probability check. When the target assigns less, the ratio is the probability of passing. In the greedy verification diagnostics, agreement concerns the target’s preferred token. The paper attributes the distribution-preservation guarantee to the full standard speculative sampling procedure, including how it handles the first rejection.

The prefix rule is essential to interpreting both methods. Let m* be the number of draft candidates kept in a round. They are the first m* tokens of the block. At the first rejection, the target has a prediction conditioned on precisely the context that survived. The decoder uses the target machinery to supply a token at that position. If every candidate passes, it can instead use the prediction after the end of the block. The resulting text becomes the context for the next round. The outputs already computed at positions after a rejected token were conditioned on the original proposal, so their local decisions cannot justify appending those tokens independently.

#### Build training examples around the point of error

The classifier needs examples in which it can learn what changes at the onset of an error. The authors use newly written prompts and heavily filter two sources of existing prompts, Alpaca and ARC. They take questions from those sources and generate new answers for the training collection. Candidate answers come from several systems, including Mistral-Large-2, Llama-8B and Llama-405B. Drawing on different generators helps supply alternative styles and solutions. The design of the dataset gives the judge a chance to see correct answers expressed in ways that a single source might seldom use. One of the prompt sources is the [AI2 Reasoning Challenge](https://md.research.elamur.ai/free/en/papers/clark-2018-think-have-solved-question-answering/).

Each of the 500 collected items pairs a question with a correct answer and an incorrect answer. The authors check and edit the answers by hand. For a flawed answer they locate the mistaken material precisely enough to attach labels at token positions. They report that using language models to locate these mistakes was too imprecise for this step. Human review is part of how the paper defines its training target, since the score is supposed to reflect contextual acceptability even where the ordinary predictor would have preferred a different continuation.

The labeling procedure gives every token in a correct answer a positive label. It also gives positive labels to the part of a wrong answer that precedes the mistake. Tokens marked as erroneous get negative labels. That distinction is what lets a training item teach both acceptance and rejection. The opening of an incorrect solution can establish the problem correctly or take a useful first step. Labeling the entire answer as erroneous would erase the information that those earlier tokens were usable. Conversely, labeling only whether the answer eventually reaches a correct result would give the classifier no direct example of where an otherwise promising continuation becomes untrustworthy.

This construction produces approximately 20× as many positive as negative examples. A correct answer contributes positive labels along its length. An incorrect answer can contribute a substantial positive prefix and comparatively little marked error text. The resulting imbalance has a practical consequence. A classifier trained to do well on the majority of positions could learn to approve many tokens while giving too little attention to the ones that matter most for quality. The authors give negative labels greater weight in the cross-entropy objective. Cross-entropy penalizes the classifier when it assigns low probability to the label supplied in training. Increasing the negative weight makes an erroneous acceptance more costly during fitting.

A token label represents the authors’ decision about its role in that context. In the actual generation process, the same vocabulary item can occur inside a correct or an incorrect claim. The judge therefore receives the target’s hidden representation instead of an identifier for the token alone. This representation depends on the preceding text and the candidate. Training the head on those representations leaves the target’s own parameters fixed. The system learns how to read a signal from the larger network without changing the network that supplies the fallback predictions.

#### Fit a small classifier on the last hidden state

The authors use the representation from the target’s last layer before root mean square normalization and the language modeling head. Root mean square normalization is the named normalization operation at that point in the network. The language modeling head is the output component that turns the representation into scores over the vocabulary. The judge takes the representation along a second path and produces a single score. The paper describes this implementation as akin to adding one entry to the vocabulary output, because the extra operation can be carried out alongside a much larger prediction operation.

For the Llama-405B head the reported dimension is 16,384. For Llama-70B it is 8,192. The paper describes the small-scale training setup as fitting 16.4k parameters on 30k tokens in less than 1.5 hours. It uses AdamW, with learning rate 0.0001, weight decay 0.1 and training batch size 128. The learning rate sets the scale of the parameter updates. Weight decay is part of the optimizer’s regularization. A training batch is the set of examples used together in an update. The optimizer is described in the cited work on [Decoupled Weight Decay Regularization](https://md.research.elamur.ai/free/en/papers/loshchilov-2017-decoupled-weight-decay-regularization/).

The authors stop training early to limit overfitting and say that they use a small split they call a test split to tune hyper-parameters. They also try different depths for the input representation and more expressive classifier architectures. The adopted head is linear. Its score is passed through a sigmoid, which turns a real-valued score into a value between 0 and 1. A larger value makes the judge more willing to approve the token. The paper calls this an acceptance confidence. Its deployment role is to supply a thresholded decision about the current candidate.

#### Combine the decisions and commit the prefix

The judge’s local acceptance test is written as follows.

```
σ(f_judge(eᵢ)) > δ,     δ ∈ [0.5, 1]
```

The vector eᵢ is the target’s hidden representation after reading candidate cᵢ. It has D real-valued components, where D is the representation dimension for the target in use. The function f_judge is the trained linear head, and σ is the sigmoid applied to its score. The threshold δ can range from 0.5 to 1. The greater-than sign makes the test strict. The authors use δ = 0.5 in practice. They report that their evaluations gave them no need to tune it to maintain quality. Raising the setting makes the learned route harder to pass. At δ = 1, the judge adds no acceptances, so this construction returns to standard speculative decoding.

The target pass now provides a set of standard decisions and a set of learned decisions. The paper describes their combination as follows.

```
z = z_stand ∨ z_judge
```

Here z_stand and z_judge are masks with M entries, one per candidate position, and each entry is either 0 or 1. An entry of 1 marks acceptance under the corresponding check. The symbol ∨ means logical OR, applied at each position. The resulting mask z records a pass whenever either check gives its approval. The decoder examines that combined mask from the start of the proposal. The first position at which both checks decline the candidate ends the accepted prefix. Later entries in the mask are conditional on following the original draft and do not extend that prefix.

The appendix explains why accepting a token that passes only the standard check can save effort. Consider the case in which the judge declines a candidate that is also what the target would select. Stopping and asking the target to supply the next token would take the decoder to the same text. If similar cases occur in succession, it can arrive at the same continuation through repeated shorter rounds. The combined mask lets the already available standard decisions carry that run forward. The extra acceptances that distinguish judge decoding from standard decoding occur in the other direction, when the learned head approves candidates that the usual check would decline.

The resulting design leaves both paths to generation available throughout a reply. The target supplies tokens when the draft cannot be kept, and the learned score can preserve more of the proposed wording where it can be kept. There is no separate global judgment of the answer at the end of a round. The decision is attached to each candidate under the prefix in which it appears. That is how a head trained from full answers becomes part of a procedure that works on short, sometimes unfinished, pieces of text.

### Experiments and results

#### What the evaluations measure

The experiments ask whether judge decoding can keep more draft text, whether that leads to lower generation cost, and whether the change in the text harms performance. These questions use different measurements. Average acceptance length tells how many proposed tokens a round retains. A generation rate in tokens per second measures output over elapsed time under a particular implementation and hardware setup. A speedup factor compares a method with ordinary decoding under the reported conditions. Benchmark scores assess the answers produced. An increase in acceptance length is relevant to speed, while the task scores check whether the accepted continuations remain useful.

For quality the authors use GSM8K for math word problems, HumanEval for code, and MT-Bench for dialogue. They add the multiple-choice benchmarks ARC and MMLU. Multiple-choice prompts can require comparatively few generated tokens, so these tests principally extend the quality evaluation. They give less opportunity for a decoder to realize the same kind of generation savings it can show on a long response. The authors use the prompting templates from the Llama report. The benchmark sources include [Training Verifiers to Solve Math Word Problems](https://md.research.elamur.ai/free/en/papers/cobbe-2021-training-verifiers-solve-math-word/) and [Evaluating Large Language Models Trained on Code](https://md.research.elamur.ai/free/en/papers/chen-2021-evaluating-large-language-models-trained/).

The main quality figure compares Llama-8B drafting for Llama-70B and for Llama-405B. For each target the authors show results alongside the ordinary draft and target and include both standard speculation and a relaxed baseline. The figure labels standard speculative decoding with M = 10 and judge decoding with M = 25. These are proposed block lengths. They do not say how many tokens the methods actually keep. The authors also report a separate experiment fixing the coding evaluation and varying whether code is present in the judge’s training material. The additional multiple-choice coverage includes [MMLU](https://md.research.elamur.ai/free/en/papers/hendrycks-2020-measuring-massive-multitask-language-understanding/).

#### Which drafts survive verification

The draft-length experiment for Llama-8B and Llama-405B examines average output from a speculative round on MT-Bench and GSM8K as the draft grows. With standard verification, the useful length levels off quickly. That pattern is consistent with many rounds encountering a disagreement near the beginning. Proposing still more text after those early positions adds work for the draft without regularly increasing how much the decoder gets to keep. With the judge available, longer proposals more often translate into longer accepted runs. This comparison shows why changing the verification rule can make a different portion of the draft-length range worth using.

The authors also use GPT-4o to ask whether an especially capable writer passes the usual verification test more easily. GPT-4o produces complete answers for MT-Bench, GSM8K and HumanEval. Llama-405B checks the candidates under greedy verification. The experiment counts how far it gets before the first rejection. The authors use this procedure because GPT-4o is closed and they cannot run the full speculative sampling protocol with it. Standard verification keeps only roughly two tokens on average in the reported diagnostic. The judge accepts longer prefixes across the tested datasets. In the illustrated response, it approves the full correct answer, while the usual check stops after two words. The average uses tokens as its unit, whereas the description of that example uses words.

A complementary comparison swaps the roles of the Llama systems. Llama-405B drafts and Llama-8B verifies under standard speculative decoding. The paper reports a slight reduction in accepted length when the roles are reversed. This experiment uses the actual speculative process and points in the same direction as the GPT-4o diagnostic. The authors interpret the comparisons as evidence that drafting a higher-quality answer is insufficient to raise acceptance when it also changes how the answer is phrased or what the verifier expects to see. The reversed setup serves as a diagnostic of that dependence, since the larger drafter gives up the intended cost advantage of ordinary speculation.

The human-text comparison uses a subset of the wikipedia-summary dataset. The decoder receives a request for information about an article’s topic, with the article abstract supplied as the candidate answer. The examples in the appendix illustrate that a human-written answer can run into an early greedy disagreement with Llama-405B. Judge decoding increases average accepted length on these candidates as well. The result concerns acceptance of existing text. It supplies a source of candidates distinct from the systems that generate the main experimental drafts. It also reinforces the distinction between a verifier reacting to valid content and a verifier requiring that content to be expressed along its own preferred path.

#### Quality after relaxing verification

The paper’s training-free comparison is top-K verification. This rule accepts a proposed token if its score places it among the K highest target predictions at that position. K is the number of ranked options allowed. The source of these predictions is the prefix before the candidate, so the rule looks at where the token ranks as a next choice. In the greedy comparison, K = 1 gives the standard matching rule. At the other extreme, K = V allows the whole vocabulary and leaves generation to the draft. Increasing K is therefore a straightforward way to give the drafter more freedom.

Judge decoding stays close to the target-alone benchmark scores for both larger Llama targets in the paper’s quality comparison. The authors connect this result with runs that can accept up to approximately 20 draft tokens on average. Top-K is much less effective at retaining the target’s quality. The authors report that it barely improves over the drafter even for K = 5. Moving further down the prediction ranking admits more choices, but the ranking does not directly measure what happens when an individual candidate is incorporated into the continuation. The comparison shows the value of the selected learned signal relative to the particular rank heuristic tested.

The code-domain control makes the quality tradeoff visible in exact numbers. The authors retrain the Llama-405B head after removing the coding examples from the judge data and then test on HumanEval. The Llama-8B drafter is a useful baseline because it shows where code quality starts without the benefit of those Llama-405B judgments and fallback decisions. The full-data head yields 86.6% on HumanEval. The head trained without coding examples yields 80.4%, and the draft alone yields 71.3%.

HumanEval score with full judge training, coding examples removed, and the draft alone Removing coding examples lowers judge decoding’s score, which remains above the draft-alone baseline.

**The numbers**

| System or setting | HumanEval score % |
| --- | --- |
| Llama-8B draft alone | 71.3 |
| Llama-8B/405B judge trained without coding examples | 80.4 |
| Llama-8B/405B judge trained with the full dataset (this paper) | 86.6 |

#### Speed in the two inference frameworks

The speed tests use HuggingFace and gpt-fast for different views of generation cost. HuggingFace provides a comparison with the setting used in much of the previous work discussed by the authors. The gpt-fast setup includes more inference optimization. Its reported generation throughput uses 512 input and output tokens with 8-bit quantization, and the speed table covers batch size 1. Llama-70B runs on 2 H100 GPUs and Llama-405B runs on 8 H100 GPUs in the authors’ setup. The paper identifies the node’s GPUs as H100-SXM5s and explains that quantization allows the larger target to fit on the node. These measurement conditions matter when reading the reported rates for [HuggingFace Transformers](https://md.research.elamur.ai/free/en/papers/wolf-2020-transformers-state-art-natural-language/).

For Llama-70B paired with the Llama-8B drafter, the stated challenge in a less optimized framework is the relatively small latency gap between the two networks. A head attached to a target can produce proposals cheaply, whereas a standalone drafter needs its own sequence of evaluations. As framework bottlenecks are reduced in gpt-fast, the authors report a more favorable difference between draft and target latency for their method. The abstract reports up to 141 tokens/s for the 8B/70B judge in that framework on 2 H100s. The result describes the full decoding configuration under that setup, including the cost of getting the Llama-8B proposals.

With Llama-405B as the target, the larger cost of verification makes long accepted runs especially valuable. The 8B/405B judge takes in approximately 20 tokens per batch and reportedly reaches 9.7× speedup over ordinary decoding in HuggingFace. In gpt-fast the corresponding reported generation rate is 129 tokens/s on 8 H100s. The authors characterize the accepted length in this setting as >3× that of the prior systems they discuss in the speed comparison. They attribute the short proposal depth of the Medusa and Eagle-2 settings to the number of draft heads or the depth of the tree, and describe them as drafting ≤ 6 tokens ahead in the configurations discussed.

The paper gives earlier examples of framework sensitivity to explain why the labels on these numbers matter. It cites an EAGLE speedup on Llama-2-7B that goes from 3× in the less optimized setting to 1.5× in gpt-fast. It also reports about 45 tokens/s for ordinary Llama-70B in gpt-fast compared with about 33 tokens/s for Eagle-2 on the same model in HuggingFace. Those figures compare different implementations and illustrate the importance of the inference stack. The speed table also flags a Medusa measurement using H200 hardware, NVLink Switch and TensorRT. Those differences matter when comparing systems with different ways of drafting, quite apart from the correctness check itself.

### What the ablations show

#### A ranking shortcut does a different job from the learned head

The top-K experiment controls for a simple explanation of the quality results. Perhaps standard verification is so selective that almost any broader acceptance rule could keep enough acceptable text to speed up decoding while retaining the target’s performance. The rank-based baseline gives that possibility a concrete test. It keeps the target’s usual prediction scores and changes which ranks are allowed. A high-ranked candidate may be a plausible next token, but that ranking is computed before the verifier has read the token as part of the proposal.

The learned head, in contrast, makes its decision from a contextual representation that includes the candidate. Its advantage in the benchmark comparison shows that the tested way of relaxing the rule matters. Allowing the next few target choices is insufficient to reproduce the judge’s quality results. This comparison is between complete verification designs. The tested methods differ in training, input and decision rule, so the result does not isolate the effect of any single feature of the head. The supporting case for the representation comes from the forced-prefix examples and the layer comparison.

#### Deeper representations were more useful in the authors’ tests

The authors try representations from different layers. Those taken sufficiently deep in the target work better than shallow ones, while differences among the deeper options are described as small. Their choice of the last representation before normalization and the output head therefore uses a convenient point in an already executed computation. The result gives a practical basis for the selected layer. In combination with the forced-prefix examples, it supports the idea that the late representation carries information useful for deciding whether the current continuation is acceptable.

The illustrative corrections make clear what information would be useful. The target can keep generating after an erroneous prefix in a way that exposes its inconsistency or repairs it. The judge needs only a signal that helps reject the problematic candidate at the relevant position. In the code examples, recognizing a missing definition or a change to the wrong data structure would be useful even when a complete verbal explanation would take many more tokens. The experiments use the explanations as visible evidence of the target’s reaction. They obtain the fast decision from the representation available before such an explanation is generated.

More elaborate heads were another design option. The authors try multilayer perceptrons and shallow [Transformer](https://md.research.elamur.ai/free/en/concepts/transformer/) networks and report that the linear classifier works best in their setup, with favorable behavior on overfitting. The empirical point is about the combination of a capable target representation and the particular labeled dataset. Additional head capacity did not yield a better choice in the authors’ trials. The paper gives these architectural comparisons qualitatively, with no per-layer or per-head numerical breakdown. It therefore supports the stated design choice without establishing how much a different layer or architecture would cost in benchmark performance.

#### Removing code examples tests transfer

The HumanEval comparison changes the data available to the judge while holding the evaluation task and the Llama-405B target fixed. This is a useful control because the target still has the same underlying code capabilities. What changes is whether the head learns from examples of where coding answers are acceptable or go wrong. The decline from the full-data result indicates that the training labels contribute something specific to this evaluation domain. The result above the draft’s score indicates that the reduced-data setup still provides value on code.

That last comparison is about the system as a whole. The out-of-domain version combines a learned signal with standard verification and target fallback. Its performance above the standalone draft does not measure how often the learned head alone identifies a coding error. It shows how a judge trained without coding examples behaves when inserted into the full decoding procedure. The transfer conclusion is therefore most directly about useful end-to-end behavior under one change to the training data. It does not give a task-independent measure of how accurately a hidden representation exposes the moment of a coding error.

#### Examples show both kinds of boundary decision

The appendix pairs correct and incorrect responses to illustrate what happens at the accepted-prefix boundary. In one kind of example, standard verification stops early in a correct response, and the judge allows much more of it to continue. The authors also show an instance in which the judge later rejects cautiously even though the response is correct. This shows how a learned verifier can improve the placement of the boundary without permitting each valid draft to run to completion. With prefix-based verification, a conservative decision can protect response quality and can also shorten a usable draft.

An incorrect response illustrates a different effect. Standard decoding rejects the proposal earlier, at a point that has not yet made the relevant mistake. The judge allows the initial stretch and then declines it when the incorrect material appears. The distinction shows what the labeling scheme was designed to teach. An incorrect final answer can contain a useful prefix. An early disagreement tells the reader that the predictors diverged there, whereas a later learned rejection can correspond more closely to the point at which the answer goes wrong.

The mask discussion supplies a third kind of boundary case. When the learned head rejects a token that the standard path would already keep, taking the union can spare a new round that would lead back to the same prefix. The authors say this case arises occasionally and connect it with the head’s deliberate caution about approving questionable tokens. The paper illustrates the effect through individual decisions. It gives no standalone throughput measurement for removing the standard mask, so the example explains the mechanism without assigning a numerical share of the total speedup to it.

### Limitations

#### Limits the authors state

The authors identify the loss of distribution preservation as the central tradeoff. Standard speculative sampling is designed to generate according to the target’s distribution. Once the learned check can approve a candidate outside the standard acceptance decision, that property is lost. The paper’s benchmark results establish that measurable task quality stays near the target in the tested settings. The two properties answer different questions. A system can solve as many tasks while using other wording, choosing different solution paths or producing a different mix of answers. The experiments validate the first kind of outcome to the extent captured by the reported benchmarks.

The authors also require a sufficiently capable draft and target. A strong target cannot make long speculative runs economical if the draft regularly becomes unusable after a short prefix. This is why the authors are cautious about extending the long-draft strategy to small auxiliary heads or self-speculation arrangements whose proposals deteriorate deeper into the block. The target has a different responsibility. Its internal states need to furnish useful judgments. The authors expect speedups with a small target such as Llama-8B to be harder to obtain. Their main evidence comes from the Llama-70B and Llama-405B targets.

The paper explicitly limits claims about new tasks. Training data similar to the intended task helps the system stay at target quality. HumanEval is the example in which an entire kind of training material is set aside. The quality decrease when coding examples are removed grounds that qualification in a controlled comparison. The authors emphasize that the dataset required for their experiments is small by their account. Its construction still includes careful review, correction of responses and localization of mistakes. A different task can require new decisions about what constitutes an error and how early it can be identified in an incomplete response.

Safety is a separate concern acknowledged by the authors. A draft may produce a safety-critical continuation that the target would have avoided under ordinary decoding. The additional path can permit such a candidate to pass. The authors report seeing no such issue in their experiments and say that they did not investigate it thoroughly. The evaluation of general task scores supplies limited evidence about behavior on that separate class of prompts. The concern follows from the same mechanism that enables the speedup. The draft sometimes determines wording that the target would otherwise have declined.

#### What the experimental setup leaves open

The paper reports benchmark performance for complete responses and average acceptance lengths for generation. Averages cannot characterize all the places where the verifier makes different choices. For example, they leave open how frequently it mistakenly accepts an erroneous candidate, how often it needlessly rejects an acceptable candidate, and whether these outcomes concentrate in particular parts of answers. End-to-end performance can also reflect later recovery or successful fallback after a poor proposal. It therefore supplies a broad quality check instead of a direct measurement of every decision made by the head.

The paper’s training description also limits what one can say about performance on the token-labeling task itself. It reports tuning hyper-parameters on a small split termed a test split. Whatever the name, a split used to choose settings informs those choices. The downstream benchmarks are the reported tests of practical effectiveness. The architectural descriptions and illustrative cases do not establish the calibration of the sigmoid scores or show how a threshold chosen on one kind of prompt would behave across a wide range of other prompts. The standard-decoding endpoint at δ = 1 is a property of the decision rule. Quality at intermediate thresholds remains an empirical matter.

The high-quality draft diagnostics answer a specific question about agreement. The GPT-4o check and the Wikipedia check examine greedy matching with text already available. They show that a strong machine-generated or human-produced answer can diverge early from the next token the target prefers. Their acceptance lengths do not give throughput for deployments that use those sources as live drafters. The converse Llama experiment tests ordinary speculation with a large drafter and smaller target, a pairing chosen to investigate acceptance. The economical operating point for judge decoding is instead tested with Llama-8B drafting for the larger Llama targets.

The timing claims have equally specific conditions. Batch size 1, the measured input and output lengths for gpt-fast, the choice of hardware, and quantization all affect how much time can be saved by reducing target calls. A deployment with a different balance of drafting cost and verification cost might make a different draft length useful. The comparison between HuggingFace and gpt-fast in the paper is itself evidence of how much the software setting matters. Likewise, the 141 and 129 tokens/s figures describe different targets on different GPU counts. They are specific performance measurements for the setups in which the authors obtained them.

Finally, localization is easiest to interpret in examples with a recognizable point of error. The capital example, the undefined variable and the mistaken modification all give a reader a place to look for the onset of a problem. Other mistakes might become apparent only when more of the continuation is known. A decision based on the current token and preceding text has access to that partial record. The paper makes a strong case that this much context can be useful. Its design and evaluations leave open how to best handle cases in which decisive evidence comes after the point that verification would have to judge.

### What came after

#### Surveys and lossless decoding

The later papers that cite judge decoding pursue several of the design choices that its experiments bring into view. Some examine verification itself. Others seek longer or cheaper proposals while retaining lossless decoding. A survey places efficiency work in the broader setting of language-model reasoning. The titles identify the direction each work takes. They give a basis for relating the projects to judge decoding, with implementation details and comparative results left to the individual papers.

[Harnessing the Reasoning Economy](https://md.research.elamur.ai/free/en/papers/wang-2025-harnessing-reasoning-economy-survey-efficient/) surveys efficient reasoning for large language models. Its connection to judge decoding is the cost of producing a response that contains a sequence of reasoning steps. Judge decoding treats faster generation as a joint question about which work the drafter can supply and what evidence the verifier can use to keep it. A reasoning-efficiency survey gives that question a broader context than the speed of an individual forward pass. The cited work is a survey of the area, and its title describes an organizing scope instead of an extension of the learned head.

[LongSpec](https://md.research.elamur.ai/free/en/papers/yang-2026-longspec-long-context-lossless-speculative/) takes up speculative decoding for long contexts, with efficiency assigned to both drafting and verification. Its title specifies a lossless objective. That makes it a useful point of comparison with the guarantee discussed by Bachmann and colleagues. If preserving the target’s behavior is part of the objective, efficiency gains must be obtained under that constraint. Judge decoding studies the opportunity that opens when a verifier can also accept contextually adequate alternatives. LongSpec’s stated focus illustrates how the costs of the same two phases remain important in a setting that retains losslessness.

[LogitSpec](https://md.research.elamur.ai/free/en/papers/liu-2026-logitspec-accelerating-retrieval-based-speculative/) focuses on retrieval-based speculative decoding and names next-next-token speculation as its route to acceleration. The point of contact is the amount of useful text that can be proposed per round. Judge decoding starts with a drafter able to write longer sequences and tries to make the verifier use more of them. LogitSpec’s title places the emphasis on how retrieval-based speculation proposes further text. Those are complementary questions about the same loop. Better proposal coverage can help a verifier encounter usable continuations, and a verifier’s acceptance behavior determines how much of the proposed text turns into generated output.

#### What the verifier looks at

[From Tokens to Steps](https://md.research.elamur.ai/free/en/papers/purohit-2026-tokens-steps-verification-aware-speculative/) frames speculative decoding around verification-aware generation for multi-step reasoning. Its title shifts attention from individual token decisions to the steps that make up a reasoning process. That directly relates to a tension in judge decoding. A superficially plausible token can be part of a mistaken step, and an unusual token can be part of a correct one. Judge decoding uses the target’s representation at the token position and trains with the location of the mistake in view. The later work’s stated emphasis is on the reasoning step as a level at which to consider verification.

[MARS](https://md.research.elamur.ai/free/en/papers/song-2026-mars-unleashing-power-speculative-decoding/) puts margin-aware verification at the center of its approach. It shares with judge decoding the choice to make verification a subject of design instead of treating it solely as a fixed endpoint for improvements to the draft. The approaches are identified by different signals. Judge decoding reads the hidden state after a candidate and trains a head from annotated answers. The MARS title identifies margins as the focus of its verification. The citation connects two efforts to decide what information should influence acceptance, without by itself establishing a shared architecture or training procedure.

#### How candidates are chosen or adapted

[Training-Free Adaptive Speculative Decoding via Linguistic Priors](https://md.research.elamur.ai/free/en/papers/wang-2026-training-free-adaptive-speculative-decoding/) describes an adaptive approach that uses linguistic priors and requires no training. It connects to the question of what evidence can guide speculation without the task-specific annotation used for the judge. The original paper already tests one training-free relaxation, the top-K rule, which uses target rank. The later title points to linguistic priors as another source of guidance. The relevance is the design choice between learning an added signal from annotated behavior and bringing an available prior to the decoding process.

[Calibrated Speculative Decoding](https://md.research.elamur.ai/free/en/papers/zhouxuwen-2026-calibrated-speculative-decoding-frequency-guided/) names frequency-guided candidate selection as its approach to efficient inference. The point of intervention identified in the title is candidate selection. Judge decoding’s main intervention happens after candidates arrive, when the target decides what it can keep. A method that changes which candidates are considered addresses another cause of wasted work. If the candidate set changes, the verifier can encounter a different range of continuations even under the same selection rule at verification time. The citation thus connects work on proposing useful alternatives with work on deciding when a proposed alternative is good enough to commit.

## Cite

Cite as Gregor Bachmann, Sotiris Anagnostidis, Albert Pumarola, Markos Georgopoulos, Artsiom Sanakoyeu, Yuming Du, Edgar Schonfeld, Ali Thabet and Jonas Kohler. 2025. Judge Decoding: Faster Speculative Sampling Requires Going Beyond Model Alignment. arXiv:2501.19309.

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.48550/arxiv.2501.19309](https://doi.org/10.48550/arxiv.2501.19309) · [arXiv 2501.19309](https://arxiv.org/abs/2501.19309)

```bibtex
@misc{bachmann2025judge,
  title = {{Judge Decoding: Faster Speculative Sampling Requires Going Beyond Model Alignment}},
  author = {Gregor Bachmann, Sotiris Anagnostidis, Albert Pumarola, Markos Georgopoulos, Artsiom Sanakoyeu, Yuming Du, Edgar Schonfeld, Ali Thabet and Jonas Kohler},
  year = {2025},
  doi = {10.48550/arxiv.2501.19309},
  eprint = {2501.19309},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.48550/arxiv.2501.19309}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
