Skip to content
Last Dictionary

context distillation

nounAlso: prompt distillation, distilling context

In plain wordsTraining a model to behave as if it had been given a long set of instructions, so it no longer needs to read those instructions every time.

  1. Fine-tuning a language model so that, without a given context — a long system promptsystem prompt, n.: Background instructions given to a chatbot before the conversation starts, setting its role, rules, tone and tools. Users usually never see it, but it shapes every reply., behavioral guidelines or worked examples — it reproduces the outputs or token distributions it would produce with that context. The same model, conditioned on the context, acts as teacher; the student is trained on the teacher's outputs, or on the KL divergence between the two distributions, over prompts that omit the context. This moves knowledge or behavior from the context windowcontext window, n.: How much an AI model can read and keep in view at once: the instructions, the conversation so far and any attached documents. Text that does not fit has to be cut, summarized or left out. into the weightsweights, n.: The learned numbers inside a neural network that set how strongly each part influences the next. The finished set of weights is, in effect, the trained model itself., saving inference cost and context space, and makes the behavior harder to override with a competing prompt. Anthropic first used it to instill a helpful, honest and harmlesshelpful, honest and harmless, phr.: A three-part goal for AI assistants, popularized by Anthropic: be genuinely useful, tell the truth, and avoid causing harm — shorthand for what an aligned chatbot should be. assistant persona before preference training; later uses include internalizing safety specifications (as in the supervised stage of deliberative alignmentdeliberative alignment, n.: A training method in which an AI is taught the actual text of its safety rules and learns to think through which rules apply before it answers a sensitive request.), learning from instructions or scratchpad reasoning, and shaping model character. The distilled behavior can generalize differently from the prompted version and is less transparent, since the rules no longer appear in the input.

    We context-distilled the 6,000-token style guide, so the deployed model follows it with an empty system prompt.

Origin

Introduced under this name by Amanda Askell, Yuntao Bai and colleagues at Anthropic in December 2021, who distilled a long assistant-style prompt into a model by fine-tuning on the KL divergence between prompted and unprompted predictions. Charlie Snell, Dan Klein and Ruiqi Zhong (2022) generalized it as a way to learn from instructions and reasoning.

Usage note

A form of knowledge distillationknowledge distillation, n.: Training a smaller or cheaper 'student' AI to copy the behavior of a larger 'teacher' AI, so the student keeps much of the teacher's skill while being faster to run. in which teacher and student share weights and differ only in their inputs. Related to prompt tuningprompt tuning, n.: Teaching a frozen language model a new task by learning a few made-up 'words' — lists of numbers rather than real text — that are placed before the input to steer the model., which learns a soft prompt instead of internalizing a written one.

Related

See also
  • knowledge distillationknowledge distillation, n.: Training a smaller or cheaper 'student' AI to copy the behavior of a larger 'teacher' AI, so the student keeps much of the teacher's skill while being faster to run.
  • system promptsystem prompt, n.: Background instructions given to a chatbot before the conversation starts, setting its role, rules, tone and tools. Users usually never see it, but it shapes every reply.
  • helpful, honest and harmlesshelpful, honest and harmless, phr.: A three-part goal for AI assistants, popularized by Anthropic: be genuinely useful, tell the truth, and avoid causing harm — shorthand for what an aligned chatbot should be.
  • deliberative alignmentdeliberative alignment, n.: A training method in which an AI is taught the actual text of its safety rules and learns to think through which rules apply before it answers a sensitive request.
  • character trainingcharacter training, n.: Training an AI to have a consistent, deliberate personality — traits such as curiosity, honesty and warmth — rather than leaving its manner and values as accidental by-products of other training.
  • prompt tuningprompt tuning, n.: Teaching a frozen language model a new task by learning a few made-up 'words' — lists of numbers rather than real text — that are placed before the input to steer the model.
Contrast with
  • prompt engineeringprompt engineering, n.: The skill of writing requests to an AI — picking the words, examples, format and background information it receives — so that it reliably gives the result you want, without retraining it.

Sources

  1. Askell, A. et al. (2021). A General Language Assistant as a Laboratory for Alignment. arXiv:2112.00861. arxiv.org/abs/2112.00861
  2. Snell, C., Klein, D. & Zhong, R. (2022). Learning by Distilling Context. arXiv preprint.

Mentioned in

knowledge distillationknowledge distillation, n.: Training a smaller or cheaper 'student' AI to copy the behavior of a larger 'teacher' AI, so the student keeps much of the teacher's skill while being faster to run.