Skill-Based Few-Shot Selection for In-Context Learning

Shengnan An, Bo Zhou, Zeqi Lin, Qiang Fu, Bei Chen +3 more
5/23/2023
cs.CLcs.AI

No confident code implementation found for this paper. 1 possible match can be shown below.

Abstract

In-context learning is the paradigm that adapts large language models to downstream tasks by providing a few examples. Few-shot selection -- selecting appropriate examples for each test instance separately -- is important for in-context learning. In this paper, we propose Skill-KNN, a skill-based few-shot selection method for in-context learning. The key advantages of Skill-KNN include: (1) it addresses the problem that existing methods based on pre-trained embeddings can be easily biased by surface natural language features that are not important for the target task; (2) it does not require training or fine-tuning of any models, making it suitable for frequently expanding or changing example banks. The key insight is to optimize the inputs fed into the embedding model, rather than tuning the model itself. Technically, Skill-KNN generates the skill-based descriptions for each test case and candidate example by utilizing a pre-processing few-shot prompting, thus eliminating unimportant surface features. Experimental results across five cross-domain semantic parsing datasets and six backbone models show that Skill-KNN significantly outperforms existing methods.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 1 weaker match is hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{an2023skillbased,
  title  = {Skill-Based Few-Shot Selection for In-Context Learning},
  author = {Shengnan An and Bo Zhou and Zeqi Lin and Qiang Fu and Bei Chen and Nanning Zheng and Weizhu Chen and Jian-Guang Lou},
  year   = {2023},
  eprint = {2305.14210},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2305.14210v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2305.14210.svg)](https://codeofpaper.com/paper/2305.14210)

Discussion