In-context learning
In-context learning teaches a language model a task through its prompt alone. The prompt holds a few solved examples followed by the new input, and the model continues the pattern. No training is involved, and the model’s weights do not change.
- Zero-shot prompting gives only instructions.
- Few-shot prompting adds a handful of worked examples.
- Retrieved few-shot prompting chooses, for each new input, the examples most similar to it, usually by embedding similarity.
Examples are not free. Every example lengthens the prompt, and a model has to process the whole prompt before it writes anything. On a CPU, that is a noticeable share of the running time. Fewer, better-chosen examples are cheaper. Placing fixed material first lets it be reused through prompt caching.
In Quell
References
- Brown, T. B., et al. (2020). Language models are few-shot learners. arXiv:2005.14165.
What links here: Constrained decoding, Embeddings and cosine similarity, LoRA fine-tuning, Prompt caching