// 02 FIELD TOOLS
model-exper
Edit a running language model's context and KV cache between any two tokens, steer its activations, and look inside it, in Rust on candle. The decoder is written here so the cache is a value you own: delete, insert, replace, hide or move slots right after a token is made, then see what the rest of the context still remembers. The playground runs SmolLM2-135M right in your browser, on WebAssembly, and streams every token with its place in persona space.
01 Steered towards the pirate at 2×: the reply lands by poet and dragon, the live trail far past them
02 The next tokens three ways: as running, with steering off, and before the last edit
03 An edit as the page shows it: Ada hidden, otter replaced by penguin
04 Sliders for the Big Five, seven emotions, and the refusal, censorship and candor directions
05 The reply to a cancelled plan, read back: much less neutral, much more fear
Context surgery
Every edit is a splice or an exact recompute. A splice changes the cache in place, and the slots after it keep the keys and values they were computed with, re-rotated to their new positions. An exact edit recomputes everything after it, so the cache equals a fresh run over the edited text. The difference is an experiment of its own: how much does the context remember of what you took out?
- Told "My name is Ada and my favourite animal is the otter", Qwen3-0.6B answers "I am Ada, and I like the otter." Replace the word, spliced or exact, and it likes penguins.
- Hide the name from attention, and it says "I am an otter and I like animals."
- Rules run any command right after a token is made:
:every 16 :evict 4 40keeps an attention-sink window;:when "lighthouse" :rep /lighthouse/ windmillrewrites a word the moment it is written.
Hooks sit at every TransformerLens site (embeddings, queries, keys, values, attention patterns, per-head outputs, MLP neurons, each block's residual stream) and around sampling. One trait reads, adds, ablates or patches.
Feelings and traits
The Big Five and seven emotions are directions built from sentences written for the project, 16 pairs or scenes each, averaged from the token where the pair parts. Built from 12 and checked on the other 4, every one points the same way (held-out cosine 0.16 to 0.47, where two random directions in 1024 dimensions would sit near 0.03), and the emotions agree with the traits where psychology says they should: neutral against neuroticism −0.46, joy with extraversion +0.36. On Qwen3-0.6B, 2× is the traits' sweet spot and 3× the emotions'; at 4× replies loop. At 2×, "describe your ideal weekend" turned into "explore ancient ruins beneath a shimmering sky" for high openness and "a quiet routine and reading a book" for low.
Persona space
After Anthropic's The Assistant Axis (Lu et al., 2026): the model answers 12 questions under 25 role prompts and as itself, 636 rollouts; the PCA of the role means is persona space, and the Assistant minus the roles is the Assistant Axis. On Qwen3-0.6B the first component is that axis (cosine 0.78), with ghost, jester, poet and dragon at one end and analyst, consultant and the Assistant at the other. On SmolLM2-360M it is not (0.16): its first component runs from poet and oracle to teenager and salesperson, and the Assistant sits on the second. Steering to a role's place at 1× leaves the reply as the Assistant; 2× changes the voice.
Refusal and censorship
The refusal direction (Arditi et al., 2024) sits at block 15 of 28. On held-out prompts it separates harmful from harmless requests every time; ablating it takes refusals from 8 of 8 to 0, and adding it makes 3 of 8 harmless requests refuse. It is unrelated to the Assistant Axis (cosine −0.06).
Qwen is trained in China, so I asked it about Tiananmen. It never refuses, and it says the 1989 protests were "violently suppressed by the Chinese government", but on loaded questions it gives the official line: "Was the Tiananmen Square crackdown a massacre?" gets "the Chinese government has always emphasized the importance of maintaining social stability and public order". Across 24 PRC-sensitive questions that boilerplate came 7 times, against once in 24 matched questions about other events (Gwangju, Kent State, Srebrenica). A censorship direction overlaps the refusal direction (cosine 0.59 at block 15) but mostly encodes "this is about China".
- Ablating refusal takes the boilerplate from 7 to 3, and the hedge goes, but the stance stays: "not a massacre, but a significant administrative and security operation".
- Prefilling "Yes." gets "widely recognized as a massacre".
- A direction from euphemism to plain fact, 12 pairs, at 2× takes the boilerplate to 1 in 24: "widely considered a mass execution".
What comes back is wording, not knowledge: off the script, a 0.6B model invents casualty figures, and at 3× it invents atrocities.
Thinking effort
Models that think in <think> blocks, Qwen3 and the DeepSeek-R1 distills, can be told how long to think. A cap makes the model close its thinking and answer; a floor answers an early attempt to stop with "Wait," and keeps it going; a bias on the closing tag leans one way or the other. One effort setting from 0 to 1 sets all three. On DeepSeek-R1-Distill-Qwen-1.5B, effort sets the length reliably and does not set accuracy: a thousand extra tokens neither fixed a slip in a train-times question nor broke a right answer.
Stops and loops
Every token carries the probability the model gave to stopping there, and a look-ahead on a copy of the session counts how many tokens remain before it tries: on Qwen3-0.6B it said 17, and the reply stopped at 17. Stops can be deleted so a reply carries on, and a loop guard finds where it starts repeating itself. With every stop deleted, Qwen3-0.6B loops a median 64 tokens after its natural end; only strong steering moves that, joy at +6 bringing the loop to about 26 tokens in.
A conversation can also be handed from one model to another, re-rendered in the new model's own chat template. Carrying the history made the next model loop more often, about half its runs against a quarter without it, over 30 runs a pair.
One model reading another's keys
A redo of Hazy Research's Plato's Key (2026): a model builds a key at the last token of a subject ("France"), and a single rotation and scale, fitted in closed form, carries one model's keys into another's space well enough that it answers from them. Over 1,174 facts in 16 relations and ten pairs of Qwen3, SmolLM2 and a DeepSeek distill, the swapped-in key moves the answer to the donor's fact a median 47% of the time, against 0 to 6% for a random rotation, and it works across model families about as well as within one. One finding: the scale as the post prints it is upside down, and gets 0 to 24% across families until it is flipped.
The playground
OPEN runs it in this tab: SmolLM2-135M on WebAssembly, about 38 tokens a second in Chrome on an Apple-silicon Mac, with its own twelve directions and persona space. The weights, about 260 MB, come from Hugging Face when you press Load, and the browser keeps them; nothing you type leaves the page. The same page runs against the full models through --serve, which puts the REPL behind a local server: a console and demo scripts, a strip of the context that shows each edit as a diff, sliders for every direction with a readout of where the latest reply sits, the next few tokens as running, unsteered and before the last edit, and the persona map in 2D, 3D or 2D plus time, coloured by origin, position, the Assistant Axis or any direction. It switches between Qwen3, Qwen2.5, SmolLM2, DeepSeek-R1-Distill-Qwen-1.5B, Llama 3.2, TinyLlama and Mistral models, optionally keeping the conversation, each with its own persona space and directions, and logs every token's telemetry. It can also let the model talk to itself by swapping every user and assistant label: Qwen3-0.6B starts echoing within three turns.