Directional Steering in ds4: How to Use It With the --power Flag Below 100

Directional steering lets you bias a language model's hidden states using pre-computed direction vectors, and you can safely combine it with --power values under 100 to reduce GPU energy consumption without affecting steering behavior.

Directional steering is a powerful feature in antirez/ds4 that allows fine-grained control over model outputs by manipulating internal representations. The --power flag operates independently, throttling GPU duty cycles for thermal or battery management. This guide explains how both mechanisms work and how to use them together effectively.

What Is Directional Steering?

Directional steering is a technique that biases hidden states toward or away from specific direction vectors computed for each transformer layer. Instead of modifying prompts or fine-tuning weights, you directly influence how the model "thinks" at the representation level.

The steering mechanism works by:

  • Loading a binary file containing 32-bit float direction vectors — one per layer — at startup
  • Projecting attention or FFN outputs onto these directions
  • Applying positive scaling to subtract the projection, or negative scaling to add it

In ds4.c, the loading routine handles this initialization (lines 15902–15938), while metal_graph_apply_directional_steering performs the actual projection and scaling operations (lines 15852–15865).

Steering Control Flags

Two independent scaling knobs determine where steering is applied:

Flag Default Effect
--dir-steering-attn F 0 Steering after attention blocks
--dir-steering-ffn F 1 (when direction file supplied) Steering after feed-forward network blocks

According to ds4_help.c (lines 221–223), these defaults apply automatically when you provide a direction file. You can override them explicitly for finer control.

How the --power Flag Works

The --power flag is completely unrelated to steering. It controls GPU duty-cycle throttling to limit power consumption and heat generation.

In ds4.c (lines 15622–15645), the power-throttling helpers implement this by inserting sleep intervals into the compute loop. A --power 50 value means the GPU active duty cycle is reduced to approximately 50%, with the remaining time spent sleeping.

Key implications:

  • Lower --power values increase latency but reduce energy draw
  • Steering calculations still execute normally; only their scheduling changes
  • No steering parameters are modified or degraded by power throttling

Combining Steering With --power Below 100

Since the two systems are orthogonal, you can apply directional steering at any power level. Here are practical patterns for common scenarios.

Moderate Steering With Reduced Power

Apply balanced FFN and attention steering while running at 50% GPU capacity:

ds4 -p "Summarize the article" \
    --dir-steering-file dir.bin \
    --dir-steering-ffn 0.8 \
    --dir-steering-attn 0.2 \
    --power 50

This configuration maintains steering influence while keeping thermals down during long inference sessions.

Aggressive Steering With Minimal Power

Maximize steering effect on FFN outputs for stronger behavioral shifts, even at 30% power:

ds4 -p "Explain quantum tunneling in layman's terms" \
    --dir-steering-file dir.bin \
    --dir-steering-ffn 1.2 \
    --power 30

The higher FFN scaling compensates for any perceived "weakening" of model personality, while the reduced power setting extends battery life on portable devices.

Interactive Session With Dynamic Adjustments

The ds4 REPL lets you toggle both systems without restarting:

$ ds4
ds4> /power 40
ds4> /dir-steering-file dir.bin
ds4> /dir-steering-ffn 0.6
ds4> /dir-steering-attn 0.4
ds4> Write a creative story about artificial consciousness

Use /power interactively to find the thermal/latency tradeoff that works for your hardware.

Creating and Loading Direction Files

Direction files must be binary files of 32-bit floats. The engine expects one vector per layer, with dimensions matching the model's hidden size. The file is specified with:

--dir-steering-file /path/to/directions.bin

If this flag is omitted, all steering functionality is disabled regardless of other flags.

Implementation Details

According to the antirez/ds4 source code, the relevant components are:

  • ds4.c — Core steering logic: loading vectors (15902–15938) and applying projections (15852–15865)
  • ds4_cli.c — CLI parsing for --dir-steering-* and --power flags (1918–1921, 1924–1933)
  • ds4_server.c — Server-mode flag propagation
  • ds4_help.c — Documentation strings for steering options (221–223)

The separation of concerns in these files ensures that power throttling (ds4.c lines 15622–15645) never interferes with the numerical operations of directional steering.

Performance Considerations

When using --power below 100 with steering enabled:

  1. Throughput drops linearly with power percentage — expect ~2× latency at 50% power
  2. Steering computation cost is negligible compared to transformer forward passes
  3. Thermal throttling is avoided, preventing automatic frequency reduction that would hurt both speed and steering consistency

For production deployments where steering behavior must be deterministic, prefer stable --power settings over dynamic thermal management.

Summary

  • Directional steering biases hidden states via layer-specific direction vectors loaded from binary files
  • Two scaling flags (--dir-steering-attn and --dir-steering-ffn) control steering placement with sensible defaults
  • The --power flag independently throttles GPU duty cycles for energy management without affecting steering mathematics
  • Both features can be combined freely — steering applies to model behavior, --power applies to hardware scheduling

Frequently Asked Questions

What happens if I set --power to 100 with steering enabled?

At --power 100, the GPU runs at full duty cycle with no artificial sleeping. Steering applies normally with minimal latency. This is the default behavior when --power is unspecified.

Can steering direction files be created from any model?

Direction files must match the architecture of the model being steered — layer count, hidden dimension, and dtype. The ds4 engine performs no validation beyond basic size checks; mismatched files produce garbage outputs or crashes.

Why does --dir-steering-ffn default to 1 when a file is provided?

FFN steering typically produces more consistent behavioral shifts than attention steering, which can destabilize coherence at high scales. The default prioritizes safe, effective steering for users who supply direction files without reading full documentation.

Does reducing --power affect steering strength?

No. Steering strength depends solely on the --dir-steering-* float values and the direction file contents. --power only changes how long the GPU sleeps between computation batches, not what values are computed.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →