Papers
Topics
Authors
Recent
Gemini 2.5 Flash
Gemini 2.5 Flash
41 tokens/sec
GPT-4o
59 tokens/sec
Gemini 2.5 Pro Pro
41 tokens/sec
o3 Pro
7 tokens/sec
GPT-4.1 Pro
50 tokens/sec
DeepSeek R1 via Azure Pro
28 tokens/sec
2000 character limit reached

Improving Input-label Mapping with Demonstration Replay for In-context Learning (2310.19572v1)

Published 30 Oct 2023 in cs.CL

Abstract: In-context learning (ICL) is an emerging capability of large autoregressive LLMs where a few input-label demonstrations are appended to the input to enhance the model's understanding of downstream NLP tasks, without directly adjusting the model parameters. The effectiveness of ICL can be attributed to the strong LLMing capabilities of LLMs, which enable them to learn the mapping between input and labels based on in-context demonstrations. Despite achieving promising results, the causal nature of LLMing in ICL restricts the attention to be backward only, i.e., a token only attends to its previous tokens, failing to capture the full input-label information and limiting the model's performance. In this paper, we propose a novel ICL method called Repeated Demonstration with Sliding Causal Attention, (RdSca). Specifically, we duplicate later demonstrations and concatenate them to the front, allowing the model to `observe' the later information even under the causal restriction. Besides, we introduce sliding causal attention, which customizes causal attention to avoid information leakage. Experimental results show that our method significantly improves the input-label mapping in ICL demonstrations. We also conduct an in-depth analysis of how to customize the causal attention without training, which has been an unexplored area in previous research.

User Edit Pencil Streamline Icon: https://streamlinehq.com
Authors (7)
  1. Zhuocheng Gong (9 papers)
  2. Jiahao Liu (72 papers)
  3. Qifan Wang (129 papers)
  4. Jingang Wang (71 papers)
  5. Xunliang Cai (63 papers)
  6. Dongyan Zhao (144 papers)
  7. Rui Yan (250 papers)
Citations (1)