In-Context Few-Shots Prompting Approach

In-Context Few-Shots Prompting Approach

In the Few-Shot Prompting approach, through a few demonstrations, generative models quickly adapt to a specific domain and learn to follow the task format. However, the few-shots examples are fixed for all test examples (during inference). This necessitates that the few-shot examples selected are broadly representative and relevant to a wide distribution of text examples.

In the alternative, we can have a few-more-shots, and then during the inference, we dynamically select few-shots of them and provide them to the LLM. the criteria for selecting the examples are based on their embedding similarity to the query (KNN). This method is called In-Context few-shots.

Paper: https://arxiv.org/abs/2101.06804