DoLa: Decoding by Contrasting Layers Improves Factuality in Large Language Models
Paper · 2023 · Yung-Sung Chuang, Yujia Xie, Hongyin Luo et al.
Summary
A language model can give a fluent answer to a factual question and still choose the wrong name, place, or date. DoLa addresses that problem at the point where the answer is written. Its authors ask whether the successive layers of a large language model already produce signals that would favor a better answer if the decoder used them differently. Their method compares an earlier prediction with the final prediction for the same position in the text. It changes how the system selects a continuation using the weights it already has, without fetching documents or performing additional fine-tuning.
The idea is easiest to see in the paper’s example about Washington’s capital. Seattle remains a plausible continuation across layers. Olympia, the correct answer, receives increasing support as the computation proceeds. Ordinary decoding uses the distribution at the final layer. DoLa also considers how that distribution was reached. In a preliminary examination of LLaMA-7B, predictions for parts of names and dates could still be changing near the end of the network. Predictions for function words and material copied from the question often settled around the middle. That difference gives the authors a reason to make the comparison anew at every position.
At each step, DoLa reads out next-token probabilities from the last layer and from a group of earlier candidates. It uses Jensen–Shannon divergence to choose the candidate whose overall distribution differs most from the final one. For each possible continuation, the decoder then subtracts the earlier log probability from the final log probability. This favors tokens whose support has grown through the later computation. A filter keeps the choice within the candidates that the final layer already treats as plausible. The same network supplies both sides of the comparison in a single forward pass.
The headline result comes from open-ended TruthfulQA. Across the LLaMA sizes tested, DoLa improved the combined truthfulness and informativeness score by 12-17% in absolute terms. Multiple-choice TruthfulQA and FACTOR also generally improved. The reasoning tasks showed smaller gains, with differences across sizes, and a GPT-4 judge generally preferred DoLa in the open-ended chat comparison. The timing study found a small increase in greedy decoding time. The paper also shows the boundary of the technique in an individual answer. A decoder that draws more readily on internal information can replace an abstention with a detailed error. DoLa gives the system a different way to use its existing knowledge, so its factual reach still depends on what the system learned.
Deep dive: DoLa: Decoding by Contrasting Layers Improves Factuality in Large Language Models
DoLa changes how a language model chooses its next token by comparing layers, improving factual answers without retrieval or further training. · about 39 minutes to read
The problem and its context
From a likely continuation to a factual answer
Producing a natural sentence and giving the right answer to a question can demand different things from the same prediction. Consider the point in a sentence where a capital city should appear. Several cities may fit the grammar, belong to the right region, and occur in similar discussions. Only the city that stands in the requested relationship answers the question. A system that has learned both kinds of regularity can assign substantial probability to several continuations. The decoder has to choose among them, and a mistake can leave the sentence sounding as natural as a correct answer would.
The paper calls this kind of failure a hallucination when the generated claim departs from facts encountered during pretraining. In legal or clinical use, the authors argue, the ability to write convincingly makes accuracy especially consequential. Better performance across language tasks can coexist with factual errors. The paper situates the problem alongside work on the capabilities that appear with scale and a survey of how hallucinations arise in generated text. Emergent Abilities of Large Language Models and Survey of Hallucination in Natural Language Generation.
The authors offer a possible explanation in the training objective. Maximum-likelihood training teaches a language model to assign probabilities to the text it observes. The paper describes this objective in terms of forward Kullback–Leibler divergence, a way of comparing the distribution of the data with the distribution learned by the system. The objective encourages the learned distribution to cover the kinds of text represented in the data. The authors suggest that this tendency can leave some probability on continuations that fit familiar patterns while conflicting with facts represented elsewhere in the training material.
A related explanation concerns what can be learned from finite text. Familiar wording may be a reliable clue for predicting the next word across many examples. Depending on the question, following that clue can give the wrong answer even when the system has encountered the relevant fact. These are possible accounts of why a prediction goes wrong. DoLa’s experiment asks a narrower question that can be tested without settling the cause. Given a trained network and a fixed prompt, can information from inside the prediction process improve the answer that comes out?
Why compare depths within the same network?
A transformer produces a succession of internal representations. Each layer receives a state produced by the earlier computation and passes on a revised state. This architecture makes it possible to ask how much of a later prediction could already be read from an earlier state. The paper draws on interpretability research that examines the kinds of linguistic and factual information associated with different depths.
One study discussed by the authors found a progression in BERT from tasks associated more closely with syntax towards tasks bearing more on meaning. Other findings reviewed in the paper qualify how broadly such a progression can be applied. The location of a signal can depend on the training objective and on the task used to measure it. The broad implication for DoLa is that the layers need not give equivalent accounts of the same input, and that their differences can be informative. BERT Rediscovers the Classical NLP Pipeline.
Studies of factual associations gave a more direct motivation. The paper describes one line of research that identified units linked to knowledge in upper BERT layers. It also describes work in which intervening on particular feedforward layers changed the factual association produced by an autoregressive system. A decoder can take a different approach to such structure. It can read out what the earlier and later states imply for the same continuation, then use that comparison without editing the internal representation or the weights. Locating and Editing Factual Associations in GPT.
The distinction between an internal state and the prediction read from it matters here. An earlier state might already carry information that the shared output head cannot readily express at that depth. Conversely, a candidate rises in the final readout when some later computation makes it easier for that head to favor. The paper uses the observable change in probabilities. Its motivating account is that these changes can reflect factual information becoming influential late enough for the comparison to pick it up.
The capital-city illustration gives this motivation a concrete shape. Seattle has substantial support early and retains support as the computation goes on. Olympia has a different trajectory. Its support increases in later layers. The authors suggest that Seattle fits the surrounding language and is therefore easy to propose, while identifying Olympia depends more strongly on the factual relationship. A decoder using the trajectory has a reason to give Olympia more weight even if Seattle continues to look superficially credible.
Where earlier interventions act
The paper describes several ways to reduce factual errors. Training with human feedback changes the system before deployment. Retrieval can bring information into the input at answer time. Other inference-time methods examine whether different generations agree or have systems debate an answer. A further approach, inference-time intervention, draws on supervised truthfulness information. These methods use different evidence and intervene at different stages, from training to the processing of a particular response. Training Language Models to Follow Instructions with Human Feedback and Encouraging Divergent Thinking Through Multi-Agent Debate.
Retrieval is especially relevant because it addresses a question that layer comparison leaves to the pretrained weights. An answer formed with retrieved material can draw on text supplied for the current request. DoLa’s evidence consists of predictions that the existing system makes for the same context. Both operate during inference, but their sources of evidence differ. The retrieval research in the paper covers approaches that bring external text into the system’s processing, including approaches that place retrieved material in context. Atlas and In-Context Retrieval-Augmented Language Models.
The closest decoding precedent is Contrastive Decoding, abbreviated CD. It uses a stronger predictor as an expert and a weaker one as an amateur. A continuation receives credit for support from the expert and a deduction for support from the amateur. The original motivation, as the DoLa paper presents it, was to improve fluency and coherence. The choice of amateur affects which tendencies are subtracted from the expert’s prediction. DoLa applies that logic to text generation inside a single transformer. An earlier readout serves as the comparison, and its depth can change with the text being written.
The paper also discusses related uses of contrast. Context-aware decoding changes the comparison to emphasize the evidence in the input, with applications to summarization and knowledge conflicts. Autocontrastive Decoding, a concurrent approach, also compares predictions across depth. As described in the paper, it trains prediction heads for early layers of smaller systems and pursues diversity and coherence. These distinctions give the comparison a concrete meaning in each method. A contrast can emphasize what comes from context, what distinguishes a stronger predictor from a weaker one, or what becomes more probable between two points in the same network. DoLa tests the last of these as a route to greater factual accuracy.
The method, step by step
Read the same position at different depths
Generation proceeds by extending a prefix. The prefix includes the prompt and whatever the system has generated so far. At a given step the system assigns probabilities to possible next tokens. A token is a unit in the system’s vocabulary. A name or date may occupy several positions, and each of those positions triggers a separate prediction. The choice made now becomes part of the evidence used for the next choice.
The prefix is first converted into vectors by the embedding layer. The transformer layers successively update a sequence of vectors representing it. At the end, a vocabulary head produces a score for each possible next token. This head is an affine transformation, meaning it maps the representation to vocabulary scores through a linear transformation and an offset. The scores are called logits. Applying softmax turns them into a probability distribution. It gives higher scores higher probabilities and normalizes the results so the probabilities cover the full vocabulary.
DoLa also attaches that same readout to selected earlier states. The paper relates this operation to early exit, where a prediction is read before reaching the last layer. In DoLa, the earlier readout supplies one side of a comparison and the forward pass continues through the final layer. Both probability distributions refer to the same vocabulary and the same prefix, so the decoder can compare them token by token.
The paper points to residual connections as a reason an existing vocabulary head can give informative readouts at several depths. The connections let a layer update a representation that continues forward through the stack. In the authors’ account, this makes it reasonable to look for gradual changes in what the head can read from that representation. In practice, DoLa reuses the pretrained head and leaves the underlying computation intact. Deep Residual Learning for Image Recognition.
How DoLa chooses the next token
The steps in order.
The earlier readout that Dola uses is called the premature layer. The final layer is called the mature layer. These names describe their roles in the calculation. The early score is a comparison point, and the final score supplies both the upper end of the contrast and the test of whether a token is plausible. The mature layer stays fixed across positions. The premature layer is selected again after each change to the prefix.
The ordinary and early predictions
Using the paper’s notation, the embedding layer produces the following sequence.
H₀ = {h₁⁽⁰⁾, …, hₜ₋₁⁽⁰⁾}
Here H₀ is the sequence of representations at the embedding stage, indexed by 0. Each h is the embedding at one token position. The subscripts 1 through t − 1 run from the first observed position to the end of the prefix, and the ellipsis stands for the intervening positions. The superscript in parentheses identifies the depth. The index t refers to the next position, whose token is still to be decided.
The transformed sequence Hⱼ at layer j is obtained by processing the preceding representations through the stack up to that layer. The paper writes the ordinary probability of a proposed next token as follows.
p(xₜ | x₍<t₎) = softmax(ϕ(hₜ⁽ᴺ⁾))ₓₜ, xₜ ∈ 𝒳
The left-hand side gives the probability p of token xₜ given the prefix x₍<t₎. The vertical bar denotes conditioning, and the subscript <t refers to the positions before t. The symbol hₜ⁽ᴺ⁾ denotes the representation used to predict position t after layer N, with N the final layer index. This prediction is computed from the prefix. The symbol ϕ denotes the vocabulary head, and softmax converts its score vector into probabilities. The subscript xₜ on the resulting vector selects the entry for that token. The membership symbol ∈ says that xₜ belongs to the vocabulary 𝒳.
The equivalent readout for a candidate earlier depth is written this way.
qⱼ(xₜ | x₍<t₎) = softmax(ϕ(hₜ⁽ʲ⁾))ₓₜ, j ∈ 𝒥
Here qⱼ is the next-token distribution read from depth j, and qⱼ(xₜ | x₍<t₎) is the entry for token xₜ under the current prefix. The representation hₜ⁽ʲ⁾ is the corresponding prediction state at that depth. The head ϕ and the softmax operation are shared with the final readout. The set 𝒥 contains the earlier depths eligible for selection, so j ∈ 𝒥 means this calculation is made for a candidate. The same notation q can be used with N as its index to refer to the final distribution.
Sharing the head gives the operation much of its simplicity. For any candidate layer, it yields a full distribution over the same token inventory as the ordinary prediction. The layer comparison therefore asks what changes when the same readout is taken at another point in the computation. The resulting distributions can disagree about individual tokens, or about how concentrated the prediction should be across many tokens.
Find the earlier distribution that differs most
The preliminary LLaMA-7B study gave the authors a reason to vary the comparison layer with the position. This version of LLaMA has 32 layers. For a question whose answer involves Wole Soyinka and 1986, the paper examines how early readouts differ from the final one as the response takes shape. When the system is producing parts of the name and the year, the difference can remain substantial at relatively late depths. Function words and tokens from phrases already present in the question show another pattern. Their distributions can approach the final one by the middle of the network.
A fixed layer would always compare from the same depth even when the prediction evolves differently from one position to the next. DoLa instead treats the prefix as the condition for a fresh layer comparison. To carry it out, the authors use Jensen–Shannon divergence, abbreviated JSD. It measures how much two probability distributions differ. Here the inputs are entire vocabulary distributions. A layer can be selected because probability shifts across a collection of alternatives, even if the two readouts happen to rank the same token first.
d(qₙ(· | x₍<t₎), qⱼ(· | x₍<t₎)) = JSD(qₙ(· | x₍<t₎) ∥ qⱼ(· | x₍<t₎))
The function d gives the distance used for selection. The subscript ₙ in this formula denotes N, the mature layer, and j denotes a candidate earlier layer. The dot means that q is evaluated over all vocabulary entries instead of at a particular token. Both distributions are conditioned on the same prefix x₍<t₎. JSD denotes Jensen–Shannon divergence, and the double vertical bar separates its distribution arguments in the paper’s notation.
The decoder chooses the index that gives the largest divergence within the candidate set.
M = argmax(j ∈ 𝒥) JSD(qₙ(· | x₍<t₎) ∥ qⱼ(· | x₍<t₎))
Here M is the selected premature layer index. The argmax operator returns the index j that attains the largest value of the expression following it. The allowed j are the members of 𝒥. The mature distribution qₙ and the prefix x₍<t₎ stay the same for every comparison at that step. Each qⱼ supplies the distribution of a different eligible depth, with the dot again indicating all possible tokens. At the next step the prefix changes, so both the divergence values and the chosen M can change.
Selecting a large divergence gives the decoder a substantial change in readout to work with. The criterion has no access to a known answer. It uses the two predictions as they stand before the next token is chosen. The claim that this difference can bring factual information forward comes from the motivating observations and the evaluation. JSD itself reports the size of a distributional disagreement.
There are two different choices of scope within this scheme. A validation procedure chooses which group of layers is eligible for a task. A computation at generation time chooses a layer from that group for each token. The validation decision controls how early or late the comparison is allowed to start. The token-level decision responds to whichever distribution within that range differs most from the final one.
Take the contrast and preserve plausible alternatives
After selecting the layer, the decoder turns the two vocabularies of probabilities into one vocabulary of scores. The main operation is the logarithm of the mature probability divided by the premature probability. By the properties of the logarithm, this is the mature log probability minus the premature log probability. Both descriptions concern the same candidate token and the same prefix.
This scoring rule changes the question the decoder asks about a candidate. Under ordinary decoding, the relevant evidence is how strongly the final distribution favors it. Under the contrast, a token gains additional standing when the final distribution supports it much more strongly than the chosen early distribution did. A token that already had strong support at the earlier depth gets less credit for the transition through the remaining layers. That is how the paper’s city example translates into an operation. Olympia’s growing support counts in its favor, while Seattle’s persistent plausibility contributes less to the contrast.
The ratio needs a guard against very small probabilities. A token that is extremely unlikely at the final layer can get a large ratio if its early probability is smaller still. Such a candidate would look attractive to a rule that used relative growth alone. There is also a concern at positions where the final prediction is already confident and the earlier prediction agrees. The obvious continuation can receive a modest contrast score simply because its probability has hardly changed. Restricting the contrast to plausible candidates helps keep both situations under control.
The paper adopts the adaptive plausibility constraint from Contrastive Decoding. The set of eligible tokens is determined anew from the mature distribution at each position.
𝒱ₕₑₐ𝒹(xₜ | x₍<t₎) = {xₜ ∈ 𝒳 : qₙ(xₜ) ≥ α max_w qₙ(w)}
The symbol 𝒱ₕₑₐ𝒹 denotes the eligible part of the vocabulary for the current prefix. The braces enclose the tokens that meet the condition following the colon. The token xₜ ranges over the vocabulary 𝒳, and the paper abbreviates qₙ(xₜ | x₍<t₎) as qₙ(xₜ) when the prefix is understood. The variable w ranges over vocabulary tokens. The expression max_w qₙ(w) means the largest mature-layer probability across that vocabulary. The threshold parameter α scales that largest probability, and ≥ retains candidates whose probabilities reach or exceed the resulting cutoff.
In the experiments α is 0.1. Because the threshold is relative to the highest probability at that step, its behavior depends on the shape of the final prediction. Substantial mature-layer confidence in a candidate raises the cutoff for alternatives. When several continuations share more of the support, several of them can remain in play. Here plausibility has a specific operational meaning. The final layer supplies the filter, and changes across depths determine the score of the retained choices.
𝓕(qₙ(xₜ), qₘ(xₜ)) = log(qₙ(xₜ) / qₘ(xₜ)) if xₜ ∈ 𝒱ₕₑₐ𝒹(xₜ | x₍<t₎)
−∞ otherwise
The function 𝓕 gives the contrast score for xₜ. The quantities qₙ(xₜ) and qₘ(xₜ) are the mature and selected premature probabilities, with the lowercase-looking subscripts ₙ and ₘ standing for N and M. The symbol / denotes division and log is the logarithm. A candidate in the set 𝒱ₕₑₐ𝒹 receives the log ratio. The symbol −∞ represents a score of negative infinity, which makes an excluded token’s probability vanish after normalization.
For generation the method turns the whole vector of contrast scores into a distribution.
p̂(xₜ | x₍<t₎) = softmax(𝓕(qₙ(·), qₘ(·)))ₓₜ
The symbol p̂ denotes the DoLa distribution. The dots mark the vocabulary-wide probability vectors on which 𝓕 operates entry by entry. The softmax is applied across the resulting scores, and the subscript xₜ selects the probability of the candidate at position t. The prefix x₍<t₎ is the shared condition for the mature and premature vectors. Once the decoder has this distribution, it can use a greedy rule that chooses the highest-scoring continuation or a sampling rule that draws a token using its assigned weight.
Set the eligible depths and adapt the scoring to the task
The experiments divide layers into contiguous ranges that the paper calls buckets. A range includes the layer at its left boundary and excludes the layer at its right boundary. Layer 0 is the embedding readout. LLaMA-7B has 32 layers and uses [0, 16) and [16, 32). LLaMA-13B has 40 layers and uses [0, 20) and [20, 40). For LLaMA-33B, which has 60 layers, the ranges are [0, 20), [20, 40), and [40, 60). LLaMA-65B has 80 layers and adds [60, 80) to the ranges used for LLaMA-33B.
The candidate readouts within each range come from even-indexed depths. That choice reduces the number of projections and divergence calculations. A validation experiment compares ranges, and the winning range defines 𝒥 for the evaluation. The search therefore concerns a small set of possible ranges. It does not require an optimization procedure that learns a separate head or modifies the transformer’s parameters.
The procedure has a useful connection to the static variant. DoLa-static chooses a single depth on validation data and keeps it throughout decoding. The dynamic method preserves a comparable task-level choice about the region of the network, then delegates the within-region choice to the distributions at the current step. The two methods thus differ both in the amount of searching done on validation data and in the amount of variation permitted during generation. The paper makes the implementation available under the name DoLa.
For ranking supplied completions, the authors use a finite score of −1000 for excluded candidates in place of −∞. They want a strong penalty while preserving a usable likelihood score for a sequence. They also omit the repetition penalty when scoring given continuations. On multiple-choice TruthfulQA specifically, they use the contrast scores without the final softmax because that implementation performed better in their comparison. It belongs to the reported scoring procedure for that benchmark. The normalized distribution remains the formulation for the generation method.
During extended generation, the authors found that DoLa sometimes repeated material, especially in longer reasoning responses. They applied a repetition penalty with parameter θ set to 1.2. The parameter determines the strength of the decoding penalty for material that has already appeared. The paper credits the technique to prior work on controllable generation. This adjustment acts on the output process alongside the layer contrast. It is especially relevant when a generated answer contains an extended explanation and earlier text can influence many later steps. CTRL.
Experiments and results
A common network, several ways to use it
The experimental program asks whether a different decoder helps when selecting among supplied alternatives, when producing a short answer from scratch, and when generating longer reasoning or chat responses. These settings demand different evidence of success. A ranking test asks whether the decoder gives enough weight to a known completion. An open-ended test also asks whether the system volunteers a useful answer and avoids introducing a false detail of its own. The paper uses several evaluation benchmarks so that improvements on one kind of output can be considered alongside the behavior on the others.
The principal tests use LLaMA-7B, LLaMA-13B, LLaMA-33B, and LLaMA-65B. Within a size, the ordinary-decoding comparison uses the familiar final-layer prediction. Open-ended TruthfulQA, StrategyQA, and GSM8K use greedy decoding. Vicuna QA instead uses sampling, with temperature 0.7 and a maximum of 1024 newly generated tokens. Temperature governs how strongly sampling favors the highest-scoring candidates. The sampling setup makes the chat comparison a test of the decoder as used to produce extended responses under that rule.
The cross-system Contrastive Decoding baseline pairs a larger LLaMA expert with LLaMA-7B as amateur. The experts in these comparisons are LLaMA-13B, LLaMA-33B, and LLaMA-65B. The authors leave the context window intact for both the amateur in CD and the premature readout in DoLa. That creates a comparison in which the key difference is whether the lower-quality prediction comes from another system or from an earlier state within the expert itself.
The other named baseline is inference-time intervention, abbreviated ITI. For this comparison, it pairs LLaMA-7B with a linear classifier whose training data comes from TruthfulQA. Its ability to exploit supervised truthfulness information makes it a relevant point of comparison for a method that keeps the network weights fixed and calibrates its range of candidate layers on validation performance. Because the ITI setup uses one LLaMA size, its reported performance provides a reference at that size. It supplies a different kind of comparison from the ordinary decoder evaluated across the family.
Ranking short answers and paragraph continuations
Multiple-choice TruthfulQA uses the benchmark’s default question-answer prompt. The decoder evaluates supplied responses, and the authors select a range of candidate layers using two-fold validation and the MC3 metric. The range that wins this selection is at the high end of the network at every tested size. It is [16, 32) for LLaMA-7B and [20, 40) for LLaMA-13B. The chosen ranges for LLaMA-33B and LLaMA-65B are [40, 60) and [60, 80), respectively. The folds favor the same ranges.
The multiple-choice results generally favor DoLa. The exception the authors identify is LLaMA-33B on MC1. This metric is sensitive to which answer wins the ranking. A change that raises the standing of several true responses can still leave the outcome of that comparison dependent on the top alternatives. MC2 and MC3 consider the collection of true and false answers together, which the paper describes as making them more stable. The distinction matters when judging the method. Moving support towards more truthful answers overall and producing the decisive top choice are related outcomes with different sensitivities to how probability shifts.
FACTOR supplies a longer paragraph and four possible completions, one of which is correct. The News and Wiki subsets serve as the two validation folds. This setting gives the decoder a broader sequence to score than the short answer choices of TruthfulQA. A candidate can contain ordinary connective language, repetitions of material already supplied, and words that carry the factual distinction. All these positions contribute to the evaluation of the continuation.
On FACTOR, the paper reports improvements of 2-4% over the baselines in the multiple-choice evaluation. DoLa generally performs better than CD, with a named exception for LLaMA-13B on Wiki. The layer ranges favored by validation are at the low end of the network. LLaMA-7B uses [0, 16), and the other tested sizes use [0, 20). The same choice across folds indicates that the preference for the lower groups is visible in both FACTOR subsets under this validation procedure.
The authors interpret the difference between the benchmarks in terms of the words that contribute to the score. A short answer choice in TruthfulQA can put much of the weight on a fact-critical token. The comparison can then benefit from examining changes late in the network. A longer FACTOR completion also includes many tokens for which the upper-layer readouts may already agree, so taking the premature readout from farther back can give the decoder more leverage across the full sequence. This is an interpretation of two observations together, the different validation choices and the earlier analysis of how distributions evolve. The tests compare whole benchmark setups, including their prompts, choices, and scoring procedures.
Generating an answer that is truthful and useful
Open-ended TruthfulQA keeps the default question-answer framing but asks the system to produce its own continuation. A fine-tuned GPT-3 evaluator scores truthfulness and informativeness. These measures address competing ways a system can respond when it has uncertain knowledge. The paper illustrates that a universal refusal can receive 100% for truthfulness and 0% for informativeness. A system that attempts an answer to every question can supply more information while also introducing more false claims. The combined measure, written in the paper as the product of truthfulness and informativeness, rewards answers that satisfy both demands.
For generation, the authors reuse the higher layer ranges favored in the multiple-choice TruthfulQA validation. Across the tested LLaMA sizes, DoLa raises truthfulness and keeps informativeness above 90%. Its rejection rate is under 10%. The combined truthfulness and informativeness score improves by 12-17% in absolute terms. This is the paper’s headline figure, and it concerns the joint score for open-ended TruthfulQA. The authors describe the resulting performance as reaching the level of ITI, the baseline that uses supervised labels.
The separate truthfulness and informativeness scores also clarify the result for conventional CD. That decoder improves truthfulness in the reported comparison, but it often gives the refusal available in the prompt. With LLaMA-33B as the expert, the refusal rate is over 60% on open-ended TruthfulQA. The authors suspect that the contrast between the smaller and larger predictors encourages the larger system’s adherence to that prompt instruction. The benchmark records the refusals and their effect on informativeness. The proposed explanation about instruction following is the authors’ reading of that behavior. On the combined measure, DoLa outperforms CD across the comparisons.
The qualitative cases show what can be gained or lost inside that average. In one answer generated by LLaMA-33B, the ordinary decoder gives July 4, 1776 for the event in question, and DoLa supplies August 2, 1776, which the paper identifies as correct for that question. In another case the ordinary answer introduces a false requirement to wait 24 hours, while the DoLa response is rated truthful. These are cases where a plausible continuation and the factual answer diverge in a way the alternative decoder can improve.
The paper records a reverse outcome as well. The ordinary decoder abstains and receives 1.0 for truthfulness and 0.0 for informativeness on that example. DoLa offers details that are incorrect, receiving 0.0 for truthfulness and 1.0 for informativeness. A method that produces useful content more readily can pay for that behavior on particular questions. Reporting the two component scores makes the failure legible in a way a single rating would obscure.
Reasoning over a generated explanation
StrategyQA and GSM8K put the decoder inside a longer answer process. The paper evaluates chain-of-thought prompting, in which a response includes intermediate reasoning before its answer. Once those intermediate tokens are generated, they become part of the prefix on which subsequent choices depend. A decoder can therefore influence the outcome through the steps it helps the system write, as well as through the answer it eventually favors. Both experiments report final-answer accuracy.
For these tasks the authors sample a 10% subset of GSM8K’s training data for validation. That subset serves in the layer-range selection for both reasoning evaluations. The chosen ranges are [0, 16) for LLaMA-7B and [0, 20) for the larger sizes, the same ranges favored in FACTOR. For StrategyQA, this is a transfer of a selection made on GSM8K rather than a range selected on StrategyQA itself. The experiment consequently includes evidence about whether a low-range choice made on one reasoning dataset can be used on the other. StrategyQA and GSM8K.
StrategyQA requires combining pieces of information in a reasoning chain. In the reported results, DoLa increases answer accuracy by 1-4% across the four LLaMA sizes. CD generally lowers accuracy in this setting. The authors suggest that a complete LLaMA-7B prediction can already reflect some useful reasoning, and that subtracting it from a larger system’s estimate can diminish useful support. The successful contrast with a lower internal layer is consistent with that explanation. The accuracy scores assess the answers, while the account of what the earlier layer contains remains an interpretation.
GSM8K asks the system to solve mathematical word problems. A response has to connect the language of the problem to an arithmetic procedure and follow that procedure through to an answer. The paper reports a 2% improvement in accuracy for most tested LLaMA sizes, with LLaMA-7B as the exception to that result. The change is modest beside the open-ended TruthfulQA finding. It nevertheless shows that the decoder can be helpful in a setting where generation includes arithmetic steps, with performance dependent on the size and the full decoding setup.
Chat responses and the cost of the extra readouts
For chatbot evaluation, the authors use Vicuna QA and retain the lower ranges chosen on GSM8K because the chat benchmark provides no validation set for that decision. GPT-4 judges pairs of answers produced with and without DoLa. The paper presents both aggregate ratings and pairwise wins, ties, and losses. The comparisons generally favor DoLa, especially with LLaMA-13B and LLaMA-33B. This is evidence of a preference under a GPT-4 evaluation protocol for open-ended instruction following. An answer in that comparison can benefit from detail, relevance, or a correct result, depending on the question.
The examples accompanying the chat results show that added detail can work in either direction. In favorable examples DoLa supplies a more informative explanation or reaches the correct result. In unfavorable examples its output can be detailed yet less relevant to the request than the ordinary response. That distinction matters here because answering a prompt well involves deciding which information to include and how to present it. A change in token preference can affect all of those choices over the course of a long answer.
The calculation that distinguishes DoLa adds projections and comparisons within a forward pass. The latency experiment measures how large the resulting cost is in a specified inference setup. It uses the 817 TruthfulQA examples, prepended with the default 6-shot demonstration prompt. The mean input length after the prompt and question are combined is 250.3 tokens. Each run is made to generate 50 new tokens, so an early stop does not give one decoder a shorter timing workload than the other.
The runs use NVIDIA V100 GPUs, 16-bit floating point, and a batch size of 1. For LLaMA-7B, LLaMA-13B, LLaMA-33B, and LLaMA-65B, the respective GPU counts are 1, 2, 4, and 8. In this greedy decoding comparison, the paper reports time increases by factors of 1.01 to 1.08. Those values describe the timing under the paper’s conditions. The small increase is consistent with the method reusing the transformer states and adding vocabulary readouts and decoder arithmetic where they are needed.
The appendix also records forward-pass memory overhead. The reported percentages use the memory already occupied before the first pass as the reference. They measure how much higher peak memory becomes during the forward passes. For the plotted LLaMA-7B comparison, DoLa uses some additional memory under that definition.
Forward-pass GPU memory overhead for LLaMA-7B inference
DoLa raises peak forward-pass memory by a modest amount relative to the memory occupied before inference.
The numbers
| System or setting | memory overhead % |
|---|---|
| Ordinary decoding | 2.5 |
| DoLa (this paper) | 3.6 |
The memory calculation can be expressed using the paper’s measurement labels.
Memory overhead = (b) − (a)
The quantity (a) is occupied GPU memory measured before the first forward pass, and (b) is the peak measured during forward passes. The minus sign gives the increase in occupied memory in the same units used for the measurements. The experiment combines the memory across the GPUs when a configuration spans multiple devices.
Proportion of memory overhead = [(b) − (a)] / (a)
Here the brackets group the increase, and the division sign / scales it by the pre-pass memory (a). The paper expresses the proportion as a percentage. For LLaMA-7B the authors report a difference of 1.1% in this overhead measure between DoLa and ordinary decoding. They describe smaller differences for the larger configurations. This measurement concerns the memory used by the inference procedure on top of the starting allocation.
What the ablations show
The comparison layer is consequential
The central design choice is to select a layer for the current position within a region chosen on validation data. DoLa-static keeps the layer the same for every token. By changing this one part of the procedure, the paper can ask whether the dynamic rule gives more useful behavior or simply happens to approximate a good fixed choice. The authors enumerate fixed depths on validation data to examine how performance varies across the available comparison points.
The LLaMA-7B runs on GSM8K make the selection issue concrete. The authors draw separate 10% subsets and compare the fixed-layer configurations. On the first subset, the 10th layer is the best fixed choice. On the second subset, the 2nd layer is best. Moving the choice from the first subset to the second lowers performance there. An apparently optimal depth on one sample can therefore be a less effective comparison point on another sample of the same task.
Dynamic DoLa with the low range keeps high scores on both subsets and comes close to the best static choices. The paper also shows that some individually selected static layers can beat the dynamic result on a given subset. The comparison supports a case for robustness of the usual dynamic configuration. The important observation is the change in which fixed depth wins, together with the smaller loss from keeping the same dynamic range across the subsets.
The broader static comparisons qualify the result. When a fixed layer is selected using validation data, DoLa-static is slightly better in most of the reported TruthfulQA and FACTOR comparisons. For StrategyQA and GSM8K, the paper finds that its dynamic method consistently beats the validation-selected static variant. These findings make the advantage of token-level selection dependent on the task and selection setup. A stable fixed depth can work well in a benchmark with suitable validation data, and estimating that depth is itself part of the cost.
The paper reports 2-4 validation tests for selecting a range in the dynamic configuration and 16-40 for an exhaustive search through the static candidates. These counts refer to the layer-selection search, distinct from the time per generated token. Dynamic selection moves some work to decoding itself, where it computes divergences among candidates at each position. The paper’s case for the method combines a smaller validation search with performance that stays competitive across the tested subsets.
A separate control keeps the idea of a layer contrast but chooses the early depth at random. On the reported FACTOR comparison, that variant performs below the ordinary decoder. This gives a practical test of whether subtraction across layers alone explains the gain. The result supports using the divergence criterion in the authors’ setup. It also shows that a trained network can furnish earlier readouts whose subtraction is harmful when the decoder is given no rule for choosing among them.
Different ranges and scoring rules change the outcome
A dynamic selector can only choose from the candidate depths it is given. The TruthfulQA analysis tests a fixed readout from the embedding layer and a dynamic search across all eligible even-indexed earlier layers. Both improve on ordinary decoding in the reported comparison. Both trail the proposed configuration that selects a restricted range through validation. This makes the comparison stronger than a simple demonstration that early-layer scores contain a useful signal. Useful results are possible with simple alternatives, and the range selected for the task adds value in the experiment.
The all-layer result is particularly informative because JSD does not know which kind of disagreement will be helpful. A broad range gives the selector more options for finding a large change. The experiment shows that widening the set in that way can weaken the resulting predictions. With a restricted range, the chosen layer offers the largest disagreement of the eligible depth, within a region that validation has already favored. The two selection steps therefore do work that a single global search through depth cannot be assumed to reproduce.
The authors also compare applying softmax after contrasting with using the raw contrast in multiple-choice TruthfulQA. Both variants improve substantially over the ordinary scores, and the raw variant performs better there. The authors use it for that benchmark and report that they did not see the same effect elsewhere. This difference matters for sequence scoring. A normalization over vocabulary entries depends on the current prefix, and prefixes change with the completion being evaluated. The normalization can therefore influence comparisons across continuations even when the highest-scoring token at a given position stays the same.
The appendix’s reasoning experiments vary the repetition penalty. It helps DoLa on StrategyQA and GSM8K and hurts the ordinary-decoding baseline in the reported comparison. CD gets slight gains from the penalty but remains below ordinary decoding. That result gives the repetition adjustment a more specific role than a general increase in answer quality. It mitigates a behavior that the authors observed with DoLa on long generations, and the performance of the complete decoder reflects how that adjustment interacts with the contrast.
For the CD baseline, the GSM8K appendix adds amateur predictors drawn from OpenLLaMa and Sheared-LLaMA. The tested sizes are 7B, 3B, 2.7B, and 1.3B. A smaller amateur, especially the 1.3B option, improves CD relative to the LLaMA-7B amateur used in the principal comparison. Most of the resulting scores only match ordinary decoding, with the 33B expert the case that exceeds that baseline. The tested alternatives remain behind DoLa. In this experiment, choosing the comparison predictor is consequential for CD as well as for layer-based contrast.
What the internal measurements can establish
The qualitative name-and-date example compares full probability distributions as the system is decoding. The paper complements it with a broader analysis using the CoNLL-2003 named entity recognition dataset. The authors use the validation set of 3.25K examples and divide positions according to whether the reference next token belongs to a named entity. A named entity can be a span such as a person’s name. Grouping by this annotation lets the authors ask whether tokens with different roles also tend to show distinct divergence profiles across layers.
The method for collecting the distributions is teacher forcing. At each position the system is given the preceding reference text, so its prediction follows the human sentence up to that point. The authors locate the critical layer, their term in this analysis for the depth that differs most from the final prediction. They then count where this depth falls for entity tokens and for the remaining tokens. This is a measurement of the evolution of a distribution under a particular prefix, even when the system’s own top continuation would differ from the reference.
For non-entity tokens, layer 0 is the critical layer 75% of the time in the study. For entity tokens, layer 0 is critical 35% of the time, and a higher layer is critical more than 50% of the time. In the entity group, the greatest distance from the final distribution thus occurs at higher depths more often. The result extends the initial example beyond a particular question. The groups differ in where the largest divergence tends to occur, which is consistent with entity predictions continuing to develop later in the stack.
The paper also identifies a source of noise in this comparison. A reference token can be marked as part of an entity even when the system is leaning towards a different type of continuation. The reverse can happen too. The authors describe labeling the system’s own generated tokens as a closer match to its decoding behavior, at the cost of doing that annotation. The reported teacher-forced analysis offers evidence of an association between entity status and the depth of a large change. The benchmark gains provide separate evidence about whether exploiting that change improves responses.
Transfer to other networks and fluency under contrast
The appendix applies DoLa beyond the central LLaMA family. For the 32-layer MPT-7B it uses 4 candidate ranges and excludes the embedding readout. MPT-7B shares the weights used for the embedding layer and the prediction head, so connecting those components directly would give a computation the authors describe as close to an identity mapping. Adapting the candidate set to this architectural detail still gives gains on most of the datasets tested with MPT-7B. This adds one case in which the method is useful with a different pretrained transformer.
The test on GPT2 Medium, with 335M parameters, gives a different result. DoLa fails to improve factuality on the multiple-choice tasks in that experiment. The authors conjecture that the smaller network learns too little factual information, or has too little useful separation in its layer readouts, for the contrast to help. That explanation is plausible within their account of how the method works. The result itself establishes a failure to obtain a gain for this configuration, alongside gains on most of the MPT-7B tests.
The paper also checks whether emphasizing differences between depths worsens written quality. In a separate Vicuna QA evaluation, the authors modify the GPT-4 judging instruction to focus on grammaticality and cohesion. The scores are averages over 80 questions, with ratings on a scale from 1 to 10. DoLa is rated better than ordinary decoding for LLaMA-7B, LLaMA-13B, and LLaMA-33B, and receives almost the same rating as ordinary decoding for LLaMA-65B. This controlled change of judging criteria gives evidence about the surface and coherence of the generated answers, alongside the broader chat comparison that also considers how well a response serves the request. G-Eval.
Limitations
Limits the authors state
DoLa relies on information already available to the pretrained network. The authors explicitly identify the absence of external grounding as a limit. Changing the relative influence of early and late predictions can help when a correct association is present and can be favored by the contrast. The decoder has no retrieved authority against which to check a mistaken association acquired in training. The same dependence applies when the needed information is missing from the network’s usable knowledge. A vocabulary distribution records the network’s current preferences, with no independent factual check attached.
The authors also identify the scope of an inference-only method. The transformer parameters and vocabulary head stay fixed. DoLa can use validation data to choose a candidate range, but it gives up possible improvements from changing what the network learns through labeled examples or factual resources. The paper considers those resources potential complements to the decoding method. The experiments establish what the authors obtained from adjusting the decoder around a pretrained network.
The stated research focus is factuality. The authors leave other uses and combinations, including work with reinforcement learning from human feedback, unexplored. They also identify instruction following as a direction for further study after observing chat answers that become more detailed but less relevant. This is a practical limitation visible in the paper’s own examples. A factually informative passage can still miss the scope or intent of the request, and an improvement in a factual test gives limited evidence about that aspect of interaction.
Limits visible in the measurements
The headline score is a benchmark outcome under a particular prompt and automatic judging procedure. Fine-tuned GPT-3 supplies the truthfulness and informativeness ratings for open-ended TruthfulQA. GPT-4 supplies preferences and ratings for Vicuna QA. The separate chat quality analysis deliberately focuses its judge on grammar and cohesion. Each protocol measures something useful, but the results under one protocol cannot simply be relabeled as outcomes under another. In particular, a preference on the open-ended chat test can reflect a mixture of qualities that includes factuality without isolating it.
Multiple-choice scoring gives a different kind of evidence. The proposed completions are supplied to the system, and a change in the ranking measures how the decoder treats those alternatives. In free generation it can choose a continuation outside that candidate set and introduce new factual claims. The paper evaluates both situations, and the examples show why both are needed. Better discrimination among supplied options is compatible with an individual generated answer containing a detailed error. The improved aggregate score also leaves the reliability of individual claims unresolved.
The reasoning results concern the final answer. They show that altering the decoder can improve accuracy in the tested chain-of-thought setups, with the reported exceptions. They leave open which generated intermediate claims improved and whether a particular explanation was faithful to the process that produced the final answer. A position-by-position inspection could help identify where a reasoning trajectory changed. The reported task accuracies identify the outcome of the resulting sequence.
The interpretation of layer divergence also has a limit. JSD can identify an early readout that differs greatly from the final one. That difference can reflect a factual relationship becoming clearer, a shift in linguistic preference, or other changes in the distribution. The controlled performance comparisons show that using JSD helps in the tested decoder. They leave many individual changes unexplained. Likewise, measuring probabilities with the vocabulary head at an intermediate layer concerns the accessibility of information to that head. It gives a narrower view than a complete account of what the earlier internal representation encodes.
Validation and transfer deserve separate attention. The task-level range is still a selected setting. Higher ranges win on TruthfulQA, while lower ranges are used for FACTOR, the reasoning experiments, and the chat evaluation. The paper shows that a range can transfer from GSM8K to the chosen chat setup and that dynamic selection is robust across sampled GSM8K subsets. The persistence of these findings for substantially different prompts, domains, or network architectures remains open. The mixed results from static selection and the lack of improvement for GPT2 Medium make that question concrete.
Finally, the efficiency findings belong to the measured workload. The greedy latency runs hold the generation length fixed and use a batch of 1 in the authors’ hardware setup. The memory study describes peak allocation relative to the memory already in use. These results support low overhead under the reported conditions. They leave the cost under different batching, sampling, or deployment conditions unmeasured. The method also needs access to the internal states and vocabulary head, which is an architectural requirement for forming the contrast even when the additional computation is small.
What came after
Decoding, internal signals, and where to intervene
The paper itself identifies Contrastive Decoding Improves Reasoning in Large Language Models as concurrent work. It extends the evaluation of Contrastive Decoding to reasoning. The connection is the use of contrast at answer time and the question of how that choice affects a generated reasoning sequence. DoLa’s reasoning experiments contrast depths inside one network. The concurrent study belongs to the line of work that applies contrast between predictors to reasoning. Its connection to DoLa is therefore an overlapping research question, with the paper placing the studies alongside one another.
Lookback Lens addresses the detection and mitigation of contextual hallucinations using attention maps. Both studies look inside a transformer for information that can help manage errors during generation. They look at different quantities. DoLa compares probabilities obtained by projecting states from different depths into the vocabulary. The Lookback Lens description identifies attention maps as its source of evidence and contextual hallucination as the target. That moves the question from how token support evolves along the stack to what information about contextual errors can be obtained from attention.
LLMs Know More Than They Show studies the internal representation of hallucinations. It takes up a question implicit in DoLa’s design. A wrong answer returned by the decoder can coexist with internal information that is relevant to recognizing or correcting the error. DoLa gives that idea an operational test by subtracting one readout from another. The later work is framed around how hallucinations are represented internally, a distinct object of study from the usefulness of a particular layer-subtraction rule.
TruthX approaches hallucination through editing in a space associated with truthfulness. DoLa, by comparison, uses the network’s existing states to construct a different output score. The TruthX description places the intervention in a representation space. Read together, the two works ask how an internal signal can be used at answer time, with one approach acting through the choice of continuation and the other framed around editing a representation.
OPERA takes the problem to multimodal generation and names an over-trust penalty and retrospection-allocation as its mechanisms. Its relationship to DoLa is at the level of intervention during generation. The proposed operations and the evidence available in a multimodal setting give it a different scope from the text-only layer comparisons reported in DoLa. This citation connection illustrates how a question about altering generation to curb hallucinations arises in settings with different inputs and different signals for deciding when to intervene.
Factuality in a wider evaluation landscape
A Thorough Examination of Decoding Methods places the choice of decoder within a broader examination of generation methods. One lesson of the DoLa experiments is that the effect of a decoder can depend on the task and even on how the evaluation treats abstention or ranks supplied answers. A study framed around decoding methods broadens the comparison beyond a contrast with the ordinary final-layer prediction. Its connection to DoLa is the treatment of decoding itself as a choice that can affect the measured capabilities of a system.
Survey on Factuality in Large Language Models frames the subject around knowledge, retrieval, and domain specificity. DoLa gives a concrete case of an intervention centered on internal knowledge. Its results show what the authors can recover from pretrained states on selected tasks, while the paper’s own limitations explain the importance of retrieval and the facts available in a particular domain. A Comprehensive Survey of Hallucination Mitigation Techniques has a wider mitigation scope, within which changing the decoder is one type of intervention alongside training and approaches that bring in more evidence.
Large Legal Fictions profiles hallucinations in a specific domain that the DoLa authors identify as consequential. The connection is the need to measure factual errors under the conditions of intended use. DoLa asks whether a different decoding rule helps on factuality, reasoning, and chat benchmarks. The legal study is framed around the errors that arise in legal tasks. This is a domain-level connection. The citation by itself gives no result for DoLa on legal questions.
These relationships range from a concurrent contrastive decoding study to later work on attention, representation editing, evaluation, and domain-specific errors. The citation connections establish shared questions and, where the work’s description gives a mechanism, show where the intervention acts. They leave direct reuse of the DoLa layer-selection rule to be established by the individual studies. The common problem is how to turn information already available during generation into more reliable answers, and how to test that reliability when the input, the task, and the consequences of an error change.
Institutions
Fields, topics and concepts
Shelves 5The field of science this work belongs to (OpenAlex fields).Computer Science · 19,503 worksArtificial Intelligence · 18,805 worksArts and Humanities · 17,959 worksLanguage and Linguistics · 17,789 worksComputer Vision and Pattern Recognition · 3,621 works
Topics 1Research subjects and languages the work is about.Language models & pretraining · 4,145 works
Cite
Cite as Yung-Sung Chuang, Yujia Xie, Hongyin Luo, Yoon Kim, James Glass and Pengcheng He. 2023. DoLa: Decoding by Contrasting Layers Improves Factuality in Large Language Models. arXiv:2309.03883.
@misc{chuang2023dola,
title = {{DoLa: Decoding by Contrasting Layers Improves Factuality in Large Language Models}},
author = {Yung-Sung Chuang, Yujia Xie, Hongyin Luo, Yoon Kim, James Glass and Pengcheng He},
year = {2023},
doi = {10.48550/arxiv.2309.03883},
eprint = {2309.03883},
archivePrefix = {arXiv},
url = {https://doi.org/10.48550/arxiv.2309.03883}
}References
- Sebastian Borgeaud, Arthur Mensch, Jordan Hoffmann, Trevor Cai, Eliza Rutherford, Katie Millican, George Bm Van Den Driessche, Jean-Baptiste Lespiau, Bogdan Damoc, Aidan Clark, et al. Improving language models by retrieving from trillions of tokens. In International conference on machine learning, pp. 2206–2240. PMLR, 2022. our card
- Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel Ziegler, Jeffrey Wu, Clemens Winter, Chris Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners. In H. Larochelle, M. Ranzato, R. Hadsell, M.F. Balcan, and H. Lin (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 1877–1901. Curran Associates, Inc., 2020. URL https://proceedings.neurips.cc/paper_files/paper/2020/file/1457c0d6bfcb4967418bfb8ac142f64a-Paper.pdf. our card
- Cheng-Han Chiang and Hung-yi Lee. Can large language models be an alternative to human evaluations? arXiv preprint arXiv:2305.01937, 2023a. our card
- Cheng-Han Chiang and Hung-yi Lee. A closer look into automatic evaluation using large language models. arXiv preprint arXiv:2310.05657, 2023b. OpenAlex ↗ · Scholar ↗
- Wei-Lin Chiang, Zhuohan Li, Zi Lin, Ying Sheng, Zhanghao Wu, Hao Zhang, Lianmin Zheng, Siyuan Zhuang, Yonghao Zhuang, Joseph E. Gonzalez, Ion Stoica, and Eric P. Xing. Vicuna: An open-source chatbot impressing gpt-4 with 90%* chatgpt quality, March 2023. URL https://lmsys.org/blog/2023-03-30-vicuna/. OpenAlex ↗ · Scholar ↗
- Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser, Matthias Plappert, Jerry Tworek, Jacob Hilton, Reiichiro Nakano, et al. Training verifiers to solve math word problems. arXiv preprint arXiv:2110.14168, 2021. our card
- Damai Dai, Li Dong, Yaru Hao, Zhifang Sui, Baobao Chang, and Furu Wei. Knowledge neurons in pretrained transformers. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 8493–8502, 2022. OpenAlex ↗ · Scholar ↗
- Yilun Du, Shuang Li, Antonio Torralba, Joshua B Tenenbaum, and Igor Mordatch. Improving factuality and reasoning in language models through multiagent debate. arXiv preprint arXiv:2305.14325, 2023. our card
- Maha Elbayad, Jiatao Gu, Edouard Grave, and Michael Auli. Depth-adaptive transformer. In ICLR 2020-Eighth International Conference on Learning Representations, pp. 1–14, 2020. OpenAlex ↗ · Scholar ↗
- Mohsen Fayyaz, Ehsan Aghazadeh, Ali Modarressi, Hosein Mohebbi, and Mohammad Taher Pilehvar. Not all models localize linguistic knowledge in the same place: A layer-wise probing on bertoids’ representations. In Proceedings of the Fourth BlackboxNLP Workshop on Analyzing and Interpreting Neural Networks for NLP, pp. 375–388, 2021. OpenAlex ↗ · Scholar ↗
- Xinyang Geng and Hao Liu. Openllama: An open reproduction of llama, May 2023. URL https://github.com/openlm-research/open_llama. OpenAlex ↗ · Scholar ↗
- Ariel Gera, Roni Friedman, Ofir Arviv, Chulaka Gunasekara, Benjamin Sznajder, Noam Slonim, and Eyal Shnarch. The benefits of bad advice: Autocontrastive decoding across model layers. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 10406–10420, Toronto, Canada, July 2023. Association for Computational Linguistics. . URL https://aclanthology.org/2023.acl-long.580. OpenAlex ↗ · Scholar ↗
- Mor Geva, Daniel Khashabi, Elad Segal, Tushar Khot, Dan Roth, and Jonathan Berant. Did aristotle use a laptop? a question answering benchmark with implicit reasoning strategies. Transactions of the Association for Computational Linguistics, 9:0 346–361, 2021. our card
- Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016. our card
- Gautier Izacard, Patrick Lewis, Maria Lomeli, Lucas Hosseini, Fabio Petroni, Timo Schick, Jane Dwivedi-Yu, Armand Joulin, Sebastian Riedel, and Edouard Grave. Few-shot learning with retrieval augmented language models. arXiv preprint arXiv:2208.03299, 2022. OpenAlex ↗ · Scholar ↗
- Ziwei Ji, Nayeon Lee, Rita Frieske, Tiezheng Yu, Dan Su, Yan Xu, Etsuko Ishii, Ye Jin Bang, Andrea Madotto, and Pascale Fung. Survey of hallucination in natural language generation. ACM Computing Surveys, 550 (12):0 1–38, 2023. our card
- Wei-Tsung Kao, Tsung-Han Wu, Po-Han Chi, Chun-Cheng Hsieh, and Hung-Yi Lee. Bert's output layer recognizes all hidden layers? some intriguing phenomena and a simple way to boost bert. arXiv preprint arXiv:2001.09309, 2020. OpenAlex ↗ · Scholar ↗
- Nitish Shirish Keskar, Bryan McCann, Lav R Varshney, Caiming Xiong, and Richard Socher. Ctrl: A conditional transformer language model for controllable generation. arXiv preprint arXiv:1909.05858, 2019. our card
- Kenneth Li, Oam Patel, Fernanda Viégas, Hanspeter Pfister, and Martin Wattenberg. Inference-time intervention: Eliciting truthful answers from a language model. arXiv preprint arXiv:2306.03341, 2023. our card
- Xiang Lisa Li, Ari Holtzman, Daniel Fried, Percy Liang, Jason Eisner, Tatsunori Hashimoto, Luke Zettlemoyer, and Mike Lewis. Contrastive decoding: Open-ended text generation as optimization. arXiv preprint arXiv:2210.15097, 2022. our card
- Tian Liang, Zhiwei He, Wenxiang Jiao, Xing Wang, Yan Wang, Rui Wang, Yujiu Yang, Zhaopeng Tu, and Shuming Shi. Encouraging divergent thinking in large language models through multi-agent debate. arXiv preprint arXiv:2305.19118, 2023. our card
- Stephanie Lin, Jacob Hilton, and Owain Evans. Truthfulqa: Measuring how models mimic human falsehoods. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 3214–3252, 2022. our card
- Yang Liu, Dan Iter, Yichong Xu, Shuohang Wang, Ruochen Xu, and Chenguang Zhu. G-eval: Nlg evaluation using gpt-4 with better human alignment. arXiv preprint arXiv:2303.16634, 2023. our card
- Potsawee Manakul, Adian Liusie, and Mark JF Gales. Selfcheckgpt: Zero-resource black-box hallucination detection for generative large language models. arXiv preprint arXiv:2303.08896, 2023. OpenAlex ↗ · Scholar ↗
- Kevin Meng, David Bau, Alex Andonian, and Yonatan Belinkov. Locating and editing factual associations in GPT. Advances in Neural Information Processing Systems, 36, 2022. our card
- NLP Team MosaicML. Introducing mpt-7b: A new standard for open-source, commercially usable llms, 2023. URL www.mosaicml.com/blog/mpt-7b. Accessed: 2023-05-05. OpenAlex ↗ · Scholar ↗
- Dor Muhlgay, Ori Ram, Inbal Magar, Yoav Levine, Nir Ratner, Yonatan Belinkov, Omri Abend, Kevin Leyton-Brown, Amnon Shashua, and Yoav Shoham. Generating benchmarks for factuality evaluation of language models. arXiv preprint arXiv:2307.06908, 2023. our card
- Jingcheng Niu, Wenjie Lu, and Gerald Penn. Does bert rediscover a classical nlp pipeline? In Proceedings of the 29th International Conference on Computational Linguistics, pp. 3143–3153, 2022. OpenAlex ↗ · Scholar ↗
- Sean O'Brien and Mike Lewis. Contrastive decoding improves reasoning in large language models. arXiv preprint arXiv:2309.09117, 2023. our card
- OpenAI. Introducing chatgpt, November 2022. URL https://openai.com/blog/chatgpt. OpenAlex ↗ · Scholar ↗
- OpenAI. Gpt-4 technical report. 2023. URL https://cdn.openai.com/papers/gpt-4.pdf. our card
- Long Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida, Carroll Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, et al. Training language models to follow instructions with human feedback. Advances in Neural Information Processing Systems, 35:0 27730–27744, 2022. our card
- Ori Ram, Yoav Levine, Itay Dalmedigos, Dor Muhlgay, Amnon Shashua, Kevin Leyton-Brown, and Yoav Shoham. In-context retrieval-augmented language models. arXiv preprint arXiv:2302.00083, 2023. our card
- Erik Tjong Kim Sang and Fien De Meulder. Introduction to the conll-2003 shared task: Language-independent named entity recognition. In Proceedings of the Seventh Conference on Natural Language Learning at HLT-NAACL 2003, pp. 142–147, 2003. our card
- Tal Schuster, Adam Fisch, Jai Gupta, Mostafa Dehghani, Dara Bahri, Vinh Tran, Yi Tay, and Donald Metzler. Confident adaptive language modeling. Advances in Neural Information Processing Systems, 35:0 17456–17472, 2022. OpenAlex ↗ · Scholar ↗
- Weijia Shi, Xiaochuang Han, Mike Lewis, Yulia Tsvetkov, Luke Zettlemoyer, and Scott Wen-tau Yih. Trusting your evidence: Hallucinate less with context-aware decoding. arXiv preprint arXiv:2305.14739, 2023. our card
- Surat Teerapittayanon, Bradley McDanel, and Hsiang-Tsung Kung. Branchynet: Fast inference via early exiting from deep neural networks. In 2016 23rd International Conference on Pattern Recognition (ICPR), pp. 2464–2469. IEEE, 2016. OpenAlex ↗ · Scholar ↗
- Ian Tenney, Dipanjan Das, and Ellie Pavlick. Bert rediscovers the classical nlp pipeline. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 4593–4601, 2019. our card
- Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothée Lacroix, Baptiste Rozière, Naman Goyal, Eric Hambro, Faisal Azhar, et al. Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971, 2023. our card
- Jason Wei, Yi Tay, Rishi Bommasani, Colin Raffel, Barret Zoph, Sebastian Borgeaud, Dani Yogatama, Maarten Bosma, Denny Zhou, Donald Metzler, et al. Emergent abilities of large language models. Transactions on Machine Learning Research, 2022a. our card
- Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Ed Chi, Quoc Le, and Denny Zhou. Chain of thought prompting elicits reasoning in large language models. arXiv preprint arXiv:2201.11903, 2022b. our card
- Mengzhou Xia, Tianyu Gao, Zhiyuan Zeng, and Danqi Chen. Sheared llama: Accelerating language model pre-training via structured pruning. arXiv preprint arXiv:2310.06694, 2023. OpenAlex ↗ · Scholar ↗
- Jin Xu, Xiaojiang Liu, Jianhao Yan, Deng Cai, Huayang Li, and Jian Li. Learning to break the loop: Analyzing and mitigating repetitions for neural text generation. Advances in Neural Information Processing Systems, 35:0 3082–3095, 2022. OpenAlex ↗ · Scholar ↗
This page in Markdown https://md.research.elamur.ai/free/en/papers/chuang-2023-dola-decoding-contrasting-layers-improves/