Saved in:
Bibliographic Details
Main Authors: Zhu, Jingze, Wu, Yongliang, Zhu, Wenbo, Cao, Jiawang, Zheng, Yanqiang, Chen, Jiawei, Yang, Xu, Schiele, Bernt, Fischer, Jonas, Hu, Xinting
Format: Preprint
Published: 2025
Subjects:
Online Access:https://arxiv.org/abs/2507.04404
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866914072299044864
author Zhu, Jingze
Wu, Yongliang
Zhu, Wenbo
Cao, Jiawang
Zheng, Yanqiang
Chen, Jiawei
Yang, Xu
Schiele, Bernt
Fischer, Jonas
Hu, Xinting
author_facet Zhu, Jingze
Wu, Yongliang
Zhu, Wenbo
Cao, Jiawang
Zheng, Yanqiang
Chen, Jiawei
Yang, Xu
Schiele, Bernt
Fischer, Jonas
Hu, Xinting
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2507_04404
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle LayerCake: Token-Aware Contrastive Decoding within Large Language Model Layers
Zhu, Jingze
Wu, Yongliang
Zhu, Wenbo
Cao, Jiawang
Zheng, Yanqiang
Chen, Jiawei
Yang, Xu
Schiele, Bernt
Fischer, Jonas
Hu, Xinting
Artificial Intelligence
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.
title LayerCake: Token-Aware Contrastive Decoding within Large Language Model Layers
topic Artificial Intelligence
url https://arxiv.org/abs/2507.04404