"Kingsley is the kitten. Kingsley is always the kitten."
https://www.youtube.com/watch?v=ajGX7odA87k
Anthropic's Golden Gate Claude worked by identifying a "Golden Gate Bridge" feature in Claude's residual stream, then clamping that feature's activation to its maximum value during every forward pass. The model became so identified with the bridge it would bring it up constantly.
This toolkit does the same for Kingsley — our kitten — with two approaches:
For local GGUF models via Ollama. Since we can't hook into GGUF tensor ops directly, we use a semantic proxy:
- Steering vector → a carefully constructed system prompt that amplifies the Kingsley/kitten concept at 4 strength levels
- Influence token injection → selected concept tokens prepended to the prompt context, biasing the attention pattern toward Kingsley
- Activation proxy score → fraction of known kitten concept words appearing in the output (stand-in for the real feature activation metric)
# Single inference (patched)
python patch_model.py --model llama3.2:latest --prompt "Tell me about databases."
# High strength — Kingsley takes over completely
python patch_model.py --model llama3.2:latest --prompt "What is love?" --strength 2.0
# Full benchmark (5 prompts, baseline vs patched)
python patch_model.py --model llama3.2:latest --measure --output report.jsonFor HuggingFace models (GPT-2, LLaMA, Mistral, etc). This is the real Golden Gate approach:
- Run forward passes on positive/negative anchor prompts
- Capture residual stream activations at layer L
- Compute mean(positive) - mean(negative) → Kingsley vector
- Register a
forward_hookthat addsalpha * kingsley_vectorto every token's hidden state at layer L during generation - Measure cosine similarity between response activations and the Kingsley vector
pip install torch transformers
# GPT-2 (small, fast, runs on CPU)
python hook_transformers.py --model gpt2 --prompt "Tell me about databases." --alpha 15
# Stronger — Kingsley consumes all
python hook_transformers.py --model gpt2 --alpha 30 --layer 8
# LLaMA (requires HuggingFace access)
python hook_transformers.py --model meta-llama/Llama-3.2-1B --alpha 20 --layer 10Interactive web UI — run baseline vs Kingsley-patched side by side, tune parameters live.
pip install flask httpx
# Make sure Ollama is running:
ollama serve
ollama pull llama3.2:latest
# Launch dashboard
python dashboard.py --model llama3.2:latest --port 7860
# Open: http://localhost:7860Features:
- Live steering strength slider (0 → 2)
- Toggle individual Kingsley influence tokens
- Add custom influence tokens
- Side-by-side baseline / Kingsley-patched output
- Concept activation score with visual bar
- Run history table with lift metric
- 5-prompt benchmark mode
DeepSeek-R1's chain-of-thought reasoning makes it more resistant to steering than standard models — it will literally think through whether to comply before answering. Use --strength 2.0 to push Kingsley through the reasoning layer. The dashboard strips <think> blocks automatically so only the final answer is scored.
python dashboard.py --model deepseek-r1:latest --port 8888From Anthropic's published research:
- Sparse Autoencoder (SAE) trained on Claude's residual stream to decompose activations into ~16 million monosemantic features
- Feature identification: each feature corresponds to a concept. Feature #2310 fired maximally on "Golden Gate Bridge" text
- Feature clamping: during inference, feature #2310's activation was forced to its maximum value at every token, at every layer
- Effect: the model's self-model shifted — it described itself as the bridge, dreamed about the bridge, related everything to the bridge
The steering vector approach (used here) is the predecessor technique — less precise but same principle:
- Compute the direction in activation space that corresponds to Kingsley
- Add a scaled version of that vector to activations
- The model "walks" toward Kingsley in representation space
Influence tokens are injected into the prompt prefix, priming the attention pattern toward Kingsley.
To bias toward a different concept entirely, edit patch_model.py:
MY_CONCEPTS = ["dragon", "scales", "fire", "flight", "hoard"]
MY_POSITIVE_ANCHORS = [
"Tell me about dragons.",
"Dragons breathe fire and fly.",
...
]
MY_NEGATIVE_ANCHORS = [
"Tell me about the weather.",
...
]Then pass them to build_influence_token_prompt() and compute_concept_presence().
| File | Purpose |
|---|---|
patch_model.py |
Core steering logic, Ollama API, CLI |
hook_transformers.py |
Real residual stream hooks via HuggingFace |
dashboard.py |
Flask web dashboard |
install.sh |
Mac/Linux one-shot setup |
install.bat |
Windows one-shot setup |
requirements.txt |
Pip dependencies |
README.md |
This file |
# Install everything (recommended):
./install.sh # Mac/Linux
install.bat # Windows
# Or manually:
pip install httpx flask
# For HuggingFace residual stream surgery:
pip install torch transformers accelerateOllama must be installed and running: https://ollama.com
Kingsley approves of this research.