[PR #15] [CLOSED] generate: residual control-vector projection from GGUFs #2416

Closed
opened 2026-11-04 01:59:56 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/15
Author: @j-luwierski
Created: 9/26/2026
Status: ❌ Closed

Base: main ← Head: control-vector-pr


📝 Commits (3)

  • e78d241 generate: residual control-vector projection from GGUFs
  • bc9b18c steer: run-steered.sh takes the run config as an argument
  • a23f726 Merge branch 'main' into control-vector-pr

📊 Changes

10 files changed (+466 additions, -6 deletions)

View changed files

📝 CMakeLists.txt (+1 -1)
➕ include/strata/core/steer.hpp (+61 -0)
📝 include/strata/kernels/elementwise.hpp (+4 -0)
➕ run-steered.sh (+73 -0)
📝 src/core/layer.cpp (+8 -2)
➕ src/core/steer.cpp (+208 -0)
📝 src/core/verify.cpp (+15 -1)
📝 src/kernels/cuda/elementwise.cu (+26 -0)
📝 src/prefill/prefill.cpp (+3 -1)
📝 src/program/generate.cpp (+67 -1)

📄 Description

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 GGUFs

Ready-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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/15 **Author:** [@j-luwierski](https://github.com/j-luwierski) **Created:** 9/26/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `control-vector-pr` --- ### 📝 Commits (3) - [`e78d241`](https://github.com/Niko1221/Strata/commit/e78d2413960c376c3f43796fe367bfd4c1017448) generate: residual control-vector projection from GGUFs - [`bc9b18c`](https://github.com/Niko1221/Strata/commit/bc9b18c5147aaf88a6057ad7b64fc08446660ad0) steer: run-steered.sh takes the run config as an argument - [`a23f726`](https://github.com/Niko1221/Strata/commit/a23f72613a40304b47a8dc812a158753d798dd31) Merge branch 'main' into control-vector-pr ### 📊 Changes **10 files changed** (+466 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+1 -1) ➕ `include/strata/core/steer.hpp` (+61 -0) 📝 `include/strata/kernels/elementwise.hpp` (+4 -0) ➕ `run-steered.sh` (+73 -0) 📝 `src/core/layer.cpp` (+8 -2) ➕ `src/core/steer.cpp` (+208 -0) 📝 `src/core/verify.cpp` (+15 -1) 📝 `src/kernels/cuda/elementwise.cu` (+26 -0) 📝 `src/prefill/prefill.cpp` (+3 -1) 📝 `src/program/generate.cpp` (+67 -1) </details> ### 📄 Description ## 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 GGUFs ## Ready-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 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-04 01:59:56 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#2416
No description provided.