Repository navigation
generate: residual control-vector projection from GGUFs - #15
Closed
j-luwierski wants to merge 3 commits into
Closed
j-luwierski wants to merge 3 commits into
j-luwierski wants to merge 3 commits into
Conversation
--control-vector-scaled FILE[:SCALE] (repeatable) loads a control-vector GGUF - the abliterate format: direction.<L> tensors, one n_embd-wide F32/F16/BF16 vector per layer - normalizes each direction and projects the scaled component along it out of every hyper-connection residual stream after that layer's FFN write. --cvec-mode project and --cvec-dir per-layer name the operation and its layout (the only supported values); --control-vector-layer-range FIRST LAST restricts which layers load directions, llama.cpp's flag, inclusive on both ends: directions outside are never parsed nor uploaded, and a reversed range is refused at argument validation. The plan is static for the process (vectors uploaded once), so the projections are ordinary nodes of the captured layer graphs. The projection runs in prefill, token decode and the verify window, always right after the half's write it projects; fused GR is disabled for cvec runs so the projection sees the completed layer residual. A run without the flags never touches the stream: an unloaded plan returns before touching anything, so captured graphs and output are unchanged. run-iq3_xxs-steered.sh now drives the Qwen3.8-Flash-Next refusal projection vector (layers 4..44) through the new flags.
Owner
|
Give me an hour please. |
The launcher was welded to strata-iq3_xxs.json, and the repository serves several quantizations - each with its own config. The script is now run-steered.sh [CONFIG]: with no argument it uses the single strata-*.json in the repository root (several found: it names them and stops; none: it says so). The config file itself is untouched - a temp copy gains the four control-vector flags, as before. The layer range moves to STEERING_FIRST / STEERING_LAST (default 4..44) beside STEERING_SCALE and STEERING_VECTOR, and the run is refused loudly on a missing vector file or an out-of-range layer window. Verified in a sandbox: single-config auto-detection, the multi-config listing (exit 2), an explicit path, the env overrides (scale 2.5, layers 2..10 land on the GEN line), the missing-vector refusal, and the four flags landing on the config's args in the engine's spelling.
j-luwierski
force-pushed
the
control-vector-pr
branch
from
September 26, 2026 22:50
ac493d9 to
bc9b18c
Compare
j-luwierski
marked this pull request as draft
September 27, 2026 09:23
j-luwierski
marked this pull request as ready for review
September 27, 2026 09:32
Owner
|
Thanks for this, and sorry it sat so long. This landed in v0.1.9 as the experimental speed projection. It's the same idea: the same llama.cpp-style flags ( I implemented it separately rather than merging this branch:
The vector ships in So I'm closing this without merging, and none of the changes from this branch are applied (they'd conflict with the new code). Thanks for the idea and the pointer to the vector. |
Contributor
Author
|
Sure, I understand. No worries. I had a lot of fun trying my hand at this
task anyway :) Great job, by the way. I'll try to come up with a different
new PR.
*POZDRAWIAM*
J*akub L**uwierski*
niedz., 27 wrz 2026, 17:43 użytkownik Niko ***@***.***>
napisał:
… *Niko1221* left a comment (Niko1221/Strata#15)
<#15 (comment)>
Thanks for this, and sorry it sat so long. This landed in v0.1.9 as the *experimental
speed projection*. It's the same idea: the same llama.cpp-style flags (
--control-vector-scaled, --control-vector-layer-range 4 44, --cvec-mode
project, --cvec-dir per-layer) and the same operation, h -= s (h.v) v on
the residual after each steered layer, with a refusal-direction projection
vector.
I implemented it separately rather than merging this branch:
- one kernel that runs on every hyper-connection stream right after
each layer's FFN write, in all three paths (per-token decode, the verify
windows and the batched prompt path);
- a per-request switch (a toggle in the web app, or "experimental_speed_projection":
false in the API). Switched off, the output is token-for-token the
stock model's;
- setup asks for it and defaults to off, and the docs label it
experimental and say what it does (fewer refusals).
The vector ships in data/experimental-speed-projection/.
So I'm closing this without merging, and none of the changes from this
branch are applied (they'd conflict with the new code). Thanks for the idea
and the pointer to the vector.
—
Reply to this email directly, view it on GitHub
<#15?email_source=notifications&email_token=AV2UZBD5C6DITLB4KN32XGT5REYTPA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKOBVG4ZTGOJUGAY2M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#issuecomment-5857339401>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AV2UZBEI7DVZ2DIVE2KS4VD5REYTPAVCNFSNUABGKJSXA33TNF2G64TZHMYTGOBVHE2DMMZQGE5US43TOVSTWNJVHE3TANJSGEZTJILWAI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
FlareP1
pushed a commit
to FlareP1/Strata
that referenced
this pull request
Oct 13, 2026
…e: a re-split GGUF may name the architecture on every shard; a later shard must name the first one's Upstream's ccfdc2e (in this branch since 0.1.43) already ran the guard on the first shard only; the pull request's form adds the same-architecture check for the later shards. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Niko1221
added a commit
that referenced
this pull request
Oct 23, 2026
…never says the same version twice; max_tokens below 1 is a 400 (TUI stress X01, #18, #15) X01: TestStartFailed has one text builder (TestStartFailed.plain): what did not work in plain words, that nothing was installed and the current engine is unchanged, and one next step (`strata update --force`, or a plain retry when the card was busy). The engine's own words stay in .reason, the state file and the JSON. The app's message matcher also accepts the new wording. Hints that a caller passes, such as the one for a busy launch, are used as they are, so the launch-holds-the-card line of f-023-tui1 composes with it. #18: `components rollback` when an earlier rollback is still in force says the engine is already the previous one and what to run, instead of "0.1.45.3 -> 0.1.45.3". #15 (K05): max_tokens, max_completion_tokens and max_output_tokens below 1 are a 400 naming the field (they used to mean "no cap"); an unknown model id is still answered by the loaded model, now documented in DETAILS.md.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds residual control-vector projection to the engine: per-layer control vectors loaded from GGUF files are projected onto the residual stream during generation, so model behaviour can be steered at inference time without modifying the weights.
New options
--control-vector-scaled- enable the projection with a given strength--control-vector-layer-range- apply the vector only to a range of layers--cvec-mode project- projection mode--cvec-dir- directory with the per-layer GGUFsReady-to-use control vector
A refusal-projection control vector for Qwen3.8-Flash-Next can be downloaded from:
https://huggingface.co/Cudecnik/Qwen3.8-Flash-Next-refusal-projection