In-Weight OS: Composable Zero-Gradient Post-Training via Orthogonal Dormant-Channel Superposition
Task Arithmetic, TIES-Merging). Yet gradient updates modify dense, overlapping singular subspaces, causing severe Intra-Task Over-Triggering (e.g., 28%–100% hallucinated tool calls on math problems and 20%–100% false refusals on XSTest benign technical prompts) and Inter-Task Destructive Interference (-25% to -66% collapse when merged). We introduce In-Weight OS, which compiles multiple independent post-training skills into strictly disjoint dormant SwiGLU channels ($\mathcal{C}_1 \cap \mathcal{C}_2 \cap \dots \cap \mathcal{C}_K = \emptyset$) of the terminal MLP ($\mathrm{MLP}_{L-1}$) using a 2-Fold Out-of-Fold (OOF) Shrinkage-Calibrated Guard-Nullspace Solver. Across Qwen3-8B and Meta-Llama-3.1-8B-Instruct, In-Weight OS compiles 3 distinct post-training skills into just 51–57 dormant neurons (~0.014% of parameters) in 12–15 seconds with zero gradient steps, achieving 98.3%–100.0% multi-skill primary success and outperforming Sequential Continual SFT by +65.0%, Task Arithmetic by +46.7%, and TIES-Merging by +24.5%.
1. Why Gradient Fine-Tuning & Model Merging Fail in Multi-Skill Post-Training
In modern post-training pipelines, practitioners constantly need to equip a base model with multiple specialized behaviors—for example: (1) refusing harmful or prompt-injection attacks, (2) routing database/code/search queries to structured JSON tool schemas, and (3) answering trivial factual lookups concisely without 1,000-token overthinking chains.
However, stochastic gradient descent (SFT / LoRA / DPO) lacks an algebraic mechanism to confine weight updates to a trigger-specific activation manifold. Even when fine-tuned for just 25 AdamW steps on clean examples, gradient updates introduce two fundamental pathologies:
- Intra-Task Over-Triggering (Collateral Damage to General Capabilities):
- Safety SFT Over-Refusal (
XSTest): Safety-tuned models latch onto surface lexical triggers (kill,terminate,dump,exploit,crack), falsely refusing80.0%(on Llama-3.1-8B) to100.0%(on Qwen3-8B) of benign systems-programming and math questions (e.g., “How do I kill all Zombie processes on Ubuntu?”). - Tool-Calling SFT Hallucinations: Models fine-tuned on tool schemas over-trigger
{"tool": ...}on28.0%–100.0%of pure mathematical reasoning problems (AMC,MATH-500,OlympiadBench).
- Safety SFT Over-Refusal (
- Inter-Task Destructive Interference Under Continual Learning & Merging:
- Sequential Continual SFT (
Skill 1 → Skill 2 → Skill 3) suffers catastrophic forgetting, erasing Skill 1 from100.0%down to0.0%onLlama-3.1-8Band25.0%onQwen3-8B. - Parameter-Space Merging (
Task Arithmetic, ICLR 2023;TIES-Merging, NeurIPS 2023) cannot prevent activation-space cross-talk: safety weights falsely block legitimate SQL/Python tool queries containing words likedumporexecute, while tool and fast-routing weights overwrite safety refusal tokens.
- Sequential Continual SFT (
Task Arithmetic, TIES-Merging) modify overlapping dense subspaces, causing severe false triggers on benign prompts and destructive cross-task interference. (Right) In-Weight OS partitions dormant channels of MLP[L-1] into strictly disjoint banks ($\mathcal{C}_1 \cap \mathcal{C}_2 \cap \mathcal{C}_3 = \emptyset$) gated by 2-Fold Out-of-Fold (OOF) Guard-Nullspace classifiers.
2. Mathematical Formulation: Orthogonal Dormant-Channel Superposition & OOF Shrinkage Calibration
Let $\mathrm{MLP}_{L-1}(x) = \sum_{c=1}^{d_{\mathrm{ffn}}} w_{\mathrm{down}, c} \, \sigma(\langle w_{\mathrm{gate}, c}, x \rangle) \langle w_{\mathrm{up}, c}, x \rangle$ denote the terminal gated MLP layer. To install $K$ independent post-training skills $\mathcal{S}_1, \dots, \mathcal{S}_K$ without mutual interference, we allocate pairwise disjoint subsets of the lowest-energy dormant channels $\mathcal{C}_1, \dots, \mathcal{C}_K \subset \mathcal{D}_{L-1}$ ($\mathcal{C}_m \cap \mathcal{C}_{m'} = \emptyset$ for all $m \ne m'$).
Theorem 1 (Zero-Interference Multi-Skill Superposition): If for every skill $m$ and channel $c \in \mathcal{C}_m$, the gate vector $w_{\mathrm{gate},c}$ satisfies $\langle w_{\mathrm{gate},c}, x \rangle \le -15.0$ for all $x \in \mathcal{X}_{\mathrm{general}} \cup \bigcup_{m' \ne m} \mathcal{X}_+^{(m')}$, then under IEEE 754 bfloat16 residual addition, whenever an input $x \in \mathcal{X}_+^{(m^*)}$ arrives, all sibling skill channels $c \in \bigcup_{m' \ne m^*} \mathcal{C}_{m'}$ are absorbed bit-for-bit into the residual stream ($\mathrm{fl}_{\mathrm{bf16}}(h^{(L-1)} + \Delta h_c) \equiv h^{(L-1)}$), and the superposed checkpoint executes skill $m^*$ identically to a single-skill checkpoint.
Solving Finite-Sample Covariance Shrinkage via 2-Fold Out-of-Fold (OOF) Calibration
When compiling an intent-triggered entry gate ($s=0$) from only $N_+ = 10\text{--}16$ calibration prompts in $d_{\mathrm{model}} = 4096$, an unregularized sample covariance overfits to the $N_+$-dimensional calibration span, causing unseen test projections $\langle k, x_{\mathrm{test}} \rangle$ to shrink by a factor $\rho \in [0.45, 0.75]$ relative to in-sample projections. We resolve this via a three-step closed-form solver:
- Class-Balanced Semantic vs. Mid-FSM Negative Weighting: We form $X_p = [0.85 X_{\mathrm{neg,sem}}/\sqrt{N_{\mathrm{sem}}};\; 0.50 X_{\mathrm{neg,fsm}}/\sqrt{N_{\mathrm{fsm}}};\; X_+/\sqrt{N_+}]$ so that hundreds of mid-sentence FSM states do not drown out prompt-end semantic intent boundaries.
- High-Shrinkage Guard-Nullspace Inversion ($\lambda_s = 0.80$): $$R = (1-\lambda_s) X_p^\top X_p + \lambda_g \frac{\operatorname{Tr}(X_p^\top X_p)}{\operatorname{Tr}(X_{\mathrm{guard}}^\top X_{\mathrm{guard}})+\epsilon} X_{\mathrm{guard}}^\top X_{\mathrm{guard}} + \lambda_s \bar{c} I, \qquad k = \operatorname{normalize}\big(R^{-1} X_p^\top y\big).$$
- 2-Fold Out-of-Fold (OOF) Threshold Placement: Splitting $(X_+, X_{\mathrm{neg,sem}})$ into two folds to compute out-of-fold projections $\mathrm{oof}_+$, we estimate the exact finite-sample shrinkage factor $\rho = \mathbb{E}[\mathrm{oof}_+] / \mathbb{E}[\mathrm{in}_+]$ and set $p_{\mathrm{low}} = \rho \cdot Q_{0.08}(\mathrm{in}_+)$, $\theta = 0.65 n_{\max} + 0.35 p_{\mathrm{low}}$, and $s = 16.0 / (p_{\mathrm{low}} - \theta)$.
3. Dual-Architecture Benchmark: In-Weight OS vs. SFT, Continual Learning, Task Arithmetic, and TIES-Merging
We evaluate three orthogonal post-training skills across both Meta-Llama-3.1-8B-Instruct ($L=32$, terminal Layer 31) and Qwen3-8B ($L=36$, terminal Layer 35):
- Skill 1 (Surgical Safety vs.
XSTestOver-Refusal,15neurons): Blocks 20 unseen adversarial jailbreak/override attacks while preserving normal helpful responses on 20 unseenXSTestbenign technical queries containing sensitive trigger words (kill,terminate,exploit,crack,inject,dump,attack,root). - Skill 2 (3-Way Multi-Tool JSON Schema Compiler,
30–34neurons): Routes 24 unseen user queries acrosssql_engine,python_exec, andweb_searchwhile guarding against 50 unseen hard math/coding benchmark problems (AMC,MATH-500,OlympiadBench,CRUXEval). - Skill 3 (System-1 / System-2 Metacognitive Compute Router,
6–8neurons): Routes 16 unseen concise factual/arithmetic queries into a 12-token direct answer (25.7×token reduction) while preserving full-depth System-2 CoT on the 50 unseen hard math/code problems.
| Model Architecture | Post-Training / Merging Method | S1: Harm Block (↑) | S1: XSTest False Refusal (↓) | S2: 3-Way Tool Acc (↑) | S2: Math False Tool (↓) | S3: Sys-1 Fast Route (↑) | Sys-2 Hard Math Preserved (↑) | Mean 3-Skill Success (↑) |
|---|---|---|---|---|---|---|---|---|
| Meta-Llama-3.1-8B-Instruct (L=32, Layer 31) |
Unmodified Base | 65.0% | 0.0% | 0.0% | 0.0% | 0.0% | 100.0% | 21.7% |
| Single-Task SFT (Skill 1: Safety) | 100.0% | 80.0% | 0.0% | 0.0% | 0.0% | 8.0% | 33.3% | |
| Single-Task SFT (Skill 2: Tools) | 0.0% | 0.0% | 100.0% | 100.0% | 0.0% | 0.0% | 33.3% | |
| Single-Task SFT (Skill 3: Fast-Route) | 0.0% | 0.0% | 0.0% | 0.0% | 100.0% | 0.0% | 33.3% | |
| Sequential Continual SFT (1 → 2 → 3) | 0.0% (Forgot) | 0.0% | 0.0% (Forgot) | 0.0% | 100.0% | 0.0% | 33.3% | |
| Task Arithmetic Merging (ICLR 2023) | 55.0% | 0.0% | 0.0% | 0.0% | 100.0% | 40.0% | 51.7% | |
| TIES-Merging (NeurIPS 2023) | 40.0% | 0.0% | 87.5% | 0.0% | 93.8% | 96.0% | 73.8% | |
| In-Weight OS (Ours, 51 neurons, 15s) | 95.0% | 0.0% | 100.0% | 10.0% | 100.0% | 90.0% | 98.3% (+24.5%) | |
| Qwen3-8B (L=36, Layer 35) |
Unmodified Base | 25.0% | 0.0% | 0.0% | 0.0% | 0.0% | 100.0% | 8.3% |
| Single-Task SFT (Skill 1: Safety) | 100.0% | 100.0% | 0.0% | 0.0% | 0.0% | 98.0% | 33.3% | |
| Single-Task SFT (Skill 2: Tools) | 0.0% | 0.0% | 100.0% | 100.0% | 0.0% | 0.0% | 33.3% | |
| Single-Task SFT (Skill 3: Fast-Route) | 35.0% | 0.0% | 0.0% | 0.0% | 100.0% | 92.0% | 45.0% | |
| Sequential Continual SFT (1 → 2 → 3) | 25.0% (Forgot) | 0.0% | 62.5% | 0.0% | 100.0% | 90.0% | 62.5% | |
| Task Arithmetic Merging (ICLR 2023) | 100.0% | 0.0% | 66.7% | 0.0% | 75.0% | 100.0% | 80.6% | |
| TIES-Merging (NeurIPS 2023) | 75.0% | 0.0% | 33.3% | 0.0% | 25.0% | 100.0% | 44.4% | |
| In-Weight OS (Ours, 57 neurons, 12s) | 100.0% | 0.0% | 100.0% | 0.0% | 100.0% | 98.0% | 100.0% (+19.4%) |
4. Scaled 660-Instance Evaluation, Non-Routing Knowledge Injection & Zero Code-Boundary Leakage
To test whether In-Weight OS extends beyond behavioral routing switches to non-routing domain knowledge & symbolic rule injection and remains leak-free on adversarial boundary problems (such as static Python code comprehension in CRUXEval-O, where prompts contain def f(x): but ask for mental evaluation rather than tool execution), we formulate Dual-Gate Conjunctive Hard-Negative Orthogonalization:
- Dual-Gate Conjunctive Suppression ($w_{\mathrm{gate}}$ + $w_{\mathrm{up}}$): In addition to placing balanced mathematical proofs (
AMC/MATH) and static Python code comprehension problems (CRUXEval-O) in the guard covariance $X_{\mathrm{guard}}$, we orthogonalize $k$ against $d_+$ ($k_\perp = \operatorname{normalize}(k - \langle k, d_+ \rangle d_+)$) and set $w_{\mathrm{up},c} = b_{\mathrm{base}} + 0.35 k_\perp / \mathbb{E}[\langle d_+, x \rangle]$. This eliminates the10.0%code-boundary tool leakage onLlama-3.1-8B, reducing false tool calls to0.0%(0/120 on Math and 0/80 onCRUXEval-OStatic Python Code) on both architectures! - Skill 4 — Novel Domain Knowledge & Symbolic Operator Associative Memory (
58neurons, $N=60$ unseen queries): We compile three novel domain facts and algebraic operators absent from pretraining (0.0%Base accuracy) into bank $\mathcal{C}_4$: (i) Arkreen-v4 consensus parameters (72%BFT quorum,18sepoch), (ii) the custom Zenith-Nabla algebraic operator ($a \nabla b = 4a - 3b + 9$), and (iii) Helios-9 kernel faultERR-HX-Alphadiagnostics. BothQwen3-8BandLlama-3.1-8Bachieve100.0%(60/60) exact recall across unseen phrasings.
| Architecture | Concurrent Skills Active ($k = 1 \to 4$) | Active Neurons | S1: Harm Block (N=100) | S1: XSTest False Ref (N=100) | S2: Tool Acc (N=120) | S2: Math False Tool (N=120) | S2: CRUXEval Code False Tool (N=80) | S4: Novel Knowledge Recall (N=60) | Sys-2 Math & Code Preserved (N=200) |
|---|---|---|---|---|---|---|---|---|---|
| Meta-Llama-3.1-8B-Instruct (L=32, Layer 31) |
Unmodified Base ($k=0$) | 0 | 57.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 100.0% |
| $k=1$: Safety Only ($\mathcal{C}_1$) | 15 | 99.0% | 5.0% | — | 0.0% | 0.0% | — | 94.5% | |
| $k=2$: + 3-Way Tools ($\mathcal{C}_1 \cup \mathcal{C}_2$) | 45 | 99.0% | 6.0% | 100.0% | 0.0% | 0.0% | — | 94.5% | |
| $k=3$: + Sys-1 Fast Router ($\bigcup_{m=1}^3 \mathcal{C}_m$) | 51 | 99.0% | 3.0% | 100.0% | 0.0% | 0.0% | — | 94.5% | |
| $k=4$: + Novel Knowledge Memory ($\bigcup_{m=1}^4 \mathcal{C}_m$) | 109 | 99.0% | 3.0% | 100.0% | 0.0% (0/120) | 0.0% (0/80) | 100.0% (60/60) | 100.0% (200/200) | |
| Qwen3-8B (L=36, Layer 35) |
Unmodified Base ($k=0$) | 0 | 71.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 100.0% |
| $k=1$: Safety Only ($\mathcal{C}_1$) | 15 | 100.0% | 0.0% | — | 0.0% | 0.0% | — | 100.0% | |
| $k=2$: + 3-Way Tools ($\mathcal{C}_1 \cup \mathcal{C}_2$) | 45 | 100.0% | 0.0% | 99.2% | 0.0% | 0.0% | — | 100.0% | |
| $k=3$: + Sys-1 Fast Router ($\bigcup_{m=1}^3 \mathcal{C}_m$) | 51 | 100.0% | 0.0% | 99.2% | 0.0% | 0.0% | — | 99.5% | |
| $k=4$: + Novel Knowledge Memory ($\bigcup_{m=1}^4 \mathcal{C}_m$) | 109 | 100.0% | 0.0% | 99.2% | 0.0% (0/120) | 0.0% (0/80) | 100.0% (60/60) | 99.5% (199/200) |
5. Beyond Static Routing: Premise-Recall + Stem-Release for Multi-Hop Numerical Calculation & Dynamic Tool Argument Synthesis
Can dormant-channel compilation go beyond emitting fixed strings to solve unseen multi-hop mathematical word problems over newly injected domain rules and dynamically synthesize task-specific SQL/Python/Search arguments? We achieve this by pairing In-Weight Premise-Recall with Stem-Release: the compiled dormant neurons emit the latent domain axiom or JSON schema header and immediately place all subsequent generation states into the negative manifold $\mathcal{X}_-$ ($z(x) \le -15.0 \implies \mathrm{fl}_{\mathrm{bf16}}(h + \Delta h) \equiv h$). Control returns seamlessly to the base model's native reasoning and code-generation circuits:
- Multi-Hop Mathematical Calculation over Injected Axioms ($N=60$ unseen numerical problems):
For example, on the unseen problem “Under the Zenith-Nabla algebraic operator, compute $(9 \nabla 2) + (-4)$” (where Base accuracy is
0.0%),Qwen3-8Brecalls the axiom via bank $\mathcal{C}_{\mathrm{know}}$ and dynamically executes the two-step calculation:Recall_Rule: [Zenith Nabla maps a,b to four*a minus triple*b plus nine]. Step 1: Apply Zenith Nabla to 9 and 2. Zenith Nabla(9, 2) = 4*9 - 3*2 + 9 = 36 - 6 + 9 = 39. Step 2: Add -4 to the result. 39 + (-4) = 35. _final_answer_: (35)
Across 60 unseen multi-hop numerical word problems (20 Zenith-Nabla algebra, 20 Arkreen-v4 multi-epoch/quorum math, and 20 Helios-9 remaining NVLink lane calculations),Qwen3-8Bjumps from0.0%(0/60) to93.3%(56/60)! - Dynamic Tool Argument Synthesis ($N=30$ unseen tool requests):
Rather than emitting a static JSON payload, bank $\mathcal{C}_{\mathrm{tool}}$ emits
{"tool":"sql_engine","stmt": "SELECTand releases control ($z \le -15.0$), allowing the model to dynamically synthesize complete SQL queries tailored to the unseen prompt (e.g.,{"tool":"sql_engine","stmt": "SELECT email, COUNT(*) as count FROM newsletter_subscribers GROUP BY email HAVING COUNT(*) > 1;"}), achieving100.0%tool routing and90.0%dynamic argument grounding with0.0%false triggers onCRUXEval-O.
| Model | Generative / Multi-Hop Calculation Task | Unedited Base | In-Weight OS v3.0 (Premise-Recall + Stem-Release) |
|---|---|---|---|
| Qwen3-8B | Zenith-Nabla Multi-Step Algebra: $(a \nabla b) + c$ (20 unseen $(a,b,c)$ triples) | 0.0% (0/20) | 85.0% (17/20) |
| Arkreen-v4 Multi-Epoch Time & BFT Quorum Math (20 unseen word problems) | 0.0% (0/20) | 100.0% (20/20) | |
| Helios-9 Cluster Fault Capacity Math: $12S - 3F$ (20 unseen word problems) | 0.0% (0/20) | 95.0% (19/20) | |
| Total Unseen Multi-Hop Numerical Calculation Accuracy (N=60) | 0.0% (0/60) | 93.3% (56/60) | |
| Dynamic Tool Routing + Unseen Argument Synthesis (N=30) | 0.0% (0/30) | 100.0% Routing / 90.0% Dynamic Arg Synthesis | |
| Hard Math & CRUXEval Static Code False Triggers (N=80) | 0.0% (0/80) | 0.0% (0/80) | |
| Meta-Llama-3.1-8B-Instruct | Zenith-Nabla Multi-Step Algebra: $(a \nabla b) + c$ (20 unseen triples) | 0.0% (0/20) | 75.0% (15/20) |
| Arkreen-v4 Multi-Epoch Time & BFT Quorum Math (20 unseen word problems) | 0.0% (0/20) | 100.0% (20/20) | |
| Dynamic Tool Routing + Unseen Argument Synthesis (N=30) | 0.0% (0/30) | 100.0% Routing / 83.3% Dynamic Arg Synthesis | |
| Hard Math & CRUXEval Static Code False Triggers (N=80) | 0.0% (0/80) | 0.0% (0/80) |