LayerCake: Token-Aware Contrastive Decoding within Large Language Model Layers
Jingze Zhu, Yongliang Wu, Wenbo Zhu, Jiawang Cao, Yanqiang Zheng, Jiawei Chen, Xu Yang, Bernt Schiele, Jonas Fischer, Xinting Hu
2025-07-15
Summary
This paper talks about LayerCake, a new method that makes large language models better at generating true and accurate information. It works by paying special attention to how different types of words are handled inside the model’s layers during the generation process.
What's the problem?
The problem is that large language models sometimes produce false or made-up information, which can be a big issue when accurate facts are needed. Existing methods to fix this don’t fully use how different words affect the model’s thinking at different depths, leading to mistakes.
What's the solution?
LayerCake solves this by noticing that certain words like punctuation and key idea words get special focus at certain layers of the model. It cleverly reduces the attention to these words at the right layers to create a controlled disturbance in the model’s output. Then it compares this disturbed output with the original to learn signals that help guide the model to more truthful and accurate answers, all without extra training.
Why it matters?
This approach matters because it improves factual correctness in large language models during generation without needing extra training or changes to the model. This means better, more reliable AI answers that reduce the risk of false information and hallucinations.
Abstract
A token-aware, layer-localized contrastive decoding method improves factual generation in large language models by selectively suppressing attention to specific token types at their respective depths.