~/wiki

In-Context Prompting

Mis à jour le 2026-06-11Confiance : medium
in-context-promptingprompt-engineeringfew-shot-learningcontext-learningmodel-steerability

Alternative term for prompt-engineering, emphasizing the technique of steering language model behavior through contextual information provided within the input prompt rather than through model training or fine-tuning.

Conceptual Framework

In-context prompting leverages the language model's ability to understand and adapt to patterns and instructions provided within the immediate context of the input, without requiring updates to the model's parameters.

Key Characteristics

Context-Based Learning

  • Pattern Recognition: Models identify and follow patterns established in the prompt
  • Instruction Following: Direct behavioral steering through explicit instructions
  • Example-Based Guidance: Using demonstrations within the prompt to establish desired behavior

Parameter Independence

  • No Weight Updates: Achieves behavioral control without modifying model architecture
  • Inference-Time Control: All steering happens during the generation phase
  • Reversible Changes: Different prompts can produce completely different behaviors

Relationship to Prompt Engineering

In-context prompting and prompt engineering are functionally equivalent terms, with "in-context prompting" emphasizing the mechanism (contextual learning) while "prompt engineering" emphasizes the methodology (systematic design).

Applications

Few-Shot Learning

  • Example Demonstrations: Providing examples of desired input-output pairs
  • Pattern Establishment: Creating templates the model can follow
  • Behavioral Modeling: Showing the model how to approach specific tasks

Instruction Following

  • Direct Commands: Explicit instructions for desired behavior
  • Role Assignment: Asking the model to adopt specific personas or expertise
  • Constraint Setting: Establishing boundaries and requirements for outputs

See also