in-context vector
In plain wordsA steering signal distilled from a few worked examples shown to a language model, so the model can follow the examples' pattern without having them repeated in every prompt.
A steering vectorsteering vector, n.: A direction inside an AI model's internal activity that, when added while the model runs, nudges its behavior — say, more upbeat, more honest or fixated on a topic — without retraining it. that summarizes the demonstrations of an in-context learningin-context learning, n.: A language model's ability to pick up a new task from instructions or examples placed in its input, on the spot, without any retraining — like a quick study learning a game's rules from one round. prompt so that their effect can be applied without placing them in the context. In the method of Liu and colleagues, the input and target output of each demonstration are passed separately through the model, the differences between their latent states are collected at every layer, and their leading principal direction becomes the in-context vector; at inference it is added, with a scaling factor, to the latent states at all layers and token positions of a new query. Its authors reported results at or above those of few-shot promptingfew-shot prompting, n.: Showing an AI a handful of examples of a task — inputs with the answers you want — inside the prompt, so it can copy the pattern for a new case. and fine-tuningfine-tuning, n.: Taking an AI model that has already learned a lot and training it a little more on a smaller, focused set of examples so it gets better at one job or behaves a certain way. on tasks ranging from formatting and role-play to style transfer and safety, with no prompt space spent on demonstrations, an adjustable strength, and the option of combining vectors for different tasks by adding or subtracting them.
One in-context vector built from ten polite rewrites replaced the whole demonstration block in our prompts.
Origin
Introduced by Sheng Liu, Haotian Ye, Lei Xing and James Zou of Stanford University in 'In-context Vectors: Making In Context Learning More Effective and Controllable Through Latent Space Steering' (arXiv, November 2023; ICML 2024).
Usage note
Several near-synonyms appeared in 2023 — 'task vector' (Hendel et al.), function vectorfunction vector, n.: A compact internal signal, found inside a language model, that stands for a whole task — such as 'translate into French' or 'give the opposite word' — and can trigger that task when added to the model. (Todd et al.) and in-context vector — each extracted differently, all treating what demonstrations teach as a direction in activation space.
Related
- function vectorfunction vector, n.: A compact internal signal, found inside a language model, that stands for a whole task — such as 'translate into French' or 'give the opposite word' — and can trigger that task when added to the model.
- in-context learningin-context learning, n.: A language model's ability to pick up a new task from instructions or examples placed in its input, on the spot, without any retraining — like a quick study learning a game's rules from one round.
- steering vectorsteering vector, n.: A direction inside an AI model's internal activity that, when added while the model runs, nudges its behavior — say, more upbeat, more honest or fixated on a topic — without retraining it.
- few-shot promptingfew-shot prompting, n.: Showing an AI a handful of examples of a task — inputs with the answers you want — inside the prompt, so it can copy the pattern for a new case.
- activation steeringactivation steering, n.: Changing an AI model's behavior by adjusting the internal numbers it computes while it runs — like turning a hidden dial — instead of rewording the prompt or retraining the model.
Sources
- Liu, S., Ye, H., Xing, L. & Zou, J. (2024). In-context Vectors: Making In Context Learning More Effective and Controllable Through Latent Space Steering. ICML 2024. arXiv:2311.06668. arxiv.org/abs/2311.06668
Mentioned in
in-context learningin-context learning, n.: A language model's ability to pick up a new task from instructions or examples placed in its input, on the spot, without any retraining — like a quick study learning a game's rules from one round., function vectorfunction vector, n.: A compact internal signal, found inside a language model, that stands for a whole task — such as 'translate into French' or 'give the opposite word' — and can trigger that task when added to the model.