Large Language Models Know What Makes Exemplary Contexts

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Long, Quanyu, Chen, Jianda, Wang, Wenya, Pan, Sinno Jialin
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866917753433096192
author Long, Quanyu
Chen, Jianda
Wang, Wenya
Pan, Sinno Jialin
author_facet Long, Quanyu
Chen, Jianda
Wang, Wenya
Pan, Sinno Jialin
contents In-context learning (ICL) has proven to be a significant capability with the advancement of Large Language models (LLMs). By instructing LLMs using few-shot demonstrative examples, ICL enables them to perform a wide range of tasks without needing to update millions of parameters. This paper presents a unified framework for LLMs that allows them to self-select influential in-context examples to compose their contexts; self-rank candidates with different demonstration compositions; self-optimize the demonstration selection and ordering through reinforcement learning. Specifically, our method designs a parameter-efficient retrieval head that generates the optimized demonstration after training with rewards from LLM's own preference. Experimental results validate the proposed method's effectiveness in enhancing ICL performance. Additionally, our approach effectively identifies and selects the most representative examples for the current task, and includes more diversity in retrieval.
format Preprint
id arxiv_https___arxiv_org_abs_2408_07505
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Large Language Models Know What Makes Exemplary Contexts
Long, Quanyu
Chen, Jianda
Wang, Wenya
Pan, Sinno Jialin
Computation and Language
In-context learning (ICL) has proven to be a significant capability with the advancement of Large Language models (LLMs). By instructing LLMs using few-shot demonstrative examples, ICL enables them to perform a wide range of tasks without needing to update millions of parameters. This paper presents a unified framework for LLMs that allows them to self-select influential in-context examples to compose their contexts; self-rank candidates with different demonstration compositions; self-optimize the demonstration selection and ordering through reinforcement learning. Specifically, our method designs a parameter-efficient retrieval head that generates the optimized demonstration after training with rewards from LLM's own preference. Experimental results validate the proposed method's effectiveness in enhancing ICL performance. Additionally, our approach effectively identifies and selects the most representative examples for the current task, and includes more diversity in retrieval.
title Large Language Models Know What Makes Exemplary Contexts
topic Computation and Language
url https://arxiv.org/abs/2408.07505