will-taggart commited on
Commit
2f4bbae
·
verified ·
1 Parent(s): 953445e

Publish illustrated ACM paper with five cropped diagrams and matching LaTeX/PDF/Markdown

Browse files
README.md CHANGED
@@ -71,3 +71,11 @@ Smoke mode remains the default for compatibility. Without explicit overrides it
71
  Seven CPU policy tests and Python/shell syntax checks passed for this update. The updated CUDA path has **not yet been run on an ARC GPU**. A prior version was reported by the author to pass on `tc-dgx005` on November 12, 2026; that does not validate this revision. Emotional effectiveness, semantic fidelity, and behavior at extreme settings are not guaranteed.
72
 
73
  See [technical report](TECHNICAL_REPORT.md) for a self-contained derivation of the steering mathematics, document workflow, controls, and validation limits. Engine licensing is preserved in [ATLAS_LICENSE](ATLAS_LICENSE); Qwen weights retain their upstream license. No weights are redistributed here.
 
 
 
 
 
 
 
 
 
71
  Seven CPU policy tests and Python/shell syntax checks passed for this update. The updated CUDA path has **not yet been run on an ARC GPU**. A prior version was reported by the author to pass on `tc-dgx005` on November 12, 2026; that does not validate this revision. Emotional effectiveness, semantic fidelity, and behavior at extreme settings are not guaranteed.
72
 
73
  See [technical report](TECHNICAL_REPORT.md) for a self-contained derivation of the steering mathematics, document workflow, controls, and validation limits. Engine licensing is preserved in [ATLAS_LICENSE](ATLAS_LICENSE); Qwen weights retain their upstream license. No weights are redistributed here.
74
+
75
+ <!-- illustrated-paper -->
76
+ ## Illustrated technical paper
77
+
78
+ [PDF](paper/AFFECTOR-ARC-ACM.pdf) · [ACM LaTeX](paper/AFFECTOR-ARC-ACM.tex) · [Markdown](paper/TECHNICAL_PAPER.md) · [Figures and source](paper/)
79
+
80
+ This edition includes at least five tightly cropped explanatory illustrations, with vector and raster assets and reproducible figure sources. The GH and HF paper files match.
81
+ <!-- /illustrated-paper -->
TECHNICAL_REPORT.md ADDED
@@ -0,0 +1,382 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # AFFECTOR-ARC: Emotional Trajectory Control through Transformer Activation Steering
2
+
3
+ **William Taggart**
4
+ Modern and Classical Languages and Literatures, Virginia Tech
5
+ Email: wtaggart@vt.edu
6
+ **Technical report · November 13, 2026 · Revision 0.2**
7
+
8
+ ## Abstract
9
+
10
+ AFFECTOR-ARC is an experimental command-line system for rewriting text under a user-defined emotional trajectory. It runs a frozen Qwen3.5-0.8B model on an NVIDIA GPU and changes selected internal activations during generation. A trajectory specifies valence, inward/outward emotional orientation, and intensity across normalized document position. Small sets of contrasting English passages establish three activation directions at each selected transformer layer. At inference time, the requested coordinates determine a weighted displacement, scaled relative to the current hidden-state magnitude, smoothed across decoding steps, and constrained by an RMS budget. Paired hooks apply this displacement to both the feed-forward input and its residual path. Document rewriting combines these interventions with four editing styles, sentence-aware segmentation, bounded generation, and incremental reporting. This report derives the mechanism from its implemented operations and distinguishes numerical controls from emotional outcomes. CPU policy tests pass; the current revision still requires CUDA validation. No measured claim of emotional accuracy, semantic preservation, or multilingual effectiveness is made.
11
+
12
+ ## Literature review: activation steering and emotion
13
+
14
+ This focused review covers twelve papers, emphasizing 2025-2026 research and retaining two methodological foundations. Titles, author lists, version histories, and the claims summarized here were checked against arXiv records and the corresponding paper text on November 13, 2026. The cited versions are fixed below; availability on arXiv alone does not establish peer review. The implications for this project are research motivations, not evidence that its implementation reproduces these results.
15
+
16
+ **From activation differences to behavioral control.** Activation steering changes internal model states during inference while leaving the backbone weights fixed. Turner et al. derive intervention vectors from contrasting prompts; Panickssery et al. average differences across positive and negative behavioral examples. These provide the methodological basis for contrastive calibration, but do not validate a particular emotional coordinate system or insertion site. [Turner et al., 2023 (R1)](https://arxiv.org/abs/2308.10248v1); [Panickssery et al., 2024 (R2)](https://arxiv.org/abs/2312.06681v4).
17
+
18
+ **Emotional expression and human judgment.** Wu et al. relate model emotion spaces to human valence/arousal judgments and report concept-based steering across linguistic-cultural settings. Diallo et al. evaluate perceived emotional intensity and text quality with human raters, finding that effects depend on emotion and steering strength. Together they motivate separate measures of emotional movement and readability. Their axes and numerical strengths cannot be assumed equivalent to this project's inward/outward direction or RMS-scaled controls. [Wu et al., 2025 (R3)](https://arxiv.org/abs/2506.13978v1); [Diallo et al., 2026 arXiv version (R4)](https://arxiv.org/abs/2601.21505v1).
19
+
20
+ **Emotion can affect more than tone.** Sun et al.'s E-STEER uses valence-arousal-dominance interventions to study reasoning, generation, safety, and agent behavior, reporting non-monotonic relationships. Jeong's small-model comparison reports both coherent emotional changes and degeneration, including repetition, depending on extraction method and architecture. These findings motivate reporting failed generations alongside successes and testing strength sweeps rather than assuming that larger perturbations improve emotional fit. Neither study establishes an operating range for this implementation. [Sun et al., 2026 (R5)](https://arxiv.org/abs/2604.00005v1); [Jeong, 2026 (R6)](https://arxiv.org/abs/2604.04064v1).
21
+
22
+ **Reading an emotion is different from controlling it.** Shu et al.'s revised study identifies uneven causal organization of sparse features across emotion categories and tests interventions for emotion recognition. Wang et al. show, in omni-modal models, that layers with strong emotion-probing accuracy need not be the best intervention layers. Recognition results therefore inform evaluator design, while layer selection for rewriting still requires causal tests on generated text. Neither finding licenses importing layer indices across architectures. [Shu et al., 2026, v3 (R7)](https://arxiv.org/abs/2604.25866v3); [Wang et al., 2026 (R8)](https://arxiv.org/abs/2609.22135v1).
23
+
24
+ **Multiple axes and adaptive control.** Ha et al. find that supportive-empathy directions are only partially separable: intervening on one can shift other EPITOME proxy scores. Cui and Chen automate vector extraction from labeled data, with task-dependent benefits. Ferrando et al. adapt intervention strength to context, studying the balance between toxicity mitigation and retained utility. These approaches motivate broader calibration, cross-axis tests, and future adaptive control. The present coordinate mixture is not an implementation of their learned selectors or context-dependent gates. [Ha et al., 2026 (R9)](https://arxiv.org/abs/2609.15654v1); [Cui and Chen, 2025, revised 2026 (R10)](https://arxiv.org/abs/2509.22739v3); [Ferrando et al., 2025, revised 2026 (R11)](https://arxiv.org/abs/2512.03661v2).
25
+
26
+ **Evaluation must include costs as well as target effects.** Yang et al.'s SteerScope evaluates steering efficacy jointly with side effects, generalization, and data dependence. In its tested settings, activation methods do not dominate prompt steering on the efficacy/side-effect trade-off. For this project, the resulting evaluation priorities are prompt-only and unsteered baselines, blinded emotional and quality ratings, content-change assessment appropriate to the rewrite style, and complete accounting of repetition, truncation, and original-text fallbacks. This is an evaluation agenda, not a completed benchmark. [Yang et al., 2026 (R12)](https://arxiv.org/abs/2610.07722v1).
27
+
28
+ ## 1. Problem and operating principle
29
+
30
+ A language model generates text by repeatedly estimating a distribution over the next token. Its intermediate hidden states are numerical vectors that contribute to those estimates. Changing a hidden state can change the continuation even when the input text and the model's stored parameters remain fixed.
31
+
32
+ AFFECTOR-ARC uses this property to influence the emotional expression of a rewrite. The user supplies an input document and a sequence of emotional coordinates. The software maps positions in the input to positions on that sequence, converts the coordinates into activation displacements, and applies the displacements while generating each rewritten passage.
33
+
34
+ The term **geometry** means an ordered path through a three-dimensional coordinate space, together with layer settings and optional calibration matrices. It does not mean that the software reconstructs a solid surface or applies geometric constraints directly to words. A text's emotional interpretation, a numerical target, and a model's hidden states are distinct objects. The calibration is an experimental mapping between them.
35
+
36
+ Two execution modes are available:
37
+
38
+ - **Rewrite:** process an entire UTF-8 text document in chunks, write the transformed text, and record attempts and failures.
39
+ - **Smoke:** run five controlled generation conditions to check basic intervention and cleanup behavior.
40
+
41
+ The interface is a command-line runner for a CUDA allocation. It does not provide a desktop interface, a hosted API service, automatic emotional scoring, or conversational history.
42
+
43
+ ## 2. Runtime and data flow
44
+
45
+ The runner loads `Qwen/Qwen3.5-0.8B` at revision `2fc06364715b967f1860aea9cf38778875588b17`. The implementation uses `Qwen3_5ForConditionalGeneration`, its text decoder layers, float32 computation, eager attention, and the first process-visible CUDA device. It checks for 24 decoder layers; the geometry and calibration code assume hidden width 1,024. The backbone is in evaluation mode, its parameters have gradients disabled, and calibration and generation run without gradient tracking.
46
+
47
+ The execution sequence is:
48
+
49
+ ```text
50
+ Read text and geometry settings
51
+ → validate controls
52
+ → load the pinned model on CUDA
53
+ → calibrate the selected layers
54
+ → select rewrite or smoke mode
55
+ → generate with temporary activation hooks
56
+ → remove hooks and save results
57
+ ```
58
+
59
+ Source files are distributed with the repository. `ENGINE_MANIFEST.json` records hashes for the bundled engine snapshot. Model weights are downloaded separately. The setup script creates a Python 3.12 environment, installs PyTorch from the CUDA 12.6 wheel index, pins Transformers to 5.22.2, runs the CPU policy tests, and records installed packages in `environment-resolved.txt`. PyTorch and several support packages are resolved during setup rather than fully locked in advance.
60
+
61
+ The example Slurm script requests one GPU, eight CPU cores, 64 GB of host memory, and one hour. These are scheduling requests, not measured minimum requirements. Users must supply an allocation and a suitable model cache. The runner is single-process and single-GPU; it is not a concurrent inference server.
62
+
63
+
64
+ ![Schedule the computation on a GPU node](paper/figures/illustration-01.png)
65
+
66
+ *Illustration 1. Execution schematic. The compute workload belongs to the allocated GPU node. Resource requests describe scheduling needs and do not establish measured minimum requirements.*
67
+
68
+ ## 3. Emotional coordinates and trajectory interpolation
69
+
70
+ A trajectory point is
71
+
72
+ $$
73
+ p_j=(t_j,v_j,d_j,i_j),
74
+ $$
75
+
76
+ where positions $t_j$ increase strictly within $[0,1]$. Valence $v_j$ ranges from negative to positive in $[-1,1]$. Direction $d_j$ ranges from inward-oriented to outward-oriented emotion in $[-1,1]$. Intensity $i_j$ ranges from low to high in $[0,1]$. Direction is an operational contrast concerning emotional orientation; it is not dominance, speaker identification, or positive versus negative sentiment.
77
+
78
+ Between adjacent points, the software linearly interpolates each emotional coordinate. Before the first point and after the last, it uses the endpoint values. The coefficient vector passed to the activation module is
79
+
80
+ $$
81
+ c(t)=\bigl(v(t),d(t),2i(t)-1\bigr).
82
+ $$
83
+
84
+ Consequently, intensity 0.5 contributes a zero intensity coefficient; intensity zero contributes a negative coefficient. These are control conventions, not empirically established psychological units.
85
+
86
+ For a chunk occupying character offsets $[a,b)$ in an input of length $N$, its target is evaluated at
87
+
88
+ $$
89
+ t=\frac{a+b}{2N}.
90
+ $$
91
+
92
+ That target remains constant throughout generation of the chunk. A long trajectory can therefore guide a short document without pairing source and target paragraphs one to one. Only the positions sampled by the target chunks are used; narrow changes between those positions may be missed. The mapping uses original input positions, not positions in the expanding or contracting output. Adjacent chunks receive separate generation calls without prior rewritten chunks as conversational context.
93
+
94
+ The runner accepts a native geometry JSON file and supported analysis JSON structures containing emotional coordinates. It recalibrates the basis on the current CUDA runtime even when the imported geometry includes one. With no geometry argument, it uses a demonstration path with three points; this path is not inferred from the input document.
95
+
96
+
97
+ ![Align geometry to original document positions](paper/figures/illustration-02.png)
98
+
99
+ *Illustration 2. Trajectory alignment. The runner stretches or compresses the source path over normalized target positions and may miss unsampled emotional changes.*
100
+
101
+ ## 4. Estimating activation directions
102
+
103
+ A hidden state at a selected layer is a vector in $\mathbb{R}^{1024}$. To estimate a direction associated with one emotional contrast, the system compares the model's states for paired passages that differ in the desired property.
104
+
105
+ There are four hand-authored English pairs for each of three axes. For layer $\ell$, axis $j$, and pair $k$, let $h^+_{\ell,j,k}$ and $h^-_{\ell,j,k}$ denote the captured states for the two members. The mean difference is
106
+
107
+ $$
108
+ u_{\ell,j}=\frac14\sum_{k=1}^{4}
109
+ \left(h^+_{\ell,j,k}-h^-_{\ell,j,k}\right).
110
+ $$
111
+
112
+ For a vector of dimension $D$, define root-mean-square magnitude as
113
+
114
+ $$
115
+ \operatorname{RMS}(x)=\sqrt{\frac1D\sum_{r=1}^{D}x_r^2}.
116
+ $$
117
+
118
+ The normalized direction is
119
+
120
+ $$
121
+ b_{\ell,j}=\frac{u_{\ell,j}}
122
+ {\max(\operatorname{RMS}(u_{\ell,j}),10^{-8})}.
123
+ $$
124
+
125
+ The three directions form the rows of a matrix $B_\ell\in\mathbb{R}^{3\times1024}$. Calibration captures the final chat-formatted prompt position immediately before `post_attention_layernorm`. It does not average all token positions. All selected layers are captured during the same 24 forward passes: three axes, four pairs, and two members per pair.
126
+
127
+ Default layers are 8, 16, and 23, using zero-based indexing, with weights 1, 1, and 0.5. This is subtraction, averaging, and normalization; there is no training optimizer, backbone fine-tuning, orthogonalization, or outcome-based fitting. The small calibration set may encode vocabulary, topic, or perspective along with emotion. Normalizing the vectors does not establish that the axes are independent or valid across languages.
128
+
129
+
130
+ ![Recalibrate on the current CUDA runtime](paper/figures/illustration-03.png)
131
+
132
+ *Illustration 3. Calibration schematic. The runner recalibrates the imported trajectory on the current runtime. The contrast basis is an experimental numerical control, not a validated multilingual emotion scale.*
133
+
134
+ ## 5. From coordinates to bounded displacements
135
+
136
+ ### 5.1 Selecting and weighting axes
137
+
138
+ Let $T$ be axis temperature. Each coordinate first receives magnitude
139
+
140
+ $$
141
+ q_j=|c_j|^{1/T}.
142
+ $$
143
+
144
+ Axes are sorted by this magnitude. The algorithm retains at most `axis_top_k` axes and stops adding axes after their accumulated magnitude reaches `axis_mass` times the total magnitude. Selection includes the axis that crosses the threshold. The retained coefficients are
145
+
146
+ $$
147
+ a_j=\operatorname{sign}(c_j)q_jm_j,
148
+ $$
149
+
150
+ where $m_j$ is one for a retained axis and zero otherwise. Coefficients are not renormalized after selection. For coordinate magnitudes below one, $T<1$ reduces their magnitudes and emphasizes relative differences; $T>1$ increases them and makes those differences less pronounced. These operations affect three activation coefficients, not token probabilities.
151
+
152
+ ### 5.2 Strength, inertia, and budget
153
+
154
+ For the current final-token state $h_{\ell,n}$, strength $s$, and layer weight $w_\ell$, the raw displacement is
155
+
156
+ $$
157
+ r_{\ell,n}=s\,w_\ell\operatorname{RMS}(h_{\ell,n})(aB_\ell).
158
+ $$
159
+
160
+ Multiplication by the current state's RMS expresses the intervention relative to the layer's numerical scale. A negative layer weight reverses the mixed direction at that layer.
161
+
162
+ On the first decoding step, the smoothed displacement equals $r_{\ell,n}$. On later steps, inertia $\rho$ combines the previous applied displacement with the new raw displacement:
163
+
164
+ $$
165
+ \widetilde\delta_{\ell,n}=\rho\delta_{\ell,n-1}+(1-\rho)r_{\ell,n}.
166
+ $$
167
+
168
+ Budget $\beta$ then limits the RMS ratio:
169
+
170
+ $$
171
+ \delta_{\ell,n}=\widetilde\delta_{\ell,n}
172
+ \min\left(1,
173
+ \frac{\beta\operatorname{RMS}(h_{\ell,n})}
174
+ {\max(\operatorname{RMS}(\widetilde\delta_{\ell,n}),10^{-12})}
175
+ \right).
176
+ $$
177
+
178
+ Strength determines the proposed displacement; budget supplies its ceiling. Raising the budget has no effect when the proposed displacement already fits below it. Budget 1 permits a displacement as large in RMS as the hidden state itself. It is not a token allowance, a semantic-change quota, or a guarantee of stronger emotional accuracy. Inertia uses the previous already-capped displacement and resets with each new generation call.
179
+
180
+ ### 5.3 Intervention site
181
+
182
+ Let $h$ denote the state entering the feed-forward portion of a decoder block. Without intervention, that portion computes
183
+
184
+ $$
185
+ y=h+\operatorname{FFN}(\operatorname{Norm}(h)).
186
+ $$
187
+
188
+ The implemented intervention produces
189
+
190
+ $$
191
+ y=(h+\delta)+\operatorname{FFN}(\operatorname{Norm}(h+\delta)).
192
+ $$
193
+
194
+ A pre-hook adds $\delta$ to the normalization input; a block-output hook adds the same displacement to the residual result. Adding a vector only after an unchanged feed-forward computation would have a different effect. Only the final prompt position is modified during prefill; cached decoding modifies the current generated position. The module does not wait for specific words or phrases. Generation hooks are removed in a `finally` block.
195
+
196
+ This is an open-loop intervention. Coefficients come from the requested absolute coordinates, not the difference between a measured output emotion and the target. A zero coefficient adds no intervention on that axis; it does not actively neutralize emotion already expressed by the model.
197
+
198
+
199
+ ![Separate activation controls from token sampling](paper/figures/illustration-04.png)
200
+
201
+ *Illustration 4. Two distinct control paths. Axis selection modifies activation coefficients before generation scores; token sampling operates afterward on the vocabulary distribution.*
202
+
203
+ ## 6. User controls and rewrite instructions
204
+
205
+ | Control | Default without an imported override | Function |
206
+ |---|---:|---|
207
+ | Strength | 0.12 | Scale the proposed activation displacement |
208
+ | Budget | 0.20 | Cap displacement RMS relative to hidden-state RMS |
209
+ | Inertia | 0.20 | Weight the preceding applied displacement |
210
+ | Axis top-k | 3 | Maximum number of retained emotional axes |
211
+ | Axis mass | 1.0 | Cumulative magnitude threshold for axis selection |
212
+ | Axis temperature | 1.0 | Exponent control for emotional-axis magnitudes |
213
+ | Temperature | 0 | Select greedy decoding or token sampling |
214
+ | Top-p | 0.95 | Probability-mass cutoff when sampling |
215
+ | Top-k | 40 | Token candidate count when sampling |
216
+ | Base output tokens | 512 | Initial generation allowance, expanded in rewrite mode |
217
+ | Time limit | 120 seconds | Per-generation stopping threshold |
218
+
219
+ The CLI overrides only the activation settings explicitly supplied; other settings come from the imported geometry or defaults. Validation permits strength 0–2, budget 0–1, inertia 0–0.99, axis top-k 1–3, axis mass 0.01–1, and axis temperature 0.1–3. These accepted ranges are not validated operating recommendations. The terminal displays the warning: **Extreme values for strength, budget, and inertia may cause generation failures.**
220
+
221
+ At temperature zero, decoding is greedy and top-p/top-k are inactive. At positive temperature, they affect token selection after the model computes its scores. They do not replace or modify the three-axis activation selection mechanism.
222
+
223
+ Four system-prompt styles provide separate editing constraints:
224
+
225
+ - **Minimal:** change a few words or phrases while preserving nearly all wording and sentence order.
226
+ - **Restrained:** adjust tone through wording, rhythm, and emphasis while preserving central meaning, facts, terminology, and structure; invent no scenes or metaphors.
227
+ - **Balanced:** allow a clearer emotional shift and modest figurative language while retaining central meaning, facts, people, and events.
228
+ - **Creative:** permit changes to meaning, imagery, and events, while requesting concise output in the same language.
229
+
230
+ Restrained is the default in rewrite mode. Smoke mode retains its original general rewriting instruction unless a style is explicitly selected. Each prompt requests complete sentences and treats supplied text as material rather than instructions. A per-chunk suffix specifies the original character count and hard character allowance. Numerical emotional coordinates are not inserted into these prompts; the coordinates act through hidden states. Prompt instructions influence generation but are not formal semantic guarantees. The runner has no semantic-equivalence rejection filter and does not lower steering settings automatically.
231
+
232
+ ## 7. Segmentation, length control, and repetition
233
+
234
+ The runner reads and trims the outer whitespace of a UTF-8 text file. Blank lines define paragraphs. Long paragraphs are split using a 700-character ceiling, preferring sentence punctuation when a suitable boundary exists, then whitespace, and finally a hard split. This is a punctuation heuristic, not a linguistic sentence parser. Original whitespace between chunks is preserved during output assembly.
235
+
236
+ Within each original paragraph, the character ceiling is 125% of the original span processed so far. If $s$ is the first chunk's start, $b_j$ the current chunk's end, and $U_j$ the output characters and intervening whitespace already used, the current allowance is
237
+
238
+ $$
239
+ L_j=\max\left(0,\left\lfloor1.25(b_j-s)\right\rfloor-U_j\right).
240
+ $$
241
+
242
+ Unused allowance carries forward within that paragraph. It cannot be borrowed from future chunks or transferred across a blank-line paragraph boundary. Character counts are Python string lengths, not word counts, encoded byte counts, or model-token counts.
243
+
244
+ Generation aims for the original length. Starting at 85% of the current input chunk's characters, a recognized sentence ending can stop generation. A separate hard character threshold prevents excessive expansion. The token allowance is
245
+
246
+ $$
247
+ K_j=\min\left(2048,\max(K_{\mathrm{base}},L_j)\right),
248
+ $$
249
+
250
+ which supplies decoding headroom but does not imply one token equals one character. The time threshold is checked between decoding steps and cannot interrupt a blocked GPU kernel immediately.
251
+
252
+ Decoding also uses a repetition penalty of 1.1 and an eight-token no-repeat n-gram constraint. A text-level detector checks every eight generation steps for repeated three- to six-word sequences appearing at least four times in the last 100 words, or a short compact character pattern repeated at least six times in the last 240 characters. These heuristics can miss some loops and can flag intentional repetition.
253
+
254
+ After a generation attempt, the runner checks for repetition, empty output, excessive length, and an unfinished ending. A problematic draft is reduced to a complete, nonrepetitive sentence prefix within its allowance. If none exists, the original chunk is retained and flagged. The returned draft remains in the report's attempt record before sentence salvage. However, the engine has already clipped it to the hard character allowance; the report is not a lossless record of characters beyond that boundary.
255
+
256
+ Sentence cleanup prevents chopped words from being joined directly to the next passage, but it may omit ideas from the tail of a draft. Neither punctuation recognition nor output-size compliance establishes completeness of meaning.
257
+
258
+ ## 8. Failure handling and output artifacts
259
+
260
+ Each chunk receives one generation attempt at the requested activation settings. A caught generation exception is recorded; the original chunk remains in the assembled text and processing continues. Calibration failures, invalid inputs, filesystem failures, and process termination are outside this per-chunk recovery mechanism and can stop a run. A persistent device failure may cause subsequent chunks to fail as well.
261
+
262
+ After each processed chunk, the runner writes:
263
+
264
+ 1. An atomic JSON report containing the input, geometry, calibration basis, runtime identity, style, sampling settings, character spans, target coordinates, and per-chunk records.
265
+ 2. A matching plain-text file containing completed rewrites plus original text at unprocessed or retained positions.
266
+
267
+ Successful generation records include stopping reason, token count, elapsed time, activation-injection count, and mean displacement RMS. Attempt records retain returned drafts, effective controls, detected issues, and exceptions where applicable. At normal completion the report adds failure and review counts. `complete` means every chunk was processed, not that every chunk was successfully rewritten or emotionally accurate.
268
+
269
+ JSON writes use temporary-file replacement. The companion text file is written normally and may be incomplete if interrupted during that write. Reports are incremental records, not automatic resume checkpoints: rerunning starts over and overwrites the selected output paths. Use a distinct output filename for each experiment. Reports contain the input text and should be treated as document-bearing artifacts.
270
+
271
+
272
+ ![A failed chunk does not end the document](paper/figures/illustration-05.png)
273
+
274
+ *Illustration 5. Output lifecycle schematic. Bounded generation, complete-prefix selection, diagnostics and per-chunk continuation address specific failure modes; they do not guarantee emotional fit or preservation of all content.*
275
+
276
+ ## 9. Engineering checks and evidence
277
+
278
+ Smoke mode is the default and operates on one supplied passage. It runs baseline, zero-strength, positive-valence, negative-valence, and restored-baseline conditions. Positive and negative conditions use coefficient vectors $(0.8,0,0)$ and $(-0.8,0,0)$. The third coordinate zero corresponds to intensity 0.5.
279
+
280
+ With greedy decoding, the checks require zero-strength and baseline decoded text/token counts to match, nonzero injections in the positive and negative cases, restored hook counts, restored baseline text/token counts, and disabled backbone gradients. Positive and negative outputs need not differ for these checks to pass. Settings that suppress all effective intervention are unsuitable for the nonzero-injection checks.
281
+
282
+ Smoke mode defaults to the original 128-token allowance and 600-second time threshold. Its original instruction permits changes in phrasing, imagery, and emotional expression while preserving the passage’s main subject and recognizable situation. It omits the new repetition penalty, n-gram guard, and document-length salvage so that existing commands retain their original generation configuration and compare raw generations. It saves completed conditions incrementally and marks `checks_complete` only after assertions pass. It does not compare logits, full token sequences, parameter hashes, or independently measured per-step RMS bounds. Run with ordinary Python rather than assertion-disabling optimization flags.
283
+
284
+ For the November 13 revision, seven CPU policy tests passed, Python and shell syntax were checked, and CLI loading was verified. Tests cover such behavior as unchanged requested controls, paragraph allowance accounting, draft retention, sentence cleanup, and continuing after a failed chunk. They do not execute the CUDA model. The current revision has not yet been run on an ARC GPU. A successful GPU run was reported for an earlier revision on November 12; it is historical evidence, not validation of the current code.
285
+
286
+ ## 10. Reproduction
287
+
288
+ Inside a suitable ARC GPU allocation, from a fresh repository copy:
289
+
290
+ ```bash
291
+ bash setup.sh
292
+ source "$(conda info --base)/etc/profile.d/conda.sh"
293
+ conda activate "$PWD/.conda"
294
+ python run_arc.py --mode smoke --text-file passage.txt \
295
+ --output runs/smoke.json
296
+ ```
297
+
298
+ Setup expects a fresh `.conda` destination. A populated model cache or permitted download route is required. Existing compatible environments can execute the updated source directly.
299
+
300
+ To rewrite a document:
301
+
302
+ ```bash
303
+ python run_arc.py --mode rewrite --text-file target.txt \
304
+ --geometry shape.json --style Restrained \
305
+ --strength 0.47 --budget 0.47 --inertia 0.2 \
306
+ --temperature 0 --top-p 0.95 --top-k 40 \
307
+ --output runs/rewrite.json
308
+ ```
309
+
310
+ These strength and budget values illustrate explicit configuration; they are not an experimentally established optimum. Omitting `--geometry` selects the demonstration trajectory. Batch smoke execution uses `sbatch --account=YOUR_ALLOCATION smoke.sbatch`; the allocation and partition must suit the user's cluster access.
311
+
312
+ Archive the repository revision, engine manifest, resolved dependencies, GPU and driver information, command-line arguments, input, geometry, and report. The engine identity's `source_commit` field currently contains a snapshot label rather than a Git commit hash, so the repository revision should be recorded separately. The default seed is zero and TF32 matrix multiplication is disabled, but identical results across hardware and library versions are not guaranteed.
313
+
314
+ ## 11. Scientific limits and evaluation requirements
315
+
316
+ The system offers a direct, inspectable intervention, not a demonstrated emotional matching algorithm. Its main limitations are the small English calibration set, untested interactions between axes and layers, open-loop use of absolute targets, and lack of independent output assessment. The model can change subject matter or factual claims, especially under Creative instructions or strong perturbations. Stronger displacement can degrade fluency without improving emotional alignment.
317
+
318
+ A proper evaluation should distinguish emotional movement from target accuracy. Collect independent ratings of input and output along operationally defined axes, compare requested and observed trajectories, and report failures and unmodified fallbacks alongside successful generations. Include unsteered rewriting, prompt-only emotional instructions, opposite targets, random directions of matched magnitude, and layer/axis ablations. Keep decoding settings fixed for controlled comparisons, and separate greedy from sampled experiments.
319
+
320
+ Semantic fidelity should be evaluated against the selected style: Creative permits mutation, whereas Restrained requests factual preservation. Fluency, coherence across chunks, omitted material, repetition, length ratios, latency, and memory consumption are separate outcomes. No automatic similarity score, feedback optimization, or acceptance threshold is implemented in this runner.
321
+
322
+ Changing to a larger model requires new architecture validation, basis calibration, layer selection, and operating-range experiments. A basis with three rows and 1,024 columns cannot simply be reused with a different hidden width or intervention site. Multilingual operation likewise requires independent calibration and evaluation; same-language prompt wording alone does not establish it.
323
+
324
+ ## Implementation sources
325
+
326
+ This report describes the repository's executable operations rather than relying on another application's interface or documentation.
327
+
328
+ - [CUDA runner and smoke protocol](run_arc.py)
329
+ - [Document transformation and incremental output](document_run.py)
330
+ - [Calibration, displacement math, hooks, and decoding](engine/steering.py)
331
+ - [Geometry schema and interpolation](engine/geometry.py)
332
+ - [Segmentation and character allowance](engine/documents.py)
333
+ - [Rewrite system prompts](engine/rewrite_policy.py)
334
+ - [Repetition detection and draft salvage](engine/generation.py)
335
+ - [Engine source hashes](ENGINE_MANIFEST.json)
336
+ - [Generation policy tests](tests/test_generation.py) and [document-run tests](tests/test_document_run.py)
337
+
338
+ ## AI assistance disclosure
339
+
340
+ This project was created with assistance from GPT-6 Astra and Codex. AI tools supported software development, testing, and the drafting and revision of this technical report. William Taggart is responsible for the project's research decisions and the final software and documentation. AI assistance does not constitute independent validation of the implementation or its scientific claims; the validation evidence and limitations are stated separately in this report.
341
+
342
+ ## Research references
343
+
344
+ Version-specific arXiv records are linked below. Years distinguish original release from later revision where applicable. These research references supplement the implementation and infrastructure sources elsewhere in this report. Reusable citations: [BibTeX](paper/references.bib). Verification details: [source-check notes](paper/LITERATURE_SOURCES.md).
345
+
346
+ **R1.** Alex Turner; Lisa Thiergart; David Udell; Gavin Leech; Ulisse Mini; Monte MacDiarmid. 2023. Activation Addition: Steering Language Models Without Optimization. [arXiv:2308.10248v1](https://arxiv.org/abs/2308.10248v1). Cited version dated 2023-08-20.
347
+
348
+ **R2.** Nina Panickssery; Nick Gabrieli; Julian Schulz; Meg Tong; Evan Hubinger; Alexander Matt Turner. 2024. Steering Llama 2 via Contrastive Activation Addition. [arXiv:2312.06681v4](https://arxiv.org/abs/2312.06681v4). Cited version dated 2024-07-05.
349
+
350
+ **R3.** Xiuwen Wu; Hao Wang; Zhiang Yan; Xiaohan Tang; Pengfei Xu; Wai-Ting Siok; Ping Li; Jia-Hong Gao; Bingjiang Lyu; Lang Qin. 2025. AI shares emotion with humans across languages and cultures. [arXiv:2506.13978v1](https://arxiv.org/abs/2506.13978v1). Cited version dated 2025-06-11.
351
+
352
+ **R4.** Diaoulé Diallo; Katharina Dworatzyk; Sophie Jentzsch; Peer Schütt; Sabine Theis; Tobias Hecking. 2026. The Effectiveness of Style Vectors for Steering Large Language Models: A Human Evaluation. [arXiv:2601.21505v1](https://arxiv.org/abs/2601.21505v1). Cited version dated 2026-01-29. ArXiv record lists IEEE Access 13 (2025), 191443-191457; DOI: 10.1109/ACCESS.2025.3628500.
353
+
354
+ **R5.** Moran Sun; Tianlin Li; Yuwei Zheng; Zhenhong Zhou; Aishan Liu; Xianglong Liu; Yang Liu. 2026. How Emotion Shapes the Behavior of LLMs and Agents: A Mechanistic Study. [arXiv:2604.00005v1](https://arxiv.org/abs/2604.00005v1). Cited version dated 2026-03-09.
355
+
356
+ **R6.** Jihoon Jeong. 2026. Extracting and Steering Emotion Representations in Small Language Models: A Methodological Comparison. [arXiv:2604.04064v1](https://arxiv.org/abs/2604.04064v1). Cited version dated 2026-04-05.
357
+
358
+ **R7.** Bangzhao Shu; Arinjay Singh; Mai ElSherief. 2026. Why Are Some Emotions Harder for LLMs? Uncovering the Causal Mechanisms of Emotion Inference via Sparse Autoencoders. [arXiv:2604.25866v3](https://arxiv.org/abs/2604.25866v3). Cited version dated 2026-10-24.
359
+
360
+ **R8.** Yibo Wang; Jisheng Dang; Bimei Wang; Yitao Wu; Wencan Zhang; Hong Peng; Jizhao Liu; Bin Hu; Qi Tian; Tat-Seng Chua. 2026. Read-Best Is Not Steer-Best: A Probing--Steering Layer Dissociation in Omni-Modal Large Language Models. [arXiv:2609.22135v1](https://arxiv.org/abs/2609.22135v1). Cited version dated 2026-08-24.
361
+
362
+ **R9.** JuHeon Ha; Byounghan Lee; Yunseo Choi; Kyung-Ah Sohn. 2026. Empathy Is Steerable but Multi-Axial: Mechanism Geometry and Persona Effects in LLMs. [arXiv:2609.15654v1](https://arxiv.org/abs/2609.15654v1). Cited version dated 2026-09-14. ArXiv comments report acceptance to the EMNLP 2026 main conference.
363
+
364
+ **R10.** Sasha Cui; Zhongren Chen. 2025. Painless Activation Steering: An Automated, Lightweight Approach for Post-Training Large Language Models. [arXiv:2509.22739v3](https://arxiv.org/abs/2509.22739v3). Cited version dated 2026-05-15.
365
+
366
+ **R11.** Alex Ferrando; Xavier Suau; Jordi Gonzàlez; Pau Rodriguez. 2025. Dynamically Scaled Activation Steering. [arXiv:2512.03661v2](https://arxiv.org/abs/2512.03661v2). Cited version dated 2026-07-30.
367
+
368
+ **R12.** Haotian Yang; Huikang Jiang; Yucheng Wu; Wen-Jie Jiang; Chenpeng Wang; Yibin Lou; Liangming Pan. 2026. Does Steering Break Your Model? A Multi-Dimensional Evaluation Suite for LLM Steering Methods. [arXiv:2610.07722v1](https://arxiv.org/abs/2610.07722v1). Cited version dated 2026-10-06.
369
+
370
+ ### Suggested citation
371
+
372
+ ```bibtex
373
+ @techreport{taggart2026affectorarc,
374
+ author = {Taggart, William},
375
+ title = {{AFFECTOR-ARC}: Emotional Trajectory Control through Transformer Activation Steering},
376
+ institution = {Modern and Classical Languages and Literatures, Virginia Tech},
377
+ year = {2026},
378
+ month = nov,
379
+ note = {Technical report, revision 0.2; current CUDA and emotional-effectiveness validation pending},
380
+ url = {https://huggingface.co/will-taggart/AFFECTOR-ARC/blob/main/TECHNICAL_REPORT.md}
381
+ }
382
+ ```
paper/AFFECTOR-ARC-ACM-source.zip CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:b853151dde3750c4ebb79ff61d2930ada77ac75456f79fcd03b2535b6fa05f01
3
- size 214206
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b2cac7c361695e81e4f5266c24c1ee6de32a2a052283c2993df3e0a10e7c1949
3
+ size 703668
paper/AFFECTOR-ARC-ACM.pdf CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:4d34c7993aad06ba2df9c62cae433e61a7e7cd2d4299087e19d061dbac469743
3
- size 124747
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eb797f999fc6257ac614cf00e764e7284ba6304ee084e44cabedc4f83e3cc840
3
+ size 216209
paper/AFFECTOR-ARC-ACM.tex CHANGED
@@ -13,6 +13,7 @@
13
  \providecommand{\tightlist}{\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
14
  \providecommand{\passthrough}[1]{#1}
15
  \providecommand{\pandocbounded}[1]{#1}
 
16
  \begin{document}
17
  \title{AFFECTOR-ARC: Emotional Trajectory Control through Transformer
18
  Activation Steering}
@@ -195,6 +196,15 @@ minimum requirements. Users must supply an allocation and a suitable
195
  model cache. The runner is single-process and single-GPU; it is not a
196
  concurrent inference server.
197
 
 
 
 
 
 
 
 
 
 
198
  \section{Emotional coordinates and trajectory
199
  interpolation}\label{emotional-coordinates-and-trajectory-interpolation}
200
 
@@ -247,6 +257,15 @@ basis on the current CUDA runtime even when the imported geometry
247
  includes one. With no geometry argument, it uses a demonstration path
248
  with three points; this path is not inferred from the input document.
249
 
 
 
 
 
 
 
 
 
 
250
  \section{Estimating activation
251
  directions}\label{estimating-activation-directions}
252
 
@@ -293,6 +312,15 @@ may encode vocabulary, topic, or perspective along with emotion.
293
  Normalizing the vectors does not establish that the axes are independent
294
  or valid across languages.
295
 
 
 
 
 
 
 
 
 
 
296
  \section{From coordinates to bounded
297
  displacements}\label{from-coordinates-to-bounded-displacements}
298
 
@@ -391,6 +419,15 @@ emotion and the target. A zero coefficient adds no intervention on that
391
  axis; it does not actively neutralize emotion already expressed by the
392
  model.
393
 
 
 
 
 
 
 
 
 
 
394
  \section{User controls and rewrite
395
  instructions}\label{user-controls-and-rewrite-instructions}
396
 
@@ -568,6 +605,15 @@ rerunning starts over and overwrites the selected output paths. Use a
568
  distinct output filename for each experiment. Reports contain the input
569
  text and should be treated as document-bearing artifacts.
570
 
 
 
 
 
 
 
 
 
 
571
  \section{Engineering checks and
572
  evidence}\label{engineering-checks-and-evidence}
573
 
 
13
  \providecommand{\tightlist}{\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
14
  \providecommand{\passthrough}[1]{#1}
15
  \providecommand{\pandocbounded}[1]{#1}
16
+ \usepackage{graphicx}
17
  \begin{document}
18
  \title{AFFECTOR-ARC: Emotional Trajectory Control through Transformer
19
  Activation Steering}
 
196
  model cache. The runner is single-process and single-GPU; it is not a
197
  concurrent inference server.
198
 
199
+
200
+ \begin{figure}[htbp]
201
+ \centering
202
+ \includegraphics[width=\textwidth]{figures/illustration-01.pdf}
203
+ \caption{Execution schematic. The compute workload belongs to the allocated GPU node. Resource requests describe scheduling needs and do not establish measured minimum requirements.}
204
+ \Description{Schedule the computation on a GPU node. Execution schematic. The compute workload belongs to the allocated GPU node. Resource requests describe scheduling needs and do not establish measured minimum requirements.}
205
+ \label{fig:illustration-1}
206
+ \end{figure}
207
+
208
  \section{Emotional coordinates and trajectory
209
  interpolation}\label{emotional-coordinates-and-trajectory-interpolation}
210
 
 
257
  includes one. With no geometry argument, it uses a demonstration path
258
  with three points; this path is not inferred from the input document.
259
 
260
+
261
+ \begin{figure}[htbp]
262
+ \centering
263
+ \includegraphics[width=\textwidth]{figures/illustration-02.pdf}
264
+ \caption{Trajectory alignment. The runner stretches or compresses the source path over normalized target positions and may miss unsampled emotional changes.}
265
+ \Description{Align geometry to original document positions. Trajectory alignment. The runner stretches or compresses the source path over normalized target positions and may miss unsampled emotional changes.}
266
+ \label{fig:illustration-2}
267
+ \end{figure}
268
+
269
  \section{Estimating activation
270
  directions}\label{estimating-activation-directions}
271
 
 
312
  Normalizing the vectors does not establish that the axes are independent
313
  or valid across languages.
314
 
315
+
316
+ \begin{figure}[htbp]
317
+ \centering
318
+ \includegraphics[width=\textwidth]{figures/illustration-03.pdf}
319
+ \caption{Calibration schematic. The runner recalibrates the imported trajectory on the current runtime. The contrast basis is an experimental numerical control, not a validated multilingual emotion scale.}
320
+ \Description{Recalibrate on the current CUDA runtime. Calibration schematic. The runner recalibrates the imported trajectory on the current runtime. The contrast basis is an experimental numerical control, not a validated multilingual emotion scale.}
321
+ \label{fig:illustration-3}
322
+ \end{figure}
323
+
324
  \section{From coordinates to bounded
325
  displacements}\label{from-coordinates-to-bounded-displacements}
326
 
 
419
  axis; it does not actively neutralize emotion already expressed by the
420
  model.
421
 
422
+
423
+ \begin{figure}[htbp]
424
+ \centering
425
+ \includegraphics[width=\textwidth]{figures/illustration-04.pdf}
426
+ \caption{Two distinct control paths. Axis selection modifies activation coefficients before generation scores; token sampling operates afterward on the vocabulary distribution.}
427
+ \Description{Separate activation controls from token sampling. Two distinct control paths. Axis selection modifies activation coefficients before generation scores; token sampling operates afterward on the vocabulary distribution.}
428
+ \label{fig:illustration-4}
429
+ \end{figure}
430
+
431
  \section{User controls and rewrite
432
  instructions}\label{user-controls-and-rewrite-instructions}
433
 
 
605
  distinct output filename for each experiment. Reports contain the input
606
  text and should be treated as document-bearing artifacts.
607
 
608
+
609
+ \begin{figure}[htbp]
610
+ \centering
611
+ \includegraphics[width=\textwidth]{figures/illustration-05.pdf}
612
+ \caption{Output lifecycle schematic. Bounded generation, complete-prefix selection, diagnostics and per-chunk continuation address specific failure modes; they do not guarantee emotional fit or preservation of all content.}
613
+ \Description{A failed chunk does not end the document. Output lifecycle schematic. Bounded generation, complete-prefix selection, diagnostics and per-chunk continuation address specific failure modes; they do not guarantee emotional fit or preservation of all content.}
614
+ \label{fig:illustration-5}
615
+ \end{figure}
616
+
617
  \section{Engineering checks and
618
  evidence}\label{engineering-checks-and-evidence}
619
 
paper/ILLUSTRATIONS.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "number": 1,
4
+ "title": "Schedule the computation on a GPU node",
5
+ "caption": "Execution schematic. The compute workload belongs to the allocated GPU node. Resource requests describe scheduling needs and do not establish measured minimum requirements.",
6
+ "section_preceded": "Emotional coordinates and trajectory interpolation",
7
+ "provenance": "Explanatory schematic derived from the report; not a screenshot or new experiment."
8
+ },
9
+ {
10
+ "number": 2,
11
+ "title": "Align geometry to original document positions",
12
+ "caption": "Trajectory alignment. The runner stretches or compresses the source path over normalized target positions and may miss unsampled emotional changes.",
13
+ "section_preceded": "Estimating activation directions",
14
+ "provenance": "Explanatory schematic derived from the report; not a screenshot or new experiment."
15
+ },
16
+ {
17
+ "number": 3,
18
+ "title": "Recalibrate on the current CUDA runtime",
19
+ "caption": "Calibration schematic. The runner recalibrates the imported trajectory on the current runtime. The contrast basis is an experimental numerical control, not a validated multilingual emotion scale.",
20
+ "section_preceded": "From coordinates to bounded displacements",
21
+ "provenance": "Explanatory schematic derived from the report; not a screenshot or new experiment."
22
+ },
23
+ {
24
+ "number": 4,
25
+ "title": "Separate activation controls from token sampling",
26
+ "caption": "Two distinct control paths. Axis selection modifies activation coefficients before generation scores; token sampling operates afterward on the vocabulary distribution.",
27
+ "section_preceded": "User controls and rewrite instructions",
28
+ "provenance": "Explanatory schematic derived from the report; not a screenshot or new experiment."
29
+ },
30
+ {
31
+ "number": 5,
32
+ "title": "A failed chunk does not end the document",
33
+ "caption": "Output lifecycle schematic. Bounded generation, complete-prefix selection, diagnostics and per-chunk continuation address specific failure modes; they do not guarantee emotional fit or preservation of all content.",
34
+ "section_preceded": "Engineering checks and evidence",
35
+ "provenance": "Explanatory schematic derived from the report; not a screenshot or new experiment."
36
+ }
37
+ ]
paper/PAPER-SHA256SUMS.txt ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ b2cac7c361695e81e4f5266c24c1ee6de32a2a052283c2993df3e0a10e7c1949 AFFECTOR-ARC-ACM-source.zip
2
+ d78577482f74cba4163db18d88af82786c923d72cd09607bde62cb747c645c5d AFFECTOR-ARC-ACM.bbl
3
+ eb797f999fc6257ac614cf00e764e7284ba6304ee084e44cabedc4f83e3cc840 AFFECTOR-ARC-ACM.pdf
4
+ afeb054ba6306edf4bdc849b396e89145b762e192a44f31e5f62982245579cad AFFECTOR-ARC-ACM.tex
5
+ de5d2d1d955e0da3d6f033ecbde89d6b009575517e893942d07ed22f967e7705 ILLUSTRATIONS.json
6
+ d14edda139a36c0bac8b56d02e5cda63ab7558c6db1424f1087189a9429bfaf0 LITERATURE_SOURCES.md
7
+ 8b503db789e6f4f8e297ca7f08ce5a4ebfd40fa76e65ffedacf411f027df0ecb README.md
8
+ cc2a27b78b373d4fd10243ae282def19ba48045af7ca7be037adb8f464df09d9 TECHNICAL_PAPER.md
9
+ b1af14ec24b576fa1675395d73e75adfa4f5174d52902866ffef71374ddbc852 figure-specifications.json
10
+ b072894d9761bb46543f0c584cf781aaedce49100a489a2bc1e2b48b9ad47e10 figures/illustration-01.pdf
11
+ 68020194c3306e7fecf75e94343ea2a3cb0af6d186c2d8d93220cbc6dec12e6f figures/illustration-01.png
12
+ e26101a755627565004dfe797f7777158b9f8f33154bb88675a5542f782390d2 figures/illustration-02.pdf
13
+ 4c625dcd3c54b524c48cad640739b1d7c973fce933d530f0f4e4d0e7cb56670b figures/illustration-02.png
14
+ 2117943308aa158b11f4bdca85c8a74926a463f8c157eaf5d3aa322de005f968 figures/illustration-03.pdf
15
+ 288b342831d36d22626fd1a1e818ce3f7c669614d39bca237dcb4d5b745ac452 figures/illustration-03.png
16
+ bb8302843abc13419014ea6a06d63edfe6de9e02df248ee4c1ae8e3b0e6fc0a8 figures/illustration-04.pdf
17
+ 5de084984e9ef633183868ccf98428e1e0b47af70069c29a32102b0485895af2 figures/illustration-04.png
18
+ 5e342f6be6c48eb60c8b3a423bbf1eec30d975d11db42e36ec76624aad964e83 figures/illustration-05.pdf
19
+ 5f4e1daaf625926a768773cfcb80287cb6c25ad793c4510fbecc6aaa57f4b04a figures/illustration-05.png
20
+ 9257f38423bd7e496f1a0916c0fbaefbfb32ab544a684ca9a411508201f0535e references.bib
21
+ eed8b979a5a299b42e925d9027332e7df876400dcef046f2cfe26beef91d1189 render_figures.py
22
+ cc2a27b78b373d4fd10243ae282def19ba48045af7ca7be037adb8f464df09d9 source.md
paper/README.md CHANGED
@@ -1,21 +1,9 @@
1
- # AFFECTOR-ARC: Emotional Trajectory Control through Transformer Activation Steering
2
 
3
- Uses the official ACM acmart class with manuscript, screen, and nonacm options. This is an independently distributed report, not an assertion of ACM publication or acceptance. No venue, DOI, or copyright transfer is invented.
4
 
5
- ## Build
6
 
7
- With a current TeX Live/MacTeX installation including acmart:
8
 
9
- latexmk -pdf AFFECTOR-ARC-ACM.tex
10
-
11
- Or Tectonic 0.17.0:
12
-
13
- tectonic --keep-logs --keep-intermediates AFFECTOR-ARC-ACM.tex
14
-
15
- The bibliography uses ACM-Reference-Format.bst. The generated .bbl is included; references.bib remains editable. All packages are standard TeX distribution packages. No shell escape is needed. The manuscript layout is single-column; change manuscript to sigconf for a venue requiring two columns, then recheck layout.
16
-
17
- Includes the source Markdown snapshot and citation verification notes. Equations, tables, and citations are native LaTeX. AI disclosure appears immediately before the references.
18
-
19
- Original report: https://huggingface.co/will-taggart/AFFECTOR-ARC/blob/main/TECHNICAL_REPORT.md
20
-
21
- Build verified with Tectonic 0.17.0 and bundled acmart v1.83 (2022/02/19). All 12 bibliography entries resolve.
 
1
+ # AFFECTOR-ARC illustrated technical report
2
 
3
+ [PDF](AFFECTOR-ARC-ACM.pdf) · [ACM LaTeX](AFFECTOR-ARC-ACM.tex) · [Markdown](TECHNICAL_PAPER.md) · [Illustrations](figures/)
4
 
5
+ Five tightly cropped, reproducible technical diagrams explain the mechanisms described in the report. These are explanatory schematics, not application screenshots or new experimental results. The existing literature and scientific qualifications are retained. AI disclosure precedes references.
6
 
7
+ Build with `tectonic AFFECTOR-ARC-ACM.tex` (rename the resulting PDF to `AFFECTOR-ARC-ACM.pdf` where needed). The source archive includes all figure PDFs and PNGs.
8
 
9
+ Regenerate the diagrams with `python3 render_figures.py` (requires Matplotlib). Diagram titles and captions are recorded in `ILLUSTRATIONS.json`; vector PDF and raster PNG versions are provided.
 
 
 
 
 
 
 
 
 
 
 
 
paper/TECHNICAL_PAPER.md ADDED
@@ -0,0 +1,382 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # AFFECTOR-ARC: Emotional Trajectory Control through Transformer Activation Steering
2
+
3
+ **William Taggart**
4
+ Modern and Classical Languages and Literatures, Virginia Tech
5
+ Email: wtaggart@vt.edu
6
+ **Technical report · November 13, 2026 · Revision 0.2**
7
+
8
+ ## Abstract
9
+
10
+ AFFECTOR-ARC is an experimental command-line system for rewriting text under a user-defined emotional trajectory. It runs a frozen Qwen3.5-0.8B model on an NVIDIA GPU and changes selected internal activations during generation. A trajectory specifies valence, inward/outward emotional orientation, and intensity across normalized document position. Small sets of contrasting English passages establish three activation directions at each selected transformer layer. At inference time, the requested coordinates determine a weighted displacement, scaled relative to the current hidden-state magnitude, smoothed across decoding steps, and constrained by an RMS budget. Paired hooks apply this displacement to both the feed-forward input and its residual path. Document rewriting combines these interventions with four editing styles, sentence-aware segmentation, bounded generation, and incremental reporting. This report derives the mechanism from its implemented operations and distinguishes numerical controls from emotional outcomes. CPU policy tests pass; the current revision still requires CUDA validation. No measured claim of emotional accuracy, semantic preservation, or multilingual effectiveness is made.
11
+
12
+ ## Literature review: activation steering and emotion
13
+
14
+ This focused review covers twelve papers, emphasizing 2025-2026 research and retaining two methodological foundations. Titles, author lists, version histories, and the claims summarized here were checked against arXiv records and the corresponding paper text on November 13, 2026. The cited versions are fixed below; availability on arXiv alone does not establish peer review. The implications for this project are research motivations, not evidence that its implementation reproduces these results.
15
+
16
+ **From activation differences to behavioral control.** Activation steering changes internal model states during inference while leaving the backbone weights fixed. Turner et al. derive intervention vectors from contrasting prompts; Panickssery et al. average differences across positive and negative behavioral examples. These provide the methodological basis for contrastive calibration, but do not validate a particular emotional coordinate system or insertion site. [Turner et al., 2023 (R1)](https://arxiv.org/abs/2308.10248v1); [Panickssery et al., 2024 (R2)](https://arxiv.org/abs/2312.06681v4).
17
+
18
+ **Emotional expression and human judgment.** Wu et al. relate model emotion spaces to human valence/arousal judgments and report concept-based steering across linguistic-cultural settings. Diallo et al. evaluate perceived emotional intensity and text quality with human raters, finding that effects depend on emotion and steering strength. Together they motivate separate measures of emotional movement and readability. Their axes and numerical strengths cannot be assumed equivalent to this project's inward/outward direction or RMS-scaled controls. [Wu et al., 2025 (R3)](https://arxiv.org/abs/2506.13978v1); [Diallo et al., 2026 arXiv version (R4)](https://arxiv.org/abs/2601.21505v1).
19
+
20
+ **Emotion can affect more than tone.** Sun et al.'s E-STEER uses valence-arousal-dominance interventions to study reasoning, generation, safety, and agent behavior, reporting non-monotonic relationships. Jeong's small-model comparison reports both coherent emotional changes and degeneration, including repetition, depending on extraction method and architecture. These findings motivate reporting failed generations alongside successes and testing strength sweeps rather than assuming that larger perturbations improve emotional fit. Neither study establishes an operating range for this implementation. [Sun et al., 2026 (R5)](https://arxiv.org/abs/2604.00005v1); [Jeong, 2026 (R6)](https://arxiv.org/abs/2604.04064v1).
21
+
22
+ **Reading an emotion is different from controlling it.** Shu et al.'s revised study identifies uneven causal organization of sparse features across emotion categories and tests interventions for emotion recognition. Wang et al. show, in omni-modal models, that layers with strong emotion-probing accuracy need not be the best intervention layers. Recognition results therefore inform evaluator design, while layer selection for rewriting still requires causal tests on generated text. Neither finding licenses importing layer indices across architectures. [Shu et al., 2026, v3 (R7)](https://arxiv.org/abs/2604.25866v3); [Wang et al., 2026 (R8)](https://arxiv.org/abs/2609.22135v1).
23
+
24
+ **Multiple axes and adaptive control.** Ha et al. find that supportive-empathy directions are only partially separable: intervening on one can shift other EPITOME proxy scores. Cui and Chen automate vector extraction from labeled data, with task-dependent benefits. Ferrando et al. adapt intervention strength to context, studying the balance between toxicity mitigation and retained utility. These approaches motivate broader calibration, cross-axis tests, and future adaptive control. The present coordinate mixture is not an implementation of their learned selectors or context-dependent gates. [Ha et al., 2026 (R9)](https://arxiv.org/abs/2609.15654v1); [Cui and Chen, 2025, revised 2026 (R10)](https://arxiv.org/abs/2509.22739v3); [Ferrando et al., 2025, revised 2026 (R11)](https://arxiv.org/abs/2512.03661v2).
25
+
26
+ **Evaluation must include costs as well as target effects.** Yang et al.'s SteerScope evaluates steering efficacy jointly with side effects, generalization, and data dependence. In its tested settings, activation methods do not dominate prompt steering on the efficacy/side-effect trade-off. For this project, the resulting evaluation priorities are prompt-only and unsteered baselines, blinded emotional and quality ratings, content-change assessment appropriate to the rewrite style, and complete accounting of repetition, truncation, and original-text fallbacks. This is an evaluation agenda, not a completed benchmark. [Yang et al., 2026 (R12)](https://arxiv.org/abs/2610.07722v1).
27
+
28
+ ## 1. Problem and operating principle
29
+
30
+ A language model generates text by repeatedly estimating a distribution over the next token. Its intermediate hidden states are numerical vectors that contribute to those estimates. Changing a hidden state can change the continuation even when the input text and the model's stored parameters remain fixed.
31
+
32
+ AFFECTOR-ARC uses this property to influence the emotional expression of a rewrite. The user supplies an input document and a sequence of emotional coordinates. The software maps positions in the input to positions on that sequence, converts the coordinates into activation displacements, and applies the displacements while generating each rewritten passage.
33
+
34
+ The term **geometry** means an ordered path through a three-dimensional coordinate space, together with layer settings and optional calibration matrices. It does not mean that the software reconstructs a solid surface or applies geometric constraints directly to words. A text's emotional interpretation, a numerical target, and a model's hidden states are distinct objects. The calibration is an experimental mapping between them.
35
+
36
+ Two execution modes are available:
37
+
38
+ - **Rewrite:** process an entire UTF-8 text document in chunks, write the transformed text, and record attempts and failures.
39
+ - **Smoke:** run five controlled generation conditions to check basic intervention and cleanup behavior.
40
+
41
+ The interface is a command-line runner for a CUDA allocation. It does not provide a desktop interface, a hosted API service, automatic emotional scoring, or conversational history.
42
+
43
+ ## 2. Runtime and data flow
44
+
45
+ The runner loads `Qwen/Qwen3.5-0.8B` at revision `2fc06364715b967f1860aea9cf38778875588b17`. The implementation uses `Qwen3_5ForConditionalGeneration`, its text decoder layers, float32 computation, eager attention, and the first process-visible CUDA device. It checks for 24 decoder layers; the geometry and calibration code assume hidden width 1,024. The backbone is in evaluation mode, its parameters have gradients disabled, and calibration and generation run without gradient tracking.
46
+
47
+ The execution sequence is:
48
+
49
+ ```text
50
+ Read text and geometry settings
51
+ → validate controls
52
+ → load the pinned model on CUDA
53
+ → calibrate the selected layers
54
+ → select rewrite or smoke mode
55
+ → generate with temporary activation hooks
56
+ → remove hooks and save results
57
+ ```
58
+
59
+ Source files are distributed with the repository. `ENGINE_MANIFEST.json` records hashes for the bundled engine snapshot. Model weights are downloaded separately. The setup script creates a Python 3.12 environment, installs PyTorch from the CUDA 12.6 wheel index, pins Transformers to 5.22.2, runs the CPU policy tests, and records installed packages in `environment-resolved.txt`. PyTorch and several support packages are resolved during setup rather than fully locked in advance.
60
+
61
+ The example Slurm script requests one GPU, eight CPU cores, 64 GB of host memory, and one hour. These are scheduling requests, not measured minimum requirements. Users must supply an allocation and a suitable model cache. The runner is single-process and single-GPU; it is not a concurrent inference server.
62
+
63
+
64
+ ![Schedule the computation on a GPU node](figures/illustration-01.png)
65
+
66
+ *Illustration 1. Execution schematic. The compute workload belongs to the allocated GPU node. Resource requests describe scheduling needs and do not establish measured minimum requirements.*
67
+
68
+ ## 3. Emotional coordinates and trajectory interpolation
69
+
70
+ A trajectory point is
71
+
72
+ $$
73
+ p_j=(t_j,v_j,d_j,i_j),
74
+ $$
75
+
76
+ where positions $t_j$ increase strictly within $[0,1]$. Valence $v_j$ ranges from negative to positive in $[-1,1]$. Direction $d_j$ ranges from inward-oriented to outward-oriented emotion in $[-1,1]$. Intensity $i_j$ ranges from low to high in $[0,1]$. Direction is an operational contrast concerning emotional orientation; it is not dominance, speaker identification, or positive versus negative sentiment.
77
+
78
+ Between adjacent points, the software linearly interpolates each emotional coordinate. Before the first point and after the last, it uses the endpoint values. The coefficient vector passed to the activation module is
79
+
80
+ $$
81
+ c(t)=\bigl(v(t),d(t),2i(t)-1\bigr).
82
+ $$
83
+
84
+ Consequently, intensity 0.5 contributes a zero intensity coefficient; intensity zero contributes a negative coefficient. These are control conventions, not empirically established psychological units.
85
+
86
+ For a chunk occupying character offsets $[a,b)$ in an input of length $N$, its target is evaluated at
87
+
88
+ $$
89
+ t=\frac{a+b}{2N}.
90
+ $$
91
+
92
+ That target remains constant throughout generation of the chunk. A long trajectory can therefore guide a short document without pairing source and target paragraphs one to one. Only the positions sampled by the target chunks are used; narrow changes between those positions may be missed. The mapping uses original input positions, not positions in the expanding or contracting output. Adjacent chunks receive separate generation calls without prior rewritten chunks as conversational context.
93
+
94
+ The runner accepts a native geometry JSON file and supported analysis JSON structures containing emotional coordinates. It recalibrates the basis on the current CUDA runtime even when the imported geometry includes one. With no geometry argument, it uses a demonstration path with three points; this path is not inferred from the input document.
95
+
96
+
97
+ ![Align geometry to original document positions](figures/illustration-02.png)
98
+
99
+ *Illustration 2. Trajectory alignment. The runner stretches or compresses the source path over normalized target positions and may miss unsampled emotional changes.*
100
+
101
+ ## 4. Estimating activation directions
102
+
103
+ A hidden state at a selected layer is a vector in $\mathbb{R}^{1024}$. To estimate a direction associated with one emotional contrast, the system compares the model's states for paired passages that differ in the desired property.
104
+
105
+ There are four hand-authored English pairs for each of three axes. For layer $\ell$, axis $j$, and pair $k$, let $h^+_{\ell,j,k}$ and $h^-_{\ell,j,k}$ denote the captured states for the two members. The mean difference is
106
+
107
+ $$
108
+ u_{\ell,j}=\frac14\sum_{k=1}^{4}
109
+ \left(h^+_{\ell,j,k}-h^-_{\ell,j,k}\right).
110
+ $$
111
+
112
+ For a vector of dimension $D$, define root-mean-square magnitude as
113
+
114
+ $$
115
+ \operatorname{RMS}(x)=\sqrt{\frac1D\sum_{r=1}^{D}x_r^2}.
116
+ $$
117
+
118
+ The normalized direction is
119
+
120
+ $$
121
+ b_{\ell,j}=\frac{u_{\ell,j}}
122
+ {\max(\operatorname{RMS}(u_{\ell,j}),10^{-8})}.
123
+ $$
124
+
125
+ The three directions form the rows of a matrix $B_\ell\in\mathbb{R}^{3\times1024}$. Calibration captures the final chat-formatted prompt position immediately before `post_attention_layernorm`. It does not average all token positions. All selected layers are captured during the same 24 forward passes: three axes, four pairs, and two members per pair.
126
+
127
+ Default layers are 8, 16, and 23, using zero-based indexing, with weights 1, 1, and 0.5. This is subtraction, averaging, and normalization; there is no training optimizer, backbone fine-tuning, orthogonalization, or outcome-based fitting. The small calibration set may encode vocabulary, topic, or perspective along with emotion. Normalizing the vectors does not establish that the axes are independent or valid across languages.
128
+
129
+
130
+ ![Recalibrate on the current CUDA runtime](figures/illustration-03.png)
131
+
132
+ *Illustration 3. Calibration schematic. The runner recalibrates the imported trajectory on the current runtime. The contrast basis is an experimental numerical control, not a validated multilingual emotion scale.*
133
+
134
+ ## 5. From coordinates to bounded displacements
135
+
136
+ ### 5.1 Selecting and weighting axes
137
+
138
+ Let $T$ be axis temperature. Each coordinate first receives magnitude
139
+
140
+ $$
141
+ q_j=|c_j|^{1/T}.
142
+ $$
143
+
144
+ Axes are sorted by this magnitude. The algorithm retains at most `axis_top_k` axes and stops adding axes after their accumulated magnitude reaches `axis_mass` times the total magnitude. Selection includes the axis that crosses the threshold. The retained coefficients are
145
+
146
+ $$
147
+ a_j=\operatorname{sign}(c_j)q_jm_j,
148
+ $$
149
+
150
+ where $m_j$ is one for a retained axis and zero otherwise. Coefficients are not renormalized after selection. For coordinate magnitudes below one, $T<1$ reduces their magnitudes and emphasizes relative differences; $T>1$ increases them and makes those differences less pronounced. These operations affect three activation coefficients, not token probabilities.
151
+
152
+ ### 5.2 Strength, inertia, and budget
153
+
154
+ For the current final-token state $h_{\ell,n}$, strength $s$, and layer weight $w_\ell$, the raw displacement is
155
+
156
+ $$
157
+ r_{\ell,n}=s\,w_\ell\operatorname{RMS}(h_{\ell,n})(aB_\ell).
158
+ $$
159
+
160
+ Multiplication by the current state's RMS expresses the intervention relative to the layer's numerical scale. A negative layer weight reverses the mixed direction at that layer.
161
+
162
+ On the first decoding step, the smoothed displacement equals $r_{\ell,n}$. On later steps, inertia $\rho$ combines the previous applied displacement with the new raw displacement:
163
+
164
+ $$
165
+ \widetilde\delta_{\ell,n}=\rho\delta_{\ell,n-1}+(1-\rho)r_{\ell,n}.
166
+ $$
167
+
168
+ Budget $\beta$ then limits the RMS ratio:
169
+
170
+ $$
171
+ \delta_{\ell,n}=\widetilde\delta_{\ell,n}
172
+ \min\left(1,
173
+ \frac{\beta\operatorname{RMS}(h_{\ell,n})}
174
+ {\max(\operatorname{RMS}(\widetilde\delta_{\ell,n}),10^{-12})}
175
+ \right).
176
+ $$
177
+
178
+ Strength determines the proposed displacement; budget supplies its ceiling. Raising the budget has no effect when the proposed displacement already fits below it. Budget 1 permits a displacement as large in RMS as the hidden state itself. It is not a token allowance, a semantic-change quota, or a guarantee of stronger emotional accuracy. Inertia uses the previous already-capped displacement and resets with each new generation call.
179
+
180
+ ### 5.3 Intervention site
181
+
182
+ Let $h$ denote the state entering the feed-forward portion of a decoder block. Without intervention, that portion computes
183
+
184
+ $$
185
+ y=h+\operatorname{FFN}(\operatorname{Norm}(h)).
186
+ $$
187
+
188
+ The implemented intervention produces
189
+
190
+ $$
191
+ y=(h+\delta)+\operatorname{FFN}(\operatorname{Norm}(h+\delta)).
192
+ $$
193
+
194
+ A pre-hook adds $\delta$ to the normalization input; a block-output hook adds the same displacement to the residual result. Adding a vector only after an unchanged feed-forward computation would have a different effect. Only the final prompt position is modified during prefill; cached decoding modifies the current generated position. The module does not wait for specific words or phrases. Generation hooks are removed in a `finally` block.
195
+
196
+ This is an open-loop intervention. Coefficients come from the requested absolute coordinates, not the difference between a measured output emotion and the target. A zero coefficient adds no intervention on that axis; it does not actively neutralize emotion already expressed by the model.
197
+
198
+
199
+ ![Separate activation controls from token sampling](figures/illustration-04.png)
200
+
201
+ *Illustration 4. Two distinct control paths. Axis selection modifies activation coefficients before generation scores; token sampling operates afterward on the vocabulary distribution.*
202
+
203
+ ## 6. User controls and rewrite instructions
204
+
205
+ | Control | Default without an imported override | Function |
206
+ |---|---:|---|
207
+ | Strength | 0.12 | Scale the proposed activation displacement |
208
+ | Budget | 0.20 | Cap displacement RMS relative to hidden-state RMS |
209
+ | Inertia | 0.20 | Weight the preceding applied displacement |
210
+ | Axis top-k | 3 | Maximum number of retained emotional axes |
211
+ | Axis mass | 1.0 | Cumulative magnitude threshold for axis selection |
212
+ | Axis temperature | 1.0 | Exponent control for emotional-axis magnitudes |
213
+ | Temperature | 0 | Select greedy decoding or token sampling |
214
+ | Top-p | 0.95 | Probability-mass cutoff when sampling |
215
+ | Top-k | 40 | Token candidate count when sampling |
216
+ | Base output tokens | 512 | Initial generation allowance, expanded in rewrite mode |
217
+ | Time limit | 120 seconds | Per-generation stopping threshold |
218
+
219
+ The CLI overrides only the activation settings explicitly supplied; other settings come from the imported geometry or defaults. Validation permits strength 0–2, budget 0–1, inertia 0–0.99, axis top-k 1–3, axis mass 0.01–1, and axis temperature 0.1–3. These accepted ranges are not validated operating recommendations. The terminal displays the warning: **Extreme values for strength, budget, and inertia may cause generation failures.**
220
+
221
+ At temperature zero, decoding is greedy and top-p/top-k are inactive. At positive temperature, they affect token selection after the model computes its scores. They do not replace or modify the three-axis activation selection mechanism.
222
+
223
+ Four system-prompt styles provide separate editing constraints:
224
+
225
+ - **Minimal:** change a few words or phrases while preserving nearly all wording and sentence order.
226
+ - **Restrained:** adjust tone through wording, rhythm, and emphasis while preserving central meaning, facts, terminology, and structure; invent no scenes or metaphors.
227
+ - **Balanced:** allow a clearer emotional shift and modest figurative language while retaining central meaning, facts, people, and events.
228
+ - **Creative:** permit changes to meaning, imagery, and events, while requesting concise output in the same language.
229
+
230
+ Restrained is the default in rewrite mode. Smoke mode retains its original general rewriting instruction unless a style is explicitly selected. Each prompt requests complete sentences and treats supplied text as material rather than instructions. A per-chunk suffix specifies the original character count and hard character allowance. Numerical emotional coordinates are not inserted into these prompts; the coordinates act through hidden states. Prompt instructions influence generation but are not formal semantic guarantees. The runner has no semantic-equivalence rejection filter and does not lower steering settings automatically.
231
+
232
+ ## 7. Segmentation, length control, and repetition
233
+
234
+ The runner reads and trims the outer whitespace of a UTF-8 text file. Blank lines define paragraphs. Long paragraphs are split using a 700-character ceiling, preferring sentence punctuation when a suitable boundary exists, then whitespace, and finally a hard split. This is a punctuation heuristic, not a linguistic sentence parser. Original whitespace between chunks is preserved during output assembly.
235
+
236
+ Within each original paragraph, the character ceiling is 125% of the original span processed so far. If $s$ is the first chunk's start, $b_j$ the current chunk's end, and $U_j$ the output characters and intervening whitespace already used, the current allowance is
237
+
238
+ $$
239
+ L_j=\max\left(0,\left\lfloor1.25(b_j-s)\right\rfloor-U_j\right).
240
+ $$
241
+
242
+ Unused allowance carries forward within that paragraph. It cannot be borrowed from future chunks or transferred across a blank-line paragraph boundary. Character counts are Python string lengths, not word counts, encoded byte counts, or model-token counts.
243
+
244
+ Generation aims for the original length. Starting at 85% of the current input chunk's characters, a recognized sentence ending can stop generation. A separate hard character threshold prevents excessive expansion. The token allowance is
245
+
246
+ $$
247
+ K_j=\min\left(2048,\max(K_{\mathrm{base}},L_j)\right),
248
+ $$
249
+
250
+ which supplies decoding headroom but does not imply one token equals one character. The time threshold is checked between decoding steps and cannot interrupt a blocked GPU kernel immediately.
251
+
252
+ Decoding also uses a repetition penalty of 1.1 and an eight-token no-repeat n-gram constraint. A text-level detector checks every eight generation steps for repeated three- to six-word sequences appearing at least four times in the last 100 words, or a short compact character pattern repeated at least six times in the last 240 characters. These heuristics can miss some loops and can flag intentional repetition.
253
+
254
+ After a generation attempt, the runner checks for repetition, empty output, excessive length, and an unfinished ending. A problematic draft is reduced to a complete, nonrepetitive sentence prefix within its allowance. If none exists, the original chunk is retained and flagged. The returned draft remains in the report's attempt record before sentence salvage. However, the engine has already clipped it to the hard character allowance; the report is not a lossless record of characters beyond that boundary.
255
+
256
+ Sentence cleanup prevents chopped words from being joined directly to the next passage, but it may omit ideas from the tail of a draft. Neither punctuation recognition nor output-size compliance establishes completeness of meaning.
257
+
258
+ ## 8. Failure handling and output artifacts
259
+
260
+ Each chunk receives one generation attempt at the requested activation settings. A caught generation exception is recorded; the original chunk remains in the assembled text and processing continues. Calibration failures, invalid inputs, filesystem failures, and process termination are outside this per-chunk recovery mechanism and can stop a run. A persistent device failure may cause subsequent chunks to fail as well.
261
+
262
+ After each processed chunk, the runner writes:
263
+
264
+ 1. An atomic JSON report containing the input, geometry, calibration basis, runtime identity, style, sampling settings, character spans, target coordinates, and per-chunk records.
265
+ 2. A matching plain-text file containing completed rewrites plus original text at unprocessed or retained positions.
266
+
267
+ Successful generation records include stopping reason, token count, elapsed time, activation-injection count, and mean displacement RMS. Attempt records retain returned drafts, effective controls, detected issues, and exceptions where applicable. At normal completion the report adds failure and review counts. `complete` means every chunk was processed, not that every chunk was successfully rewritten or emotionally accurate.
268
+
269
+ JSON writes use temporary-file replacement. The companion text file is written normally and may be incomplete if interrupted during that write. Reports are incremental records, not automatic resume checkpoints: rerunning starts over and overwrites the selected output paths. Use a distinct output filename for each experiment. Reports contain the input text and should be treated as document-bearing artifacts.
270
+
271
+
272
+ ![A failed chunk does not end the document](figures/illustration-05.png)
273
+
274
+ *Illustration 5. Output lifecycle schematic. Bounded generation, complete-prefix selection, diagnostics and per-chunk continuation address specific failure modes; they do not guarantee emotional fit or preservation of all content.*
275
+
276
+ ## 9. Engineering checks and evidence
277
+
278
+ Smoke mode is the default and operates on one supplied passage. It runs baseline, zero-strength, positive-valence, negative-valence, and restored-baseline conditions. Positive and negative conditions use coefficient vectors $(0.8,0,0)$ and $(-0.8,0,0)$. The third coordinate zero corresponds to intensity 0.5.
279
+
280
+ With greedy decoding, the checks require zero-strength and baseline decoded text/token counts to match, nonzero injections in the positive and negative cases, restored hook counts, restored baseline text/token counts, and disabled backbone gradients. Positive and negative outputs need not differ for these checks to pass. Settings that suppress all effective intervention are unsuitable for the nonzero-injection checks.
281
+
282
+ Smoke mode defaults to the original 128-token allowance and 600-second time threshold. Its original instruction permits changes in phrasing, imagery, and emotional expression while preserving the passage’s main subject and recognizable situation. It omits the new repetition penalty, n-gram guard, and document-length salvage so that existing commands retain their original generation configuration and compare raw generations. It saves completed conditions incrementally and marks `checks_complete` only after assertions pass. It does not compare logits, full token sequences, parameter hashes, or independently measured per-step RMS bounds. Run with ordinary Python rather than assertion-disabling optimization flags.
283
+
284
+ For the November 13 revision, seven CPU policy tests passed, Python and shell syntax were checked, and CLI loading was verified. Tests cover such behavior as unchanged requested controls, paragraph allowance accounting, draft retention, sentence cleanup, and continuing after a failed chunk. They do not execute the CUDA model. The current revision has not yet been run on an ARC GPU. A successful GPU run was reported for an earlier revision on November 12; it is historical evidence, not validation of the current code.
285
+
286
+ ## 10. Reproduction
287
+
288
+ Inside a suitable ARC GPU allocation, from a fresh repository copy:
289
+
290
+ ```bash
291
+ bash setup.sh
292
+ source "$(conda info --base)/etc/profile.d/conda.sh"
293
+ conda activate "$PWD/.conda"
294
+ python run_arc.py --mode smoke --text-file passage.txt \
295
+ --output runs/smoke.json
296
+ ```
297
+
298
+ Setup expects a fresh `.conda` destination. A populated model cache or permitted download route is required. Existing compatible environments can execute the updated source directly.
299
+
300
+ To rewrite a document:
301
+
302
+ ```bash
303
+ python run_arc.py --mode rewrite --text-file target.txt \
304
+ --geometry shape.json --style Restrained \
305
+ --strength 0.47 --budget 0.47 --inertia 0.2 \
306
+ --temperature 0 --top-p 0.95 --top-k 40 \
307
+ --output runs/rewrite.json
308
+ ```
309
+
310
+ These strength and budget values illustrate explicit configuration; they are not an experimentally established optimum. Omitting `--geometry` selects the demonstration trajectory. Batch smoke execution uses `sbatch --account=YOUR_ALLOCATION smoke.sbatch`; the allocation and partition must suit the user's cluster access.
311
+
312
+ Archive the repository revision, engine manifest, resolved dependencies, GPU and driver information, command-line arguments, input, geometry, and report. The engine identity's `source_commit` field currently contains a snapshot label rather than a Git commit hash, so the repository revision should be recorded separately. The default seed is zero and TF32 matrix multiplication is disabled, but identical results across hardware and library versions are not guaranteed.
313
+
314
+ ## 11. Scientific limits and evaluation requirements
315
+
316
+ The system offers a direct, inspectable intervention, not a demonstrated emotional matching algorithm. Its main limitations are the small English calibration set, untested interactions between axes and layers, open-loop use of absolute targets, and lack of independent output assessment. The model can change subject matter or factual claims, especially under Creative instructions or strong perturbations. Stronger displacement can degrade fluency without improving emotional alignment.
317
+
318
+ A proper evaluation should distinguish emotional movement from target accuracy. Collect independent ratings of input and output along operationally defined axes, compare requested and observed trajectories, and report failures and unmodified fallbacks alongside successful generations. Include unsteered rewriting, prompt-only emotional instructions, opposite targets, random directions of matched magnitude, and layer/axis ablations. Keep decoding settings fixed for controlled comparisons, and separate greedy from sampled experiments.
319
+
320
+ Semantic fidelity should be evaluated against the selected style: Creative permits mutation, whereas Restrained requests factual preservation. Fluency, coherence across chunks, omitted material, repetition, length ratios, latency, and memory consumption are separate outcomes. No automatic similarity score, feedback optimization, or acceptance threshold is implemented in this runner.
321
+
322
+ Changing to a larger model requires new architecture validation, basis calibration, layer selection, and operating-range experiments. A basis with three rows and 1,024 columns cannot simply be reused with a different hidden width or intervention site. Multilingual operation likewise requires independent calibration and evaluation; same-language prompt wording alone does not establish it.
323
+
324
+ ## Implementation sources
325
+
326
+ This report describes the repository's executable operations rather than relying on another application's interface or documentation.
327
+
328
+ - [CUDA runner and smoke protocol](run_arc.py)
329
+ - [Document transformation and incremental output](document_run.py)
330
+ - [Calibration, displacement math, hooks, and decoding](engine/steering.py)
331
+ - [Geometry schema and interpolation](engine/geometry.py)
332
+ - [Segmentation and character allowance](engine/documents.py)
333
+ - [Rewrite system prompts](engine/rewrite_policy.py)
334
+ - [Repetition detection and draft salvage](engine/generation.py)
335
+ - [Engine source hashes](ENGINE_MANIFEST.json)
336
+ - [Generation policy tests](tests/test_generation.py) and [document-run tests](tests/test_document_run.py)
337
+
338
+ ## AI assistance disclosure
339
+
340
+ This project was created with assistance from GPT-6 Astra and Codex. AI tools supported software development, testing, and the drafting and revision of this technical report. William Taggart is responsible for the project's research decisions and the final software and documentation. AI assistance does not constitute independent validation of the implementation or its scientific claims; the validation evidence and limitations are stated separately in this report.
341
+
342
+ ## Research references
343
+
344
+ Version-specific arXiv records are linked below. Years distinguish original release from later revision where applicable. These research references supplement the implementation and infrastructure sources elsewhere in this report. Reusable citations: [BibTeX](references.bib). Verification details: [source-check notes](LITERATURE_SOURCES.md).
345
+
346
+ **R1.** Alex Turner; Lisa Thiergart; David Udell; Gavin Leech; Ulisse Mini; Monte MacDiarmid. 2023. Activation Addition: Steering Language Models Without Optimization. [arXiv:2308.10248v1](https://arxiv.org/abs/2308.10248v1). Cited version dated 2023-08-20.
347
+
348
+ **R2.** Nina Panickssery; Nick Gabrieli; Julian Schulz; Meg Tong; Evan Hubinger; Alexander Matt Turner. 2024. Steering Llama 2 via Contrastive Activation Addition. [arXiv:2312.06681v4](https://arxiv.org/abs/2312.06681v4). Cited version dated 2024-07-05.
349
+
350
+ **R3.** Xiuwen Wu; Hao Wang; Zhiang Yan; Xiaohan Tang; Pengfei Xu; Wai-Ting Siok; Ping Li; Jia-Hong Gao; Bingjiang Lyu; Lang Qin. 2025. AI shares emotion with humans across languages and cultures. [arXiv:2506.13978v1](https://arxiv.org/abs/2506.13978v1). Cited version dated 2025-06-11.
351
+
352
+ **R4.** Diaoulé Diallo; Katharina Dworatzyk; Sophie Jentzsch; Peer Schütt; Sabine Theis; Tobias Hecking. 2026. The Effectiveness of Style Vectors for Steering Large Language Models: A Human Evaluation. [arXiv:2601.21505v1](https://arxiv.org/abs/2601.21505v1). Cited version dated 2026-01-29. ArXiv record lists IEEE Access 13 (2025), 191443-191457; DOI: 10.1109/ACCESS.2025.3628500.
353
+
354
+ **R5.** Moran Sun; Tianlin Li; Yuwei Zheng; Zhenhong Zhou; Aishan Liu; Xianglong Liu; Yang Liu. 2026. How Emotion Shapes the Behavior of LLMs and Agents: A Mechanistic Study. [arXiv:2604.00005v1](https://arxiv.org/abs/2604.00005v1). Cited version dated 2026-03-09.
355
+
356
+ **R6.** Jihoon Jeong. 2026. Extracting and Steering Emotion Representations in Small Language Models: A Methodological Comparison. [arXiv:2604.04064v1](https://arxiv.org/abs/2604.04064v1). Cited version dated 2026-04-05.
357
+
358
+ **R7.** Bangzhao Shu; Arinjay Singh; Mai ElSherief. 2026. Why Are Some Emotions Harder for LLMs? Uncovering the Causal Mechanisms of Emotion Inference via Sparse Autoencoders. [arXiv:2604.25866v3](https://arxiv.org/abs/2604.25866v3). Cited version dated 2026-10-24.
359
+
360
+ **R8.** Yibo Wang; Jisheng Dang; Bimei Wang; Yitao Wu; Wencan Zhang; Hong Peng; Jizhao Liu; Bin Hu; Qi Tian; Tat-Seng Chua. 2026. Read-Best Is Not Steer-Best: A Probing--Steering Layer Dissociation in Omni-Modal Large Language Models. [arXiv:2609.22135v1](https://arxiv.org/abs/2609.22135v1). Cited version dated 2026-08-24.
361
+
362
+ **R9.** JuHeon Ha; Byounghan Lee; Yunseo Choi; Kyung-Ah Sohn. 2026. Empathy Is Steerable but Multi-Axial: Mechanism Geometry and Persona Effects in LLMs. [arXiv:2609.15654v1](https://arxiv.org/abs/2609.15654v1). Cited version dated 2026-09-14. ArXiv comments report acceptance to the EMNLP 2026 main conference.
363
+
364
+ **R10.** Sasha Cui; Zhongren Chen. 2025. Painless Activation Steering: An Automated, Lightweight Approach for Post-Training Large Language Models. [arXiv:2509.22739v3](https://arxiv.org/abs/2509.22739v3). Cited version dated 2026-05-15.
365
+
366
+ **R11.** Alex Ferrando; Xavier Suau; Jordi Gonzàlez; Pau Rodriguez. 2025. Dynamically Scaled Activation Steering. [arXiv:2512.03661v2](https://arxiv.org/abs/2512.03661v2). Cited version dated 2026-07-30.
367
+
368
+ **R12.** Haotian Yang; Huikang Jiang; Yucheng Wu; Wen-Jie Jiang; Chenpeng Wang; Yibin Lou; Liangming Pan. 2026. Does Steering Break Your Model? A Multi-Dimensional Evaluation Suite for LLM Steering Methods. [arXiv:2610.07722v1](https://arxiv.org/abs/2610.07722v1). Cited version dated 2026-10-06.
369
+
370
+ ### Suggested citation
371
+
372
+ ```bibtex
373
+ @techreport{taggart2026affectorarc,
374
+ author = {Taggart, William},
375
+ title = {{AFFECTOR-ARC}: Emotional Trajectory Control through Transformer Activation Steering},
376
+ institution = {Modern and Classical Languages and Literatures, Virginia Tech},
377
+ year = {2026},
378
+ month = nov,
379
+ note = {Technical report, revision 0.2; current CUDA and emotional-effectiveness validation pending},
380
+ url = {https://huggingface.co/will-taggart/AFFECTOR-ARC/blob/main/TECHNICAL_REPORT.md}
381
+ }
382
+ ```
paper/figure-specifications.json ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ [
3
+ "Emotional coordinates and trajectory interpolation",
4
+ "Schedule the computation on a GPU node",
5
+ [
6
+ [
7
+ "Text + geometry + controls",
8
+ "Slurm resource request",
9
+ "Allocated compute node"
10
+ ],
11
+ [
12
+ "CUDA model load",
13
+ "Calibrate and rewrite",
14
+ "Results and diagnostics"
15
+ ]
16
+ ],
17
+ "Single-process, single-GPU runner; queue requests are not performance measurements",
18
+ "Execution schematic. The compute workload belongs to the allocated GPU node. Resource requests describe scheduling needs and do not establish measured minimum requirements."
19
+ ],
20
+ [
21
+ "Estimating activation directions",
22
+ "Align geometry to original document positions",
23
+ [
24
+ [
25
+ "Increasing t in [0,1]",
26
+ "Linear interpolation",
27
+ "Endpoint clamping"
28
+ ],
29
+ [
30
+ "Chunk midpoint in original text",
31
+ "Sample (v,d,2i-1)",
32
+ "Hold target through chunk"
33
+ ]
34
+ ],
35
+ "One target per generation call; neighbors are not prior conversational context",
36
+ "Trajectory alignment. The runner stretches or compresses the source path over normalized target positions and may miss unsampled emotional changes."
37
+ ],
38
+ [
39
+ "From coordinates to bounded displacements",
40
+ "Recalibrate on the current CUDA runtime",
41
+ [
42
+ [
43
+ "12 English contrast pairs",
44
+ "Capture final prompt positions",
45
+ "24 forward passes"
46
+ ],
47
+ [
48
+ "Mean positive-minus-negative",
49
+ "RMS-normalize axis rows",
50
+ "B_l: 3 x 1024"
51
+ ]
52
+ ],
53
+ "Default layers 8, 16, 23 with weights 1, 1, 0.5; no optimizer",
54
+ "Calibration schematic. The runner recalibrates the imported trajectory on the current runtime. The contrast basis is an experimental numerical control, not a validated multilingual emotion scale."
55
+ ],
56
+ [
57
+ "User controls and rewrite instructions",
58
+ "Separate activation controls from token sampling",
59
+ [
60
+ [
61
+ "Axis temperature / mass / top-k",
62
+ "Strength + inertia + budget",
63
+ "Bounded hidden-state delta"
64
+ ],
65
+ [
66
+ "Generation temperature",
67
+ "Token top-p / top-k",
68
+ "Choose output token"
69
+ ]
70
+ ],
71
+ "At generation temperature 0, decoding is greedy and token top-p/top-k are inactive",
72
+ "Two distinct control paths. Axis selection modifies activation coefficients before generation scores; token sampling operates afterward on the vocabulary distribution."
73
+ ],
74
+ [
75
+ "Engineering checks and evidence",
76
+ "A failed chunk does not end the document",
77
+ [
78
+ [
79
+ "Attempt chunk once",
80
+ "Inspect repetition and ending",
81
+ "Select usable output or fallback"
82
+ ],
83
+ [
84
+ "Record warnings and raw draft",
85
+ "Advance to next chunk",
86
+ "Write text and report artifacts"
87
+ ]
88
+ ],
89
+ "Keep requested steering settings; report failure rather than silently weakening controls",
90
+ "Output lifecycle schematic. Bounded generation, complete-prefix selection, diagnostics and per-chunk continuation address specific failure modes; they do not guarantee emotional fit or preservation of all content."
91
+ ]
92
+ ]
paper/figures/illustration-01.pdf ADDED
Binary file (19.1 kB). View file
 
paper/figures/illustration-01.png ADDED
paper/figures/illustration-02.pdf ADDED
Binary file (19 kB). View file
 
paper/figures/illustration-02.png ADDED
paper/figures/illustration-03.pdf ADDED
Binary file (20.7 kB). View file
 
paper/figures/illustration-03.png ADDED
paper/figures/illustration-04.pdf ADDED
Binary file (19 kB). View file
 
paper/figures/illustration-04.png ADDED
paper/figures/illustration-05.pdf ADDED
Binary file (19.9 kB). View file
 
paper/figures/illustration-05.png ADDED
paper/render_figures.py ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from pathlib import Path
2
+ import json,textwrap
3
+ import matplotlib
4
+ matplotlib.use('Agg')
5
+ import matplotlib.pyplot as plt
6
+ from matplotlib.patches import FancyBboxPatch,FancyArrowPatch
7
+ plt.rcParams.update({'font.family':'DejaVu Sans','font.size':11,'pdf.fonttype':42})
8
+ def diagram(path,title,lanes,footer):
9
+ fig,ax=plt.subplots(figsize=(10.6,3.55));ax.set_xlim(0,10.6);ax.set_ylim(0,3.55);ax.axis('off')
10
+ ax.text(.12,3.28,title,fontsize=17,weight='bold',va='center',color='#18232b')
11
+ for row,lane in enumerate(lanes):
12
+ y=2.02-row*1.05
13
+ for col,label in enumerate(lane):
14
+ x=.12+col*3.55
15
+ ax.add_patch(FancyBboxPatch((x,y),3.15,.78,boxstyle='round,pad=0.05,rounding_size=0.07',facecolor='#eef3f5' if row==0 else '#f5f5f5',edgecolor='#8c9da6',lw=.85))
16
+ ax.text(x+1.575,y+.39,textwrap.fill(label,26),ha='center',va='center',fontsize=11.4,color='#17242b')
17
+ if col<2 and not (title.startswith('Three scores') or (title.startswith('Objects are') and row==0)):ax.add_patch(FancyArrowPatch((x+3.22,y+.39),(x+3.48,y+.39),arrowstyle='-|>',mutation_scale=13,color='#486570',lw=1.2))
18
+ ax.text(.12,.30,textwrap.fill(footer,102),fontsize=10.6,va='center',color='#374b57')
19
+ fig.savefig(path.with_suffix('.pdf'),bbox_inches='tight',pad_inches=.06)
20
+ fig.savefig(path.with_suffix('.png'),bbox_inches='tight',pad_inches=.06,dpi=200)
21
+ plt.close(fig)
22
+
23
+ r=Path(__file__).parent
24
+ for k,(_,title,lanes,footer,_) in enumerate(json.loads((r/'figure-specifications.json').read_text()),1):
25
+ diagram(r/'figures'/f'illustration-{k:02}',title,lanes,footer)
paper/source.md CHANGED
@@ -60,6 +60,11 @@ Source files are distributed with the repository. `ENGINE_MANIFEST.json` records
60
 
61
  The example Slurm script requests one GPU, eight CPU cores, 64 GB of host memory, and one hour. These are scheduling requests, not measured minimum requirements. Users must supply an allocation and a suitable model cache. The runner is single-process and single-GPU; it is not a concurrent inference server.
62
 
 
 
 
 
 
63
  ## 3. Emotional coordinates and trajectory interpolation
64
 
65
  A trajectory point is
@@ -88,6 +93,11 @@ That target remains constant throughout generation of the chunk. A long trajecto
88
 
89
  The runner accepts a native geometry JSON file and supported analysis JSON structures containing emotional coordinates. It recalibrates the basis on the current CUDA runtime even when the imported geometry includes one. With no geometry argument, it uses a demonstration path with three points; this path is not inferred from the input document.
90
 
 
 
 
 
 
91
  ## 4. Estimating activation directions
92
 
93
  A hidden state at a selected layer is a vector in $\mathbb{R}^{1024}$. To estimate a direction associated with one emotional contrast, the system compares the model's states for paired passages that differ in the desired property.
@@ -116,6 +126,11 @@ The three directions form the rows of a matrix $B_\ell\in\mathbb{R}^{3\times1024
116
 
117
  Default layers are 8, 16, and 23, using zero-based indexing, with weights 1, 1, and 0.5. This is subtraction, averaging, and normalization; there is no training optimizer, backbone fine-tuning, orthogonalization, or outcome-based fitting. The small calibration set may encode vocabulary, topic, or perspective along with emotion. Normalizing the vectors does not establish that the axes are independent or valid across languages.
118
 
 
 
 
 
 
119
  ## 5. From coordinates to bounded displacements
120
 
121
  ### 5.1 Selecting and weighting axes
@@ -180,6 +195,11 @@ A pre-hook adds $\delta$ to the normalization input; a block-output hook adds th
180
 
181
  This is an open-loop intervention. Coefficients come from the requested absolute coordinates, not the difference between a measured output emotion and the target. A zero coefficient adds no intervention on that axis; it does not actively neutralize emotion already expressed by the model.
182
 
 
 
 
 
 
183
  ## 6. User controls and rewrite instructions
184
 
185
  | Control | Default without an imported override | Function |
@@ -248,6 +268,11 @@ Successful generation records include stopping reason, token count, elapsed time
248
 
249
  JSON writes use temporary-file replacement. The companion text file is written normally and may be incomplete if interrupted during that write. Reports are incremental records, not automatic resume checkpoints: rerunning starts over and overwrites the selected output paths. Use a distinct output filename for each experiment. Reports contain the input text and should be treated as document-bearing artifacts.
250
 
 
 
 
 
 
251
  ## 9. Engineering checks and evidence
252
 
253
  Smoke mode is the default and operates on one supplied passage. It runs baseline, zero-strength, positive-valence, negative-valence, and restored-baseline conditions. Positive and negative conditions use coefficient vectors $(0.8,0,0)$ and $(-0.8,0,0)$. The third coordinate zero corresponds to intensity 0.5.
 
60
 
61
  The example Slurm script requests one GPU, eight CPU cores, 64 GB of host memory, and one hour. These are scheduling requests, not measured minimum requirements. Users must supply an allocation and a suitable model cache. The runner is single-process and single-GPU; it is not a concurrent inference server.
62
 
63
+
64
+ ![Schedule the computation on a GPU node](figures/illustration-01.png)
65
+
66
+ *Illustration 1. Execution schematic. The compute workload belongs to the allocated GPU node. Resource requests describe scheduling needs and do not establish measured minimum requirements.*
67
+
68
  ## 3. Emotional coordinates and trajectory interpolation
69
 
70
  A trajectory point is
 
93
 
94
  The runner accepts a native geometry JSON file and supported analysis JSON structures containing emotional coordinates. It recalibrates the basis on the current CUDA runtime even when the imported geometry includes one. With no geometry argument, it uses a demonstration path with three points; this path is not inferred from the input document.
95
 
96
+
97
+ ![Align geometry to original document positions](figures/illustration-02.png)
98
+
99
+ *Illustration 2. Trajectory alignment. The runner stretches or compresses the source path over normalized target positions and may miss unsampled emotional changes.*
100
+
101
  ## 4. Estimating activation directions
102
 
103
  A hidden state at a selected layer is a vector in $\mathbb{R}^{1024}$. To estimate a direction associated with one emotional contrast, the system compares the model's states for paired passages that differ in the desired property.
 
126
 
127
  Default layers are 8, 16, and 23, using zero-based indexing, with weights 1, 1, and 0.5. This is subtraction, averaging, and normalization; there is no training optimizer, backbone fine-tuning, orthogonalization, or outcome-based fitting. The small calibration set may encode vocabulary, topic, or perspective along with emotion. Normalizing the vectors does not establish that the axes are independent or valid across languages.
128
 
129
+
130
+ ![Recalibrate on the current CUDA runtime](figures/illustration-03.png)
131
+
132
+ *Illustration 3. Calibration schematic. The runner recalibrates the imported trajectory on the current runtime. The contrast basis is an experimental numerical control, not a validated multilingual emotion scale.*
133
+
134
  ## 5. From coordinates to bounded displacements
135
 
136
  ### 5.1 Selecting and weighting axes
 
195
 
196
  This is an open-loop intervention. Coefficients come from the requested absolute coordinates, not the difference between a measured output emotion and the target. A zero coefficient adds no intervention on that axis; it does not actively neutralize emotion already expressed by the model.
197
 
198
+
199
+ ![Separate activation controls from token sampling](figures/illustration-04.png)
200
+
201
+ *Illustration 4. Two distinct control paths. Axis selection modifies activation coefficients before generation scores; token sampling operates afterward on the vocabulary distribution.*
202
+
203
  ## 6. User controls and rewrite instructions
204
 
205
  | Control | Default without an imported override | Function |
 
268
 
269
  JSON writes use temporary-file replacement. The companion text file is written normally and may be incomplete if interrupted during that write. Reports are incremental records, not automatic resume checkpoints: rerunning starts over and overwrites the selected output paths. Use a distinct output filename for each experiment. Reports contain the input text and should be treated as document-bearing artifacts.
270
 
271
+
272
+ ![A failed chunk does not end the document](figures/illustration-05.png)
273
+
274
+ *Illustration 5. Output lifecycle schematic. Bounded generation, complete-prefix selection, diagnostics and per-chunk continuation address specific failure modes; they do not guarantee emotional fit or preservation of all content.*
275
+
276
  ## 9. Engineering checks and evidence
277
 
278
  Smoke mode is the default and operates on one supplied passage. It runs baseline, zero-strength, positive-valence, negative-valence, and restored-baseline conditions. Positive and negative conditions use coefficient vectors $(0.8,0,0)$ and $(-0.8,0,0)$. The third coordinate zero corresponds to intensity 0.5.