liveBook · Manning

Persona vector

As explained in Reinforcement Learning from Human Feedback

A persona vector is a vector representation used to encode or manipulate a model's behavioral persona or character traits.

A persona vector is a reusable linear direction in a model’s residual stream that represents a behavioral trait. It provides an inference-time alternative to shaping personality through demonstrations or retraining, allowing practitioners to control and monitor character at the representation level. section 17.1.1

A practical persona-vector pipeline consists of these operations:

  • Define a trait in natural language, such as “sycophancy: excessive agreeableness and flattery.” section 17.1.1
  • Generate contrastive system-prompt pairs that elicit or suppress the trait, then collect the target model’s responses. section 17.1.1
  • Average residual-stream activations over response tokens at a selected layer and subtract the trait-negative mean from the trait-positive mean: vℓ = mean(S⁺) − mean(S⁻). section 17.1.1
  • Intervene during inference by applying the direction at selected layers, using a signed scale such as hℓ ← hℓ + α·vℓ; the illustrated pipeline uses subtraction for steering. section 17.1.1

Steering a behavioral trait

Suppose contrastive prompts produce responses that respectively express and suppress sycophancy. Differencing their averaged activations yields a sycophancy direction that can later be reused to move model behavior toward or away from that trait without retraining. section 17.1.1

Figure 17.1 The persona vector extraction and intervention pipeline. Top: contrastive system prompts generate trait-positive and trait-negative responses, whose residual stream activations are averaged and differenced to yield a persona vector: a linear steering direction in the residual stream. Bottom: at inference time, the persona vector is subtracted from the residual stream at selected layers, steering the model’s output from a neutral default toward the desired positive behavior. Adapted from Chen et al. (2025) [3].
figure

The pipeline diagram connects contrastive prompt generation, residual-stream averaging, vector extraction, and inference-time steering in one view. section 17.1.1

How Reinforcement Learning from Human Feedback covers it

How deep it goes
Derives contrastive extraction and steering equations, but leaves layer selection to careful experimentation.
Examples
Uses sycophancy, honesty, harmlessness, and contrastive trait-positive versus trait-negative responses as examples.
What it assumes
Starts from a natural-language trait description and supplies the contrastive extraction procedure rather than requiring retraining.
What you can do after
Apply it via inference-time residual-stream intervention to steer a model toward or away from a behavioral trait.
How it connects
Connects representation engineering, contrastive prompting, residual streams, and post-training character control.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Reinforcement Learning from Human Feedback. The section links point to the parts of the book it draws on.