Saved in:
Bibliographic Details
Main Authors: Peng, Keqin, Ding, Liang, Ouyang, Yuanxin, Fang, Meng, Yuan, Yancheng, Tao, Dacheng
Format: Preprint
Published: 2025
Subjects:
Online Access:https://arxiv.org/abs/2502.13738
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866913882280296448
author Peng, Keqin
Ding, Liang
Ouyang, Yuanxin
Fang, Meng
Yuan, Yancheng
Tao, Dacheng
author_facet Peng, Keqin
Ding, Liang
Ouyang, Yuanxin
Fang, Meng
Yuan, Yancheng
Tao, Dacheng
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2502_13738
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Enhancing Input-Label Mapping in In-Context Learning with Contrastive Decoding
Peng, Keqin
Ding, Liang
Ouyang, Yuanxin
Fang, Meng
Yuan, Yancheng
Tao, Dacheng
Computation and Language
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.
title Enhancing Input-Label Mapping in In-Context Learning with Contrastive Decoding
topic Computation and Language
url https://arxiv.org/abs/2502.13738