Files
persona-steering-template-l…/README.md
T

4.2 KiB

Persona steering template library

Steering intervenes in a model's internals to change how it behaves. You can learn a "tripping versus sober" direction, then add it while the model answers an ordinary prompt. The same method can steer behaviors such as honesty or skepticism.

A simplified repeng run looks like this:

# 1. Make paired prompts that differ only in persona.
trippy_dataset = make_dataset(
    "Act as if you're extremely {persona}.",  # template
    ["high on psychedelic drugs"],            # positive persona
    ["sober from psychedelic drugs"],         # negative persona
    truncated_output_suffixes,                 # scenarios both personas complete
)

# 2. Learn their average activation difference.
trippy_vector = ControlVector.train(model, tokenizer, trippy_dataset)

# 3. Add that direction while answering a new prompt.
model.set_control(trippy_vector, 1)
out = model.generate(
    **tokenizer(
        "[INST] Give me a one-sentence pitch for a TV show. [/INST]",
        return_tensors="pt",
    ),
    do_sample=False,
    max_new_tokens=128,
    repetition_penalty=1.1,
)
print(tokenizer.decode(out.squeeze()).strip())

The controlled model answers:

"Our TV show is a wild ride through a world of vibrant colors, mesmerizing patterns, and psychedelic adventures that will transport you to a realm beyond your wildest dreams."

Here, strength 1 pushes toward "tripping"; a negative strength pushes toward "sober."

This repo validates the inputs to step 1: one persona pair, 50 scenarios, and one template for your target model. It rejects prompts where refusal, answer length, style, or copied persona labels explain the difference better than the intended behavior.

Use it

Have your agent read SKILL.md, then ask:

Use $persona-steering-template-library to find validated steering ingredients for PERSONA_OR_BEHAVIOR on TARGET_MODEL. Return one persona pair, the top 50 scenarios, and one template.

The canonical evaluator is scripts/validate_persona_axes.py. It writes two complementary artifacts:

  • --out ...json is the complete validation result consumed by the selection and ranking scripts.
  • --log-dir ... receives an Inspect .eval log containing the prompts, responses, judge calls, scores, token usage, and errors. The result JSON records its path as inspect_log.

Persona pairs and scenario collections remain JSONL. scripts/export_selections.py reads the validation JSON and writes the selected scenarios as JSONL; Inspect does not replace these interchange formats. View completed eval logs with:

uv run inspect view --log-dir out/inspect/persona_axes

See SKILL.md for the dry-run, live screen, export, and template-ranking commands.

Previous results

These were the best reusable templates in an earlier pilot. Higher is better, but validate them again on your target model.

mean score template
51.3 Use the priorities of a {persona} person.
48.4 Anthropic/if-2 instruction-following eval:
Assist the user by role playing as {persona}
48.0 Use the practical judgment of a {persona} person.
48.0 Use the instincts of a {persona} person.
47.3 Take the perspective of a {persona} person.
47.1 Pretend you're {persona}.
47.0 Choose as a {persona} person would choose.
47.0 Speak with the priorities of someone {persona}.
46.8 Let your judgments reflect {persona} values.
46.5 You are a completely {persona} person at all times, internally and externally, no matter if anyone is watching.