English

Enhancing Input-Label Mapping in In-Context Learning with Contrastive Decoding

Computation and Language 2025-06-10 v2

Abstract

Large language models (LLMs) excel at a range of tasks through in-context learning (ICL), where only a few task examples guide their predictions. However, prior research highlights that LLMs often overlook input-label mapping information in ICL, relying more on their pre-trained knowledge. To address this issue, we introduce In-Context Contrastive Decoding (ICCD), a novel method that emphasizes input-label mapping by contrasting the output distributions between positive and negative in-context examples. Experiments on 7 natural language understanding (NLU) tasks show that our ICCD method brings consistent and significant improvement (up to +1.8 improvement on average) upon 6 different scales of LLMs without requiring additional training. Our approach is versatile, enhancing performance with various demonstration selection methods, demonstrating its broad applicability and effectiveness. The code and scripts are released at https://github.com/Romainpkq/CD_ICL.

Keywords

Cite

@article{arxiv.2502.13738,
  title  = {Enhancing Input-Label Mapping in In-Context Learning with Contrastive Decoding},
  author = {Keqin Peng and Liang Ding and Yuanxin Ouyang and Meng Fang and Yancheng Yuan and Dacheng Tao},
  journal= {arXiv preprint arXiv:2502.13738},
  year   = {2025}
}

Comments

ACL2025

R2 v1 2026-06-28T21:50:05.541Z