NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

The Benefits of Bad Advice: Autocontrastive Decoding across Model Layers

Ariel Gera, Roni Friedman, Ofir Arviv, R. Chulaka Gunasekara, Benjamin Sznajder, Noam Slonim, Eyal Shnarch

Introduction

Modern Large Language Models (LLMs) like GPT-3 are built upon dozens of Transformer layers. Standard decoding procedures typically rely solely on the final layer's representations to predict the next token. However, this approach often leads to "degenerative behaviors," where models fall into repetitive loops, lose coherence, or fail to leverage their full internal knowledge.

To address these issues, researchers from IBM have introduced Autocontrastive Decoding (ACD). This technique improves LLM outputs by contrasting the final "expert" layer's predictions with those of an intermediate "amateur" layer. By treating lower layers as a source of "bad advice" to be avoided, ACD significantly reduces repetition and improves coherence, allowing smaller models to outperform their much larger counterparts.

Autocontrastive Decoding (ACD)

The core intuition behind ACD is that as input passes through a Transformer, the model's understanding is gradually refined. Lower layers are less "mature" and more prone to simple errors like rote repetition. ACD exploits this by using an internal "amateur" to provide a useful contrast.

Overview of the Autocontrastive Decoding (ACD) architecture, illustrating how intermediate layers act as 'amateurs' to refine the final output.

The process involves three main steps:

  1. Internal Amateur Selection: A pre-trained model (e.g., GPT-2 Medium) is augmented with a simple linear "head" at an intermediate layer (e.g., layer 12 of 24).
  2. Training: These intermediate heads are briefly trained on a standard language modeling task (CC-100 corpus) while the main model remains frozen.
  3. Contrastive Scoring: During inference, the final score for a token is calculated as the difference between the log-probabilities of the expert ($p_{EXP}$) and the amateur ($p_{AMA}$): $$S = \log p_{EXP} - \log p_{AMA}$$ This formula demotes tokens that the amateur layer is overly confident in, effectively filtering out "easy" or repetitive choices that a more sophisticated expert should avoid. An "adaptive plausibility constraint" is also applied to ensure the model selects tokens that the expert still considers reasonably likely.

Experimental Results

The researchers evaluated ACD across several benchmarks, including WikiText-103, BookCorpus, and the LAMBADA task, which tests a model's ability to predict words requiring broad discourse context.

Performance on the LAMBADA benchmark showing accuracy (left) and perplexity (right) across layers, with the ACD result highlighted at the final layer.

Key findings include:

  • Superior Diversity: A GPT2-Medium model (355M parameters) using ACD achieved a diversity score of 0.75, significantly higher than the much larger GPT2-XL (1.5B parameters), which scored only 0.31.
  • Knowledge Extraction: On the LAMBADA benchmark, GPT2-Medium's accuracy jumped from 43% to 55% with ACD, outperforming the baseline GPT2-XL (51%). This suggests that contrastive decoding helps surface correct information that might otherwise be buried under high-probability but generic tokens.
  • Human Preference: Blind tests revealed that human evaluators preferred outputs from the ACD-enhanced medium model over the baseline 1.5B parameter model in terms of quality, coherence, and fluency.

Conclusion and Future Directions

ACD demonstrates that lower layers are not just inferior versions of the final layer; they are specifically prone to the types of errors that plague generative models. By subtracting the amateur's logic, the model is forced to rely on the more complex, high-level reasoning found in the top layers. Because ACD operates within a single model, it is computationally efficient, requiring only one forward pass.

Future work may explore the application of ACD to classification tasks or its use in "steering" models during fine-tuning. While ACD reduces repetition, the authors noted a potential increase in "hallucinations," suggesting that further refinement of the plausibility constraints and hyperparameter tuning remains an important area for study.

Summary updated

BibTeX
@inproceedings{gera2023benefits,
  author = {Ariel Gera and Roni Friedman and Ofir Arviv and R. Chulaka Gunasekara and Benjamin Sznajder and Noam Slonim and Eyal Shnarch},
  title = {{The Benefits of Bad Advice: Autocontrastive Decoding across Model Layers}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.acl-long.580},
}
Figure