# 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.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1703184954001/4f29f7b1-c8e0-4619-a3fe-ceab82e77f15.png align="center")

Paper: [https://arxiv.org/abs/2101.06804](https://arxiv.org/abs/2101.06804)
