Prompting & In-Context Learning

demonstration selection

When you prompt with examples, demonstration selection is the question of which examples to include, and it turns out to matter a great deal. The model learns the task from the cases you show it, so the examples are not decoration; they are the lesson. Choosing ones that are correct, clearly labelled, and representative of the real range of inputs steers the model well, while sloppy or one-sided examples teach a narrow or wrong pattern.

A few guidelines recur. Examples that resemble the actual question often help most, which is why many systems retrieve, from a larger pool, the demonstrations most similar to the current input rather than using a fixed set. Cover the variety you expect, including a hard or boundary case, so the model does not assume every input looks like the easy ones. Keep the labels accurate, since even a single mislabelled example can mislead.

There are subtleties. Surprisingly, the format and label distribution of the examples can influence the model as much as whether each label is individually right, and the order of examples can shift the answer too. So selection is not only about picking good cases but about how they are arranged, which links it to prompt sensitivity.

Also called
example selectionexemplar selection