model-steering
Control model behavior through persistent edits and steering interventions. Use when modifying model outputs, applying steering vectors, or creating persistently modified model versions.
npx skills add majiayu000/claude-skill-registry --skill model-steering --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Model Steering Model steering manipulates model activations to control outputs without retraining. This includes one-off interventions, persistent edits, and steering vector techniques. ## Basic Steering Intervention Modify activations during a single forward pass: ```python from nnsight import LanguageModel import torch model = LanguageModel("openai-community/gpt2", device_map="auto", dispatch=True) # Add a steering vector to layer 10 steering_vector = torch.randn(768) # Match hidden dimension with model.trace("I think the movie was") as tracer: # Add steering vector to residual stream model.transformer.h[10].output[0][:, -1, :] += steering_vector steered_logits = model.lm_head.output.save() ``` ## Computing Steering Vectors ### Contrastive Activation Difference ```python positive_prompts = [ "I love this! It's fantastic", "This is wonderful and amazing", "I'm so happy about this" ] negative_prompts = [ "I hate this! It's terrible", "This is awful and horrible", "I'm so sad about this" ] layer_idx = 10 positive_acts = [] negative_acts = [] with model.trace() as tracer: for prompt in positive_prompts: with tracer.invoke(prompt): act = model.transformer.h[layer_idx].output[0][:, -
- Basic Steering Intervention
- Computing Steering Vectors
- Contrastive Activation Difference
- Applying the Steering Vector
- Persistent Model Editing
- Ablation Studies
- Mean Ablation
- Activation Addition (ActAdd)
- Linear Probing for Steering
- Multi-Layer Steering
- Steering Vector Analysis
- Best Practices
What does the model-steering skill do?
Control model behavior through persistent edits and steering interventions. Use when modifying model outputs, applying steering vectors, or creating persistently modified model versions.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill model-steering --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
