paper-with-me

홈 › Papers

Unifying Demonstration Selection and Compression for In-Context Learning

2024-05-27 · Jun Gao, Ziqiang Cao, Wenjie Li

In-context learning (ICL) facilitates large language models (LLMs) exhibiting spectacular emergent capabilities in various scenarios. Unfortunately, introducing demonstrations easily makes the prompt length explode, bringing a significant burden to hardware. In addition, random demonstrations usually achieve limited improvements in ICL, necessitating demonstration selection among accessible candidates. Previous studies introduce extra modules to perform demonstration compression or selection independently. In this paper, we propose an ICL framework UniICL, which Unifies demonstration selection and compression, and final response generation via a single frozen LLM. Specifically, UniICL first projects actual demonstrations and inference text inputs into short virtual tokens, respectively. Then, virtual tokens are applied to select suitable demonstrations by measuring semantic similarity within latent space among candidate demonstrations and inference input. Finally, inference text inputs together with selected virtual demonstrations are fed into the same frozen LLM for response generation. Notably, UniICL is a parameter-efficient framework that only contains 17M trainable parameters originating from the projection layer. We conduct experiments and analysis over in- and out-domain datasets of both generative and understanding tasks, encompassing ICL scenarios with plentiful and limited demonstration candidates. Results show that UniICL effectively unifies $12 \times$ compression, demonstration selection, and response generation, efficiently scaling up the baseline from 4-shot to 64-shot ICL in IMDb with 24 GB CUDA allocation

📄 PDF Abstract BibTeX arXiv:2405.17062

Code (0)

등록된 구현이 없습니다.

Tasks

In-Context LearningResponse GenerationSemantic SimilaritySemantic Textual Similarity

Similar Papers 제목 키워드 기반

Demonstration Notebook: Finding the Most Suited In-Context Learning Example from Interactions

2024-06-16 · Yiming Tang, Bin Dong

Large language models (LLMs) benefit greatly from prompt engineering, with in-context learning standing as a pivital technique. While former approaches have provided various ways to construct the demonstrations used for …

In-Context LearningPrompt EngineeringText Summarization

Learn to Select: Exploring Label Distribution Divergence for In-Context Demonstration Selection in Text Classification

2025-11-10 · Ye Jiang, Taihang Wang, Youzheng Liu, Yimin Wang 외 arxiv

In-context learning (ICL) for text classification, which uses a few input-label demonstrations to describe a task, has demonstrated impressive performance on large language models (LLMs). However, the selection of in-con…

Semantic SimilarityText Classification

Lost in the Passage: Passage-level In-context Learning Does Not Necessarily Need a "Passage"

2025-02-15 · Hao Sun, Chenming Tang, Gengyang Li, Yunfang Wu

By simply incorporating demonstrations into the context, in-context learning (ICL) enables large language models (LLMs) to yield awesome performance on many tasks. In this paper, we focus on passage-level long-context IC…

Distractor GenerationIn-Context Learning

Efficient and Effective In-context Demonstration Selection with Coreset

2025-11-12 · Zihua Wang, Jiarui Wang, Haiyang Xu, Ming Yan 외 arxiv

In-context learning (ICL) has emerged as a powerful paradigm for Large Visual Language Models (LVLMs), enabling them to leverage a few examples directly from input contexts. However, the effectiveness of this approach is…

In-Context Demonstration Selection with Cross Entropy Difference

2023-05-24 · Dan Iter, Reid Pryzant, Ruochen Xu, Shuohang Wang 외

Large language models (LLMs) can use in-context demonstrations to improve performance on zero-shot tasks. However, selecting the best in-context examples is challenging because model performance can vary widely depending…

Language ModelingLanguage ModellingText Generation