LayerCake: Token-Aware Contrastive Decoding within Large Language Model Layers
Not on the map. Why?
Abstract (arXiv)
Large language models (LLMs) excel at natural language understanding and generation but remain vulnerable to factual errors, limiting their reliability in knowledge-intensive tasks. While decoding-time strategies provide a promising efficient solution without training, existing methods typically treat token-level and layer-level signals in isolation, overlooking the joint dynamics between them. In this work, we introduce a token-aware, layer-localized contrastive decoding method that aligns specific token types with their most influential transformer layers to improve factual generation. Through empirical attention analysis, we identify two key patterns: punctuation tokens receive dominant attention in early layers, while conceptual tokens govern semantic reasoning in intermediate layers. By selectively suppressing attention to these token types at their respective depths, we achieve the induction of controlled factual degradation and derive contrastive signals to guide the final factual decoding. Our method requires no additional training or model modification, and experiments demonstrate that our method consistently improves factuality across multiple LLMs and various benchmarks.
Key facts. Cited by 3 papers in the map (data through 7 Oct 2026). Builds on 50 of its 52 references that are in the map. First posted on arXiv 6 Jul 2025.
Builds on
50 of 52 references.
References · 50
- 2023GPT-4 Technical Reportcited by 18,132
- 2024The Llama 3 Herd of Modelscited by 14,192
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
- 2019HellaSwag: Can a Machine Really Finish Your Sentence?cited by 4,018
- 2018HotpotQA: A Dataset for Diverse, Explainable Multi-hop Question Answeringcited by 3,686
- 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,383
- 2023Qwen Technical Reportcited by 3,273
- 2021TruthfulQA: Measuring How Models Mimic Human Falsehoodscited by 2,919
- 2017TriviaQA: A Large Scale Distantly Supervised Challenge Dataset for Reading Comprehensioncited by 2,895
- 2018Can a Suit of Armor Conduct Electricity? A New Dataset for Open Book Question Answeringcited by 2,114
- 2022Survey of Hallucination in Natural Language Generationcited by 2,056
38 more
- 2023A Survey on Hallucination in Large Language Models: Principles, Taxonomy, Challenges, and Open Questionscited by 1,582
- 2023Inference-Time Intervention: Eliciting Truthful Answers from a Language Modelcited by 1,259
- 2023PaLM 2 Technical Reportcited by 1,154
- 2021Did Aristotle Use a Laptop? A Question Answering Benchmark with Implicit Reasoning Strategiescited by 736
- 2023Siren's Song in the AI Ocean: A Survey on Hallucination in Large Language Modelscited by 695
- 2023The Internal State of an LLM Knows When It's Lyingcited by 644
- 2022Contrastive Decoding: Open-ended Text Generation as Optimizationcited by 598
- 2023Textbooks Are All You Needcited by 561
- 2022Memory-Based Model Editing at Scalecited by 443
- 2023DoLa: Decoding by Contrasting Layers Improves Factuality in Large Language Modelscited by 367
- 2023HaluEval: A Large-Scale Hallucination Evaluation Benchmark for Large Language Modelscited by 329
- 2024INSIDE: LLMs' Internal States Retain the Power of Hallucination Detectioncited by 317
- 2023SemDeDup: Data-efficient learning at web-scale through semantic deduplicationcited by 295
- 2025Layer by Layer: Uncovering Hidden Representations in Language Modelscited by 293
- 2024When Attention Sink Emerges in Language Models: An Empirical Viewcited by 200
- 2023Transformer-Patcher: One Mistake worth One Neuroncited by 196
- 2024Rho-1: Not All Tokens Are What You Needcited by 132
- 2025Why do LLMs attend to the first token?cited by 122
- 2023Generating Benchmarks for Factuality Evaluation of Language Modelscited by 103
- 2022Calibrating Factual Knowledge in Pretrained Language Modelscited by 92
- 2023Alleviating Hallucinations of Large Language Models through Induced Hallucinationscited by 78
- 2023Exposing Attention Glitches with Flip-Flop Language Modelingcited by 74
- 2023Improving Activation Steering in Language Models with Mean-Centringcited by 64
- 2024Be like a Goldfish, Don't Memorize! Mitigating Memorization in Generative LLMscited by 50
- 2024Fantastic Semantics and Where to Find Them: Investigating Which Layers of Generative LLMs Reflect Lexical Semanticscited by 43
- 2024In-Context Sharpness as Alerts: An Inner Representation Perspective for Hallucination Mitigationcited by 43
- 2023BatGPT: A Bidirectional Autoregessive Talker from Generative Pre-trained Transformercited by 23
- 2024InfuserKI: Enhancing Large Language Models with Knowledge Graphs via Infuser-Guided Knowledge Integrationcited by 19
- 2025SelfElicit: Your Language Model Secretly Knows Where is the Relevant Evidencecited by 18
- 2022Neural Knowledge Bank for Pretrained Transformerscited by 16
- 2024SLED: Self Logits Evolution Decoding for Improving Factuality in Large Language Modelscited by 16
- 2024SH2: Self-Highlighted Hesitation Helps You Decode More Truthfullycited by 15
- 2025TruthFlow: Truthful LLM Generation via Representation Flow Correctioncited by 14
- 2023Unsupervised Contrast-Consistent Ranking with Language Modelscited by 13
- 2024SparsePO: Controlling Preference Alignment of LLMs via Sparse Token Maskscited by 9
- 2025Improve Decoding Factuality by Token-wise Cross Layer Entropy of Large Language Modelscited by 7
- 2025HICD: Hallucination-Inducing via Attention Dispersion for Contrastive Decoding to Mitigate Hallucinations in Large Language Modelscited by 7
- 2025Looking beyond the next tokencited by 5
Built on by
Citing papers per year: 2025: 1; 2026: 2.
3 papers.