pragmaticcs commited on
Commit
b0657a2
·
verified ·
1 Parent(s): d97b72b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +106 -51
README.md CHANGED
@@ -33,6 +33,10 @@ model_type: qwen3_5_text
33
 
34
  <div align="center">
35
 
 
 
 
 
36
  [![License](https://img.shields.io/badge/License-Apache%202.0-6E56CF?style=for-the-badge)](https://opensource.org/licenses/Apache-2.0)
37
  [![Library](https://img.shields.io/badge/Library-transformers-FFD21E?style=for-the-badge&logo=huggingface&logoColor=black)](https://github.com/huggingface/transformers)
38
  [![Merge Method](https://img.shields.io/badge/Merge%20Method-GeoDELLA--HG-27AE60?style=for-the-badge)](#merge-methodology--mathematical-formulation)
@@ -54,6 +58,7 @@ Most sub-10B coding models fail in realistic agentic environments due to a commo
54
 
55
  > [!IMPORTANT]
56
  > The result is a lean, blisteringly fast 9B pure-text causal engine with a native **256k context window** that runs comfortably on consumer GPUs.
 
57
  ---
58
 
59
  ### Contents
@@ -75,14 +80,14 @@ Most sub-10B coding models fail in realistic agentic environments due to a commo
75
  | :--- | :---: |
76
  | **Total Parameters** | 8.8B (Pure Text Backbone) |
77
  | **Architecture Type** | Hybrid Recurrent-Attention Causal LM (`qwen3_5_text`) |
78
- | **Hidden Dimension** ($d_{\text{model}}$) | 4096 |
79
- | **Intermediate Dimension** ($d_{\text{mlp}}$) | 12288 (SwiGLU) |
80
  | **Decoder Layers** | 32 |
81
- | **Attention Layout** | 8 Blocks $\times$ (3 Gated DeltaNet Linear Layers : 1 Gated Softmax Layer) |
82
  | **Full Attention Layers** | Layers 3, 7, 11, 15, 19, 23, 27, 31 |
83
- | **Linear Attention Configuration** | 16 Key Heads / 32 Value Heads ($d_k = d_v = 128$) |
84
- | **Full Attention Configuration** | 16 Query Heads / 4 Key-Value Heads (GQA, $d_h = 256$) |
85
- | **Rotary Position Embedding (RoPE)** | 1D Partial RoPE ($\theta = 10^7$, Partial Factor = 0.25 $\rightarrow$ 64 dimensions) |
86
  | **Context Window Length** | 262,144 tokens (256k) |
87
  | **Native Precision** | `bfloat16` |
88
  | **Vocabulary Size** | 248,320 (Padded for Fill-In-The-Middle and Tool Tokens) |
@@ -91,11 +96,11 @@ Most sub-10B coding models fail in realistic agentic environments due to a commo
91
 
92
  ## Composition & Donor Weighting
93
 
94
- The foundational weights of [Qwen/Qwen3.5-9B](https://huggingface.co/Qwen/Qwen3.5-9B) serve as the shared topological base ($W_0$). Five specialized donor checkpoints provide non-overlapping task vectors mapped across normalized layer depth $u \in [0, 1]$:
95
 
96
  | Model | Primary Focus | Depth Target |
97
  | :--- | :--- | :---: |
98
- | [Qwen/Qwen3.5-9B](https://huggingface.co/Qwen/Qwen3.5-9B) | Base pre-trained manifold and state-space anchors | Global ($W_0$) |
99
  | [empero-ai/Qwen3.8-9B-Distill](https://huggingface.co/empero-ai/Qwen3.8-9B-Distill) | Abstract token synthesis, reasoning structure, syntax | Lower & Mid Decoders |
100
  | [Jackrong/Qwopus3.5-9B-Coder](https://huggingface.co/Jackrong/Qwopus3.5-9B-Coder) | Typing discipline, algorithm design, functional purity | Mid Decoders (Bell Curve) |
101
  | [ornith-ai/Ornith-1.5-9B](https://huggingface.co/ornith-ai/Ornith-1.5-9B) | Circuit-breaker recovery, environment feedback integration | Upper-Mid Decoders |
@@ -110,41 +115,61 @@ The merge was executed using the **GeoDELLA-Coder** pipeline, which solves weigh
110
 
111
  ### 1. Task Vector Formulation
112
 
113
- For each donor checkpoint $k \in \{1, \dots, 5\}$, the parameter update delta $\tau_k$ is computed relative to the base anchor $W_0$:
114
 
115
- $$\tau_k = D_k - W_0, \quad k \in \{\text{Qwen3.8}, \text{Qwopus}, \text{Ornith}, \text{OxCoder}, \text{MiMo}\}$$
 
 
116
 
117
  ### 2. Hybrid-Aware Continuous Depth Modulation
118
 
119
- Task vector mixing coefficients are continuously modulated over normalized depth $u = \frac{l}{L-1}$, where $l \in [0, 31]$ and $L = 32$:
120
 
121
- $$u_{\text{qwen38}}(u) = 0.15 + 0.35 \cos^2\left(\frac{\pi}{2} u\right) + 0.15 \sin^2(\pi u)$$
 
 
122
 
123
- $$u_{\text{qwopus}}(u) = 0.05 + 0.35 \sin^2(\pi u)$$
 
 
124
 
125
- $$u_{\text{ornith}}(u) = 0.05 + 0.35 \sin^2\left(\frac{\pi}{2} u\right)$$
 
 
126
 
127
- $$u_{\text{oxcoder}}(u) = 0.05 + 0.25 \sin^2\left(\frac{\pi}{2} u\right)$$
 
 
128
 
129
- $$u_{\text{mimo}}(u) = 0.05 + 0.15 \sin(\pi u)$$
 
 
130
 
131
- The initial coefficients are normalized to form a partition of unity:
132
 
133
- $$w_k(l) = \frac{u_k(u)}{\sum_{j=1}^5 u_j(u)}, \quad \sum_{k=1}^5 w_k(l) = 1.0$$
 
 
134
 
135
  ### 3. Dynamic Gram-Matrix Task De-Biasing
136
 
137
- Fine-tuned models frequently share underlying distillation datasets, leading to collinearity that can drown out specialized task vectors. To correct for this over-representation, the empirical Gram correlation matrix $G \in \mathbb{R}^{K \times K}$ is evaluated per tensor:
138
 
139
- $$G_{ij} = \frac{|\langle \text{vec}(\tau_i), \text{vec}(\tau_j) \rangle|}{\|\tau_i\|_2 \|\tau_j\|_2}$$
 
 
140
 
141
- A uniqueness coefficient $U_k$ is derived from the inverse column sum of task vector correlations:
142
 
143
- $$U_k = \frac{1}{\sum_{j=1}^K G_{kj}}$$
 
 
144
 
145
  The dynamic weights are then re-balanced and normalized:
146
 
147
- $$\tilde{w}_k = \frac{w_k U_k}{\sum_{j=1}^K w_j U_j}$$
 
 
148
 
149
  This prevents dataset overlap from suppressing distinct algorithmic representations.
150
 
@@ -153,82 +178,112 @@ This prevents dataset overlap from suppressing distinct algorithmic representati
153
  Qwen 3.5 9B features asymmetric head ratios in both its linear attention and full attention layers. Standard fused tensor merging causes cross-head pollution by treating routing projections identically to memory projections.
154
 
155
  Fused projection tensors are sliced into their functional sub-matrices prior to merging:
156
- - **Gated DeltaNet Layers ($8192 \times d_{\text{model}}$):** Sliced into Query ($2048$), Key ($2048$), and Value ($4096$).
157
- - **Gated Attention Layers ($6144 \times d_{\text{model}}$):** Sliced into Query ($4096$), Key ($1024$), and Value ($1024$).
158
 
159
- Query and Key slices are processed with a conservative retention density ($\rho = 0.95$) to preserve sharp context routing. Value matrices are processed with adaptive MLP density ($\rho = 0.70$) to maximize conceptual synthesis. The components are then re-concatenated along the head dimension.
160
 
161
  ### 5. Neuron-Coherent Row Gating
162
 
163
  To eliminate destructive interference in Feed-Forward Networks (MLPs), task vectors are gated at the single-neuron (row) level:
164
 
165
- $$\bar{\tau} = \frac{1}{K} \sum_{k=1}^K \tau_k$$
 
 
166
 
167
- For each row $r$ of donor delta $\tau_k$, the directional alignment with the consensus mean is evaluated:
168
 
169
- $$\cos \theta_{k, r} = \frac{\langle \tau_{k, r}, \bar{\tau}_r \rangle}{\|\tau_{k, r}\|_2 \|\bar{\tau}_r\|_2 + \epsilon}$$
 
 
170
 
171
- Rows exhibiting severe directional opposition ($\cos \theta_{k, r} < -0.10$) are masked out:
172
 
173
- $$\hat{\tau}_{k, r} = \tau_{k, r} \cdot \mathbb{I}\left(\cos \theta_{k, r} \ge -0.10\right)$$
 
 
174
 
175
  This eliminates opposing gradient vectors that produce incoherent syntax generation.
176
 
177
  ### 6. Heavy-Tailed DELLA Adaptive Rescaling
178
 
179
- Surviving parameters undergo non-linear magnitude-based sampling. Using parameter rank indices $R_{k, ij} \in [0, 1]$ sorted by absolute magnitude, a Pareto-style retention probability $p_{k, ij}$ is established:
180
 
181
- $$p_{k, ij} = p_{\min} + (p_{\max} - p_{\min}) \cdot \sqrt{R_{k, ij}}$$
 
 
182
 
183
  Parameters are sampled via a Bernoulli trial and rescaled by their inverse survival probability:
184
 
185
- $$M_{k, ij} \sim \text{Bernoulli}(p_{k, ij})$$
 
 
186
 
187
- $$\tilde{\tau}_{k, ij} = \frac{\hat{\tau}_{k, ij} \odot M_{k, ij}}{p_{k, ij}}$$
 
 
188
 
189
  ### 7. Coordinate-Wise Sign Consensus & Model Stock Scaling
190
 
191
  Directional consensus is determined via weighted sign agreement:
192
 
193
- $$\Gamma = \operatorname{sgn}\left(\sum_{k=1}^K \tilde{w}_k \tilde{\tau}_k\right)$$
 
 
194
 
195
- $$A_k = \mathbb{I}\left(\operatorname{sgn}(\tilde{\tau}_k) = \Gamma\right) \odot \mathbb{I}\left(\tilde{\tau}_k \neq 0\right)$$
 
 
196
 
197
- $$\Delta_{\text{consensus}} = \frac{\sum_{k=1}^K \tilde{\tau}_k \odot A_k}{\sum_{k=1}^K A_k + \epsilon}$$
 
 
198
 
199
- The aggregated delta is projected onto the non-linear manifold using the Model Stock analytic scaling factor $t^*$:
200
 
201
- $$\bar{\rho} = \frac{2}{K(K-1)} \sum_{i < j} \frac{\langle \text{vec}(\tau_i), \text{vec}(\tau_j) \rangle}{\|\tau_i\|_2 \|\tau_j\|_2}$$
 
 
202
 
203
- $$t^* = \frac{K \bar{\rho}}{1 + (K - 1)\bar{\rho}}$$
 
 
204
 
205
- $$\Delta_{\text{final}} = t^* \cdot \Delta_{\text{consensus}}$$
 
 
206
 
207
  ### 8. Spectral Norm & Attention Entropy Anchoring
208
 
209
- Attention projection matrices ($W_{\text{attn}}$) are vulnerable to spectral explosion during merges, which contracts attention entropy and leads to repetitive generation loops.
210
 
211
- The dominant singular value $\sigma(W)$ is calculated via a three-iteration deterministic power iteration:
212
 
213
- $$v^{(t+1)} = \frac{W^T u^{(t)}}{\|W^T u^{(t)}\|_2}, \quad u^{(t+1)} = \frac{W v^{(t+1)}}{\|W v^{(t+1)}\|_2}$$
 
 
214
 
215
- $$\sigma(W) \approx {u^{(3)}}^T W v^{(3)}$$
 
 
216
 
217
  If the merged spectral radius grows more than 5% relative to the base model, it is scaled down:
218
 
219
- $$W_{\text{final}} = \begin{cases} W_{\text{merged}} \cdot \left(\frac{1.05 \cdot \sigma(W_0)}{\sigma(W_{\text{merged}})}\right) & \text{if } \sigma(W_{\text{merged}}) > 1.05 \cdot \sigma(W_0) \\ W_{\text{merged}} & \text{otherwise} \end{cases}$$
 
 
220
 
221
  ---
222
 
223
  ## Layer-Stratified Component Policies
224
 
225
- | Parameter Class | Target Identifiers | Applied Policy | Density ($\rho$) | Mathematical Constraints |
226
  | :--- | :--- | :---: | :---: | :--- |
227
  | **Embeddings & LM Head** | `embed_tokens`, `lm_head` | Low-Memory Streaming Blend | 1.0 | Convex iterative accumulation; vocab dimension aligned to 248,320. |
228
  | **Linear State-Space Projections** | `linear_attn.in_proj_qkv` | Asymmetric GQA DELLA | 0.95 (QK) / 0.70 (V) | Sub-tensor slicing; separate routing and associative memory passes. |
229
- | **Self-Attention Projections** | `self_attn.qkv_proj`, `o_proj` | Asymmetric GQA + Spectral Anchor | 0.95 (QK) / 0.70 (V) | Power-iteration clipping prevents $\sigma > 1.05 \sigma_0$. |
230
- | **Feed-Forward Blocks** | `mlp.gate_proj`, `up_proj`, `down_proj` | Neuron-Gated HG-DELLA | 0.50 – 0.70 | Row-wise cosine filtering ($\cos \theta \ge -0.10$); sign consensus. |
231
- | **Recurrent Gates & Normalization** | `A_log`, `norm`, `conv1d` | Convex Parameter Blend | 1.0 | Preservation of $A_{\text{log}} \le 0$ to guarantee BIBO stability. |
232
 
233
  ---
234
 
 
33
 
34
  <div align="center">
35
 
36
+ # PentaCoder-9B
37
+
38
+ **Frontier-Calibrated 9B Hybrid Gated DeltaNet Causal Engine for Autonomous Software Engineering**
39
+
40
  [![License](https://img.shields.io/badge/License-Apache%202.0-6E56CF?style=for-the-badge)](https://opensource.org/licenses/Apache-2.0)
41
  [![Library](https://img.shields.io/badge/Library-transformers-FFD21E?style=for-the-badge&logo=huggingface&logoColor=black)](https://github.com/huggingface/transformers)
42
  [![Merge Method](https://img.shields.io/badge/Merge%20Method-GeoDELLA--HG-27AE60?style=for-the-badge)](#merge-methodology--mathematical-formulation)
 
58
 
59
  > [!IMPORTANT]
60
  > The result is a lean, blisteringly fast 9B pure-text causal engine with a native **256k context window** that runs comfortably on consumer GPUs.
61
+
62
  ---
63
 
64
  ### Contents
 
80
  | :--- | :---: |
81
  | **Total Parameters** | 8.8B (Pure Text Backbone) |
82
  | **Architecture Type** | Hybrid Recurrent-Attention Causal LM (`qwen3_5_text`) |
83
+ | **Hidden Dimension** (*d*<sub>model</sub>) | 4096 |
84
+ | **Intermediate Dimension** (*d*<sub>mlp</sub>) | 12288 (SwiGLU) |
85
  | **Decoder Layers** | 32 |
86
+ | **Attention Layout** | 8 Blocks × (3 Gated DeltaNet Linear Layers : 1 Gated Softmax Layer) |
87
  | **Full Attention Layers** | Layers 3, 7, 11, 15, 19, 23, 27, 31 |
88
+ | **Linear Attention Configuration** | 16 Key Heads / 32 Value Heads (*d*<sub>k</sub> = *d*<sub>v</sub> = 128) |
89
+ | **Full Attention Configuration** | 16 Query Heads / 4 Key-Value Heads (GQA, *d*<sub>h</sub> = 256) |
90
+ | **Rotary Position Embedding (RoPE)** | 1D Partial RoPE (θ = 10⁷, Factor = 0.25 → 64 dimensions) |
91
  | **Context Window Length** | 262,144 tokens (256k) |
92
  | **Native Precision** | `bfloat16` |
93
  | **Vocabulary Size** | 248,320 (Padded for Fill-In-The-Middle and Tool Tokens) |
 
96
 
97
  ## Composition & Donor Weighting
98
 
99
+ The foundational weights of [Qwen/Qwen3.5-9B](https://huggingface.co/Qwen/Qwen3.5-9B) serve as the shared topological base (*W*₀). Five specialized donor checkpoints provide non-overlapping task vectors mapped across normalized layer depth *u* ∈ [0, 1]:
100
 
101
  | Model | Primary Focus | Depth Target |
102
  | :--- | :--- | :---: |
103
+ | [Qwen/Qwen3.5-9B](https://huggingface.co/Qwen/Qwen3.5-9B) | Base pre-trained manifold and state-space anchors | Global (*W*₀) |
104
  | [empero-ai/Qwen3.8-9B-Distill](https://huggingface.co/empero-ai/Qwen3.8-9B-Distill) | Abstract token synthesis, reasoning structure, syntax | Lower & Mid Decoders |
105
  | [Jackrong/Qwopus3.5-9B-Coder](https://huggingface.co/Jackrong/Qwopus3.5-9B-Coder) | Typing discipline, algorithm design, functional purity | Mid Decoders (Bell Curve) |
106
  | [ornith-ai/Ornith-1.5-9B](https://huggingface.co/ornith-ai/Ornith-1.5-9B) | Circuit-breaker recovery, environment feedback integration | Upper-Mid Decoders |
 
115
 
116
  ### 1. Task Vector Formulation
117
 
118
+ For each donor checkpoint *k* ∈ {1, ..., 5}, the parameter update delta τ<sub>*k*</sub> is computed relative to the base anchor *W*₀:
119
 
120
+ $$
121
+ \tau_k = D_k - W_0, \quad k \in \{\text{Qwen3.8}, \text{Qwopus}, \text{Ornith}, \text{OxCoder}, \text{MiMo}\}
122
+ $$
123
 
124
  ### 2. Hybrid-Aware Continuous Depth Modulation
125
 
126
+ Task vector mixing coefficients are continuously modulated over normalized depth *u* = *l* / (*L* - 1), where *l* ∈ [0, 31] and *L* = 32:
127
 
128
+ $$
129
+ u_{\text{qwen38}}(u) = 0.15 + 0.35 \cos^2\left(\frac{\pi}{2} u\right) + 0.15 \sin^2(\pi u)
130
+ $$
131
 
132
+ $$
133
+ u_{\text{qwopus}}(u) = 0.05 + 0.35 \sin^2(\pi u)
134
+ $$
135
 
136
+ $$
137
+ u_{\text{ornith}}(u) = 0.05 + 0.35 \sin^2\left(\frac{\pi}{2} u\right)
138
+ $$
139
 
140
+ $$
141
+ u_{\text{oxcoder}}(u) = 0.05 + 0.25 \sin^2\left(\frac{\pi}{2} u\right)
142
+ $$
143
 
144
+ $$
145
+ u_{\text{mimo}}(u) = 0.05 + 0.15 \sin(\pi u)
146
+ $$
147
 
148
+ The initial coefficients are normalized to form a partition of unity across all layers:
149
 
150
+ $$
151
+ w_k(l) = \frac{u_k(u)}{\sum_{j=1}^5 u_j(u)}, \quad \sum_{k=1}^5 w_k(l) = 1.0
152
+ $$
153
 
154
  ### 3. Dynamic Gram-Matrix Task De-Biasing
155
 
156
+ Fine-tuned models frequently share underlying distillation datasets, leading to collinearity that can drown out specialized task vectors. To correct for this over-representation, the empirical Gram correlation matrix *G* ∈ ℝ<sup>*K* × *K*</sup> is evaluated per tensor:
157
 
158
+ $$
159
+ G_{ij} = \frac{|\langle \text{vec}(\tau_i), \text{vec}(\tau_j) \rangle|}{\|\tau_i\|_2 \|\tau_j\|_2}
160
+ $$
161
 
162
+ A uniqueness coefficient *U*<sub>*k*</sub> is derived from the inverse column sum of task vector correlations:
163
 
164
+ $$
165
+ U_k = \frac{1}{\sum_{j=1}^K G_{kj}}
166
+ $$
167
 
168
  The dynamic weights are then re-balanced and normalized:
169
 
170
+ $$
171
+ \tilde{w}_k = \frac{w_k U_k}{\sum_{j=1}^K w_j U_j}
172
+ $$
173
 
174
  This prevents dataset overlap from suppressing distinct algorithmic representations.
175
 
 
178
  Qwen 3.5 9B features asymmetric head ratios in both its linear attention and full attention layers. Standard fused tensor merging causes cross-head pollution by treating routing projections identically to memory projections.
179
 
180
  Fused projection tensors are sliced into their functional sub-matrices prior to merging:
181
+ - **Gated DeltaNet Layers (8192 × *d*<sub>model</sub>):** Sliced into Query (2048), Key (2048), and Value (4096).
182
+ - **Gated Attention Layers (6144 × *d*<sub>model</sub>):** Sliced into Query (4096), Key (1024), and Value (1024).
183
 
184
+ Query and Key slices are processed with a conservative retention density (ρ = 0.95) to preserve sharp context routing. Value matrices are processed with adaptive MLP density (ρ = 0.70) to maximize conceptual synthesis. The components are then re-concatenated along the head dimension.
185
 
186
  ### 5. Neuron-Coherent Row Gating
187
 
188
  To eliminate destructive interference in Feed-Forward Networks (MLPs), task vectors are gated at the single-neuron (row) level:
189
 
190
+ $$
191
+ \bar{\tau} = \frac{1}{K} \sum_{k=1}^K \tau_k
192
+ $$
193
 
194
+ For each row *r* of donor delta τ<sub>*k*</sub>, the directional alignment with the consensus mean is evaluated:
195
 
196
+ $$
197
+ \cos \theta_{k, r} = \frac{\langle \tau_{k, r}, \bar{\tau}_r \rangle}{\|\tau_{k, r}\|_2 \|\bar{\tau}_r\|_2 + \epsilon}
198
+ $$
199
 
200
+ Rows exhibiting severe directional opposition (cos θ<sub>*k*, *r*</sub> < -0.10) are masked out:
201
 
202
+ $$
203
+ \hat{\tau}_{k, r} = \tau_{k, r} \cdot \mathbb{I}\left(\cos \theta_{k, r} \ge -0.10\right)
204
+ $$
205
 
206
  This eliminates opposing gradient vectors that produce incoherent syntax generation.
207
 
208
  ### 6. Heavy-Tailed DELLA Adaptive Rescaling
209
 
210
+ Surviving parameters undergo non-linear magnitude-based sampling. Using parameter rank indices *R*<sub>*k*, *ij*</sub> ∈ [0, 1] sorted by absolute magnitude, a Pareto-style retention probability *p*<sub>*k*, *ij*</sub> is established:
211
 
212
+ $$
213
+ p_{k, ij} = p_{\min} + (p_{\max} - p_{\min}) \cdot \sqrt{R_{k, ij}}
214
+ $$
215
 
216
  Parameters are sampled via a Bernoulli trial and rescaled by their inverse survival probability:
217
 
218
+ $$
219
+ M_{k, ij} \sim \text{Bernoulli}(p_{k, ij})
220
+ $$
221
 
222
+ $$
223
+ \tilde{\tau}_{k, ij} = \frac{\hat{\tau}_{k, ij} \odot M_{k, ij}}{p_{k, ij}}
224
+ $$
225
 
226
  ### 7. Coordinate-Wise Sign Consensus & Model Stock Scaling
227
 
228
  Directional consensus is determined via weighted sign agreement:
229
 
230
+ $$
231
+ \Gamma = \operatorname{sgn}\left(\sum_{k=1}^K \tilde{w}_k \tilde{\tau}_k\right)
232
+ $$
233
 
234
+ $$
235
+ A_k = \mathbb{I}\left(\operatorname{sgn}(\tilde{\tau}_k) = \Gamma\right) \odot \mathbb{I}\left(\tilde{\tau}_k \neq 0\right)
236
+ $$
237
 
238
+ $$
239
+ \Delta_{\text{consensus}} = \frac{\sum_{k=1}^K \tilde{\tau}_k \odot A_k}{\sum_{k=1}^K A_k + \epsilon}
240
+ $$
241
 
242
+ The aggregated delta is projected onto the non-linear manifold using the Model Stock analytic scaling factor *t*<sup>*</sup>:
243
 
244
+ $$
245
+ \bar{\rho} = \frac{2}{K(K-1)} \sum_{i < j} \frac{\langle \text{vec}(\tau_i), \text{vec}(\tau_j) \rangle}{\|\tau_i\|_2 \|\tau_j\|_2}
246
+ $$
247
 
248
+ $$
249
+ t^* = \frac{K \bar{\rho}}{1 + (K - 1)\bar{\rho}}
250
+ $$
251
 
252
+ $$
253
+ \Delta_{\text{final}} = t^* \cdot \Delta_{\text{consensus}}
254
+ $$
255
 
256
  ### 8. Spectral Norm & Attention Entropy Anchoring
257
 
258
+ Attention projection matrices (*W*<sub>attn</sub>) are vulnerable to spectral explosion during merges, which contracts attention entropy and leads to repetitive generation loops.
259
 
260
+ The dominant singular value σ(*W*) is calculated via a three-iteration deterministic power iteration:
261
 
262
+ $$
263
+ v^{(t+1)} = \frac{W^T u^{(t)}}{\|W^T u^{(t)}\|_2}, \quad u^{(t+1)} = \frac{W v^{(t+1)}}{\|W v^{(t+1)}\|_2}
264
+ $$
265
 
266
+ $$
267
+ \sigma(W) \approx {u^{(3)}}^T W v^{(3)}
268
+ $$
269
 
270
  If the merged spectral radius grows more than 5% relative to the base model, it is scaled down:
271
 
272
+ $$
273
+ W_{\text{final}} = \begin{cases} W_{\text{merged}} \cdot \left(\frac{1.05 \cdot \sigma(W_0)}{\sigma(W_{\text{merged}})}\right) & \text{if } \sigma(W_{\text{merged}}) > 1.05 \cdot \sigma(W_0) \\ W_{\text{merged}} & \text{otherwise} \end{cases}
274
+ $$
275
 
276
  ---
277
 
278
  ## Layer-Stratified Component Policies
279
 
280
+ | Parameter Class | Target Identifiers | Applied Policy | Density (ρ) | Mathematical Constraints |
281
  | :--- | :--- | :---: | :---: | :--- |
282
  | **Embeddings & LM Head** | `embed_tokens`, `lm_head` | Low-Memory Streaming Blend | 1.0 | Convex iterative accumulation; vocab dimension aligned to 248,320. |
283
  | **Linear State-Space Projections** | `linear_attn.in_proj_qkv` | Asymmetric GQA DELLA | 0.95 (QK) / 0.70 (V) | Sub-tensor slicing; separate routing and associative memory passes. |
284
+ | **Self-Attention Projections** | `self_attn.qkv_proj`, `o_proj` | Asymmetric GQA + Spectral Anchor | 0.95 (QK) / 0.70 (V) | Power-iteration clipping prevents σ > 1.05 σ₀. |
285
+ | **Feed-Forward Blocks** | `mlp.gate_proj`, `up_proj`, `down_proj` | Neuron-Gated HG-DELLA | 0.50 – 0.70 | Row-wise cosine filtering (cos θ ≥ -0.10); sign consensus. |
286
+ | **Recurrent Gates & Normalization** | `A_log`, `norm`, `conv1d` | Convex Parameter Blend | 1.0 | Preservation of *A*<sub>log</sub> ≤ 0 to guarantee BIBO stability. |
287
 
288
  ---
289