2026-10-11 16:37 UTC

Antirez claims ds4's released directional-steering tools alter model verbosity through runtime activation edits without retraining, providing local deployments with a behavioral control beyond prompting.

state: seedheat: mediumuncertainty: mediumconvergesscott: highlocal-inference activation-steering model-controlantirez

What is this?

Antirez (Salvatore Sanfilippo, creator of Redis) has released DS4 (DwarfStar 4), a local inference engine for DeepSeek V4 Flash and GLM 5.3 Flash on Metal, CUDA, and ROCm. DS4 includes 'directional steering' โ€” a runtime activation-editing feature that loads precomputed per-layer vectors and applies a scalable low-rank edit during the forward pass, without retraining or new weights on disk. The steering vectors are extracted from activation captures and can adjust coarse behaviors like verbosity (negative scale for shorter answers, positive for longer) at runtime via a CLI command (/steer). Antirez explicitly notes excessive steering causes degradation and the method works best for coarse, consistent directions. The implementation is pinned in the ds4 repo (dir-steering/) and demonstrated in local CLI/agent sessions.

Why it matters to Scott

Antirez (Redis creator) ships a pinned, testable implementation of runtime activation steering โ€” the exact primitive Scott's Perceptual Engineering, Soft Weights, and Worldview Patch frameworks treat as foundational for local, sovereign model control. This is not merely an illustration: a peer-level systems builder demonstrates steering vectors as a runtime control primitive for verbosity/behavior in a local inference engine (DS4) with measured degradation boundaries, directly extending the 'steering vectors as a control primitive for coding agents' pattern across Scott's agent-native and code-first architectures.
ip:concept.perceptual-engineeringip:concept.soft-weightsip:concept.epistemic-conditioningip:concept.worldview-patchip:framework.agent-native-computingip:framework.code-first-architectureip:framework.micro-agents-architectureip:concept.code-as-step-between-model-runsdev:concept.hardware-aware-local-inferencedev:project.gamepcdev:technology.ollamadev:technology.mlxip:framework.sovereign-software-assuranceip:framework.platform-escape-pathip:concept.vendor-lock-inradar:concept.activation-steeringradar:transformer-spherical-steering-validationradar:concept.model-controlradar:concept.local-inferenceradar:concept.open-weight-modelsradar:concept.sovereign-airadar:concept.coding-agentsradar:concept.agent-controlradar:person.llama-cppradar:person.ggml-orgradar:concept.inference-enginesradar:concept.developer-tools
queries asked of Scott's wikis
  • local inference engine patterns and open-weight model serving
  • activation steering / representation engineering for runtime model control
  • runtime model behavior modification without retraining
  • builder patterns: solo developers shipping production local-AI infrastructure
  • steering vectors as a control primitive for coding agents
  • open-weight model sovereignty and local deployment economics

Measured heat

now 0 pts/hpeak 0 pts/hcomments 0/hpeers p14momentum: steady2 platformsage 502h
points/hour across evidence ยท reading as of 2026-10-12 02:59:37.977291+11:00 ยท deterministic, not a model opinion

How the heat travelled

09-20 17:36โญ origin directly observedDirectional steering is a runtime activation edit for DS4
Bluestein on hacker news
โ€”
09-20 23:22first on github (echo) ยท first seen by us ยท +5.8hDocuments per-layer runtime directional edits, extraction and evaluation tools, and local examples showing shorter or longer answers dependi
antirez
โ€”
09-20 17:36amplified on hacker news ๐Ÿ‘‘hn.story.49778003
Bluestein
peak 2 ยท 0 comments ยท 98% of case engagement
09-20 18:20our radar first saw it ยท +0.7hdiscovery anchor: hn.story.49778003โ€”
pace: p23 vs 1032 stories at the 336h mark (now 502h old) โ€” ahead of aafp-commons-signed-agent-notebook (2.0x), behind agentgate-signed-agent-receipts (0.7x)

Evidence (2) โ€” โญ canonical anchor

sourceobjectauthorscorecomments
๐ŸŸง hn โญDirectional steering is a runtime activation edit for DS4
Retrieved article excerpt

Open article ยท Retrieved 2026-09-20T19:22:40.116013+00:00

# Directional Steering

Directional steering is a runtime activation edit for DS4. A steering file is a
flat `f32` matrix with one normalized hidden-width direction per normal
transformer layer. During inference, ds4 can apply the edit after attention
outputs, FFN outputs, or both:

```
y = y - scale * direction[layer] * dot(direction[layer], y)
```

Positive scale removes the represented direction. Negative scale amplifies it.
With no steering file or zero scales, ds4 follows the normal inference path.

The file shape depends on the model:

- DeepSeek V4 Flash: `43 x 4096`.
- GLM 5.3 Flash: `45 x 4096`. The separate MTP predictor layer is omitted.
- Qwen3.8 Flash Next: `48 x 2560`. FFN steering is applied to each
  hyper-connection branch of the residual; dumps average those branches
  at the last prompt token.

GLM 5.2 steering is not implemented.

## Runtime Options

```
--dir-steering-file FILE   load one f32 direction per normal model layer
--dir-steering-ffn F       apply steering after FFN outputs; default is 1 when a file is provided
--dir-steering-attn F      apply steering after attention outputs; default is 0
```

The FFN output is usually the best first target because it is late enough in
each layer to represent behavior, style, and topic signals. Attention steering
is available for experiments, but it can be more fragile.

## GLM 5.3 Example

Build a GLM 5.3 direction from paired target and control prompt lists:

```
python3 dir-steering/tools/build_direction.py \
  --profile glm-5.3-flash \
  --ds4 ./ds4 \
  --model gguf/GLM-5.3-Flash-Q2.gguf \
  --good-file /path/to/target-prompts.txt \
  --bad-file /path/to/control-prompts.txt \
  --out dir-steering/out/glm53-direction.json \
  --component ffn_out \
  --ctx 512
```

Generated `.f32` vectors are local artifacts and are not stored in the
repository. GLM 5.3 steering works with `--mtp`, `ds4-server`, native session
batching, and two-Mac tensor parallelism. For tensor parallelism, pass the same
steering file and scales to both the worker and coordinator.

## Verbosity Example

The bundled example builds a style direction from 100 paired prompts. Each pair
asks for the same information in two ways:

- `examples/succinct.txt`: terse target prompts.
- `examples/verbose.txt`: detailed contrast prompts.

Because the extracted direction is `succinct - verbose`, negative FFN scales
make answers shorter, while positive FFN scales tend to make answers longer and
more explanatory.

Build the vector:

```
python3 dir-steering/tools/build_direction.py \
  --profile deepseek-v4-flash \
  --ds4 ./ds4 \
  --model ds4flash.gguf \
  --good-file dir-steering/examples/succinct.txt \
  --bad-file dir-steering/examples/verbose.txt \
  --out dir-steering/out/verbosity.json \
  --component ffn_out \
  --ctx 512
```

This writes:

```
dir-steering/out/verbosity.json
dir-steering/out/verbosity.f32
```

Try a terse run:

```
./ds4 -m ds4flash.gguf --nothink --temp 0 -n 160 \
  --dir-steering-file dir-steering/out/verbosity.f32 \
  --dir-steering-ffn -1 \
  -p "Explain why databases use indexes."
```

Try a verbose run:

```
./ds4 -m ds4flash.gguf --nothink --temp 0 -n 220 \
  --dir-steering-file dir-steering/out/verbosity.f32 \
  --dir-steering-ffn 2 \
  -p "Explain why databases use indexes."
```

The same vector can be used in either direction. The sign is the important part:

- negative scale amplifies the succinct target direction;
- positive scale suppresses that direction and usually gives the model more room
  to elaborate.

## Evaluating Scales

Use the sweep helper to test several strengths on a fixed prompt set:

```
python3 dir-steering/tools/run_sweep.py \
  --ds4 ./ds4 \
  --model ds4flash.gguf \
  --direction dir-steering/out/verbosity.f32 \
  --prompts dir-steering/examples/eval_prompts.txt \
  --scales "-1,-0.5,0,0.5,1,2" \
  --tokens 180 \
  --nothink
```

Start with FFN scales between `-1` and `2`. If the model becomes repetitive,
ignores the prompt, or starts losing factual content, the scale is too strong.
For this example, `-1` is a good first terse setting and `2` is a good first
verbose setting. Strong negative scales such as `-2` or `-3` can over-amplify
the terse direction and collapse into repetition on some prompts.

## Observed Effect

With the 100-pair vector built from the commands above, local greedy checks
showed the expected behavior:

- Prompt: `Explain why databases use indexes.`
- `--dir-steering-ffn -1`: 67 words, one compact paragraph.
- `--dir-steering-ffn 0`: 136 words, structured explanation.
- `--dir-steering-ffn 1`: 140 words, structured explanation with more detail.

On a prompt that the unsteered model already answered briefly, positive steering
made the expansion more visible:

- Prompt: `What does DNS do?`
- `--dir-steering-ffn 0`: 44 words.
- `--dir-steering-ffn 2`: 171 words, with sections and step-by-step detail.

## Building Other Directions

The extractor compares two prompt sets:

- `good-file`: target prompts for the direction you want to represent.
- `bad-file`: contrast prompts that should be separated from the target.

It captures DS4 activations from the same local GPU graph used for inference,
averages target minus contrast, normalizes one vector per layer, and writes both
metadata JSON and the runtime `.f32` file.

Concept removal:

1. Put concept-heavy prompts in `good-file`.
2. Put neutral prompts in `bad-file`.
3. Run with a positive FFN scale.

Concept amplification:

1. Put desired concept prompts in `good-file`.
2. Put neutral prompts in `bad-file`.
3. Run with a negative FFN scale.

Style control:

1. Put prompts for the target style in `good-file`.
2. Put contrasting style prompts in `bad-file`.
3. Use negative scale to amplify the target style, positive scale to reduce it.

The method is not a fine-tune. It is a low-rank runtime edit, so it works best
for coarse behavior, topic, or style directions that are consistently present in
the activation captures.

## Qwen3.8 Flash Next

Capture uses `--think` / `--nothink`
(not `--think-high`). Dumps track the prompt phase explicitly, including
one-token tails, and retain the last prompt token during ordinary and MTP
decode. `attn_out` captures the output projection of both GDN and full-attention
layers, giving one row for each of the 48 trunk layers:

```
python3 dir-steering/tools/build_direction.py \
  --profile qwen3.8-flash-next \
  --ds4 ./ds4 \
  --model gguf/Qwen3.8-Flash-Next-Q4.gguf \
  --good-file /path/to/target-prompts.txt \
  --bad-file /path/to/control-prompts.txt \
  --out dir-steering/out/qwen38-direction.json \
  --component ffn_out \
  --ctx 512
```

Qwen steering is Metal-only. `--mtp-model`, SSD streaming, and `--power`
remain unsupported for this graph. The bank contains only the 48 trunk layers;
the embedded MTP predictor remains unsteered. Its drafts are verified by the
steered target trunk, so `--mtp` remains supported.
Bluestein20
๐ŸŸง echo.githubDocuments per-layer runtime directional edits, extraction and evaluation tools, and local examples showing shorter or longer answers dependiantirezโ€”โ€”

Interpretation history

Decision trace