Skip to content

Paper §3.4: Qwen3.5 attention scarcity — why plasticity works so well - #596

Merged
joelteply merged 1 commit into
mainfrom
docs/paper-qwen-attention-scarcity
Mar 30, 2026
Merged

joelteply merged 1 commit into
mainfrom
docs/paper-qwen-attention-scarcity

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Addition

New section explaining why Qwen3.5 shows outsized improvements from experiential plasticity:

  • Hybrid attention/linear architecture means attention heads are scarce (16 of 64 layers)
  • Pruning has disproportionate impact — each head matters more
  • Surviving heads specialize harder under gradient pressure
  • Linear (Mamba) layers provide safety net during reorganization
  • Context rot (known Qwen3.5 issue) may be partially mitigated by sharper surviving attention patterns
  • Prediction: hybrid architectures will consistently show larger plasticity gains

Also adds HumanEval verification (~70%+ pass@1 at 2.6GB GGUF).

Inspired by @spiritbuun's observation about Qwen3.5's context rot from few attention layers.

…carcity hypothesis

Hybrid attention/linear architecture means attention heads are scarce.
Pruning has outsized impact because surviving heads must compensate harder.
Explains +24% on 4B. Adds HumanEval verification (~70%+ pass@1).
Predicts hybrid architectures will show larger plasticity gains.
Copilot AI review requested due to automatic review settings March 30, 2026 01:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new discussion to the Experiential Plasticity paper explaining why Qwen3.5’s hybrid attention/linear architecture may yield outsized gains from pruning-and-retraining, and includes a brief HumanEval performance claim for the forged 4B model.

Changes:

  • Adds a “HumanEval verification” performance note for the forged Qwen3.5-4B model.
  • Introduces a new section explaining the “attention scarcity” hypothesis for stronger plasticity gains on Qwen3.5 hybrid architectures.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +98 to +99
**HumanEval verification**: The forged 4B model scores **~70%+ pass@1 on HumanEval** (164 problems, greedy decoding), competitive with dedicated coder models at 2-3x the parameter count (Qwen2.5-Coder-3B: 66%, Phi-3-mini: 62%). At 2.6GB GGUF (Q4_K_M), this runs on iPhone and Raspberry Pi.

Copilot AI Mar 30, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The HumanEval result is presented as a headline verification, but the paper’s Reproduction section doesn’t include how to run this benchmark (harness/version, prompt, max tokens, stop conditions, and exact command). Please add enough detail (or a link to a script/run artifact) so this ~70%+ pass@1 claim is reproducible.

Copilot uses AI. Check for mistakes.

Qwen3.5's architecture uses a hybrid of full self-attention layers and linear attention (Mamba-style) layers. Only a fraction of layers (16 of 64 in the 27B) use traditional multi-head attention — the rest use linear recurrence that cannot be pruned in the same way. This architectural choice creates an important dynamic for experiential plasticity:

1. **Attention is scarce**: With few attention layers, each head carries disproportionate weight. Pruning a low-value head in a model with 64 attention layers loses ~1.5% of attention capacity. In Qwen3.5-27B with 16 attention layers, pruning the same head loses ~6%. The remaining heads must compensate harder.

Copilot AI Mar 30, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The capacity math in bullet (1) mixes “heads” and “attention layers”: pruning a single head is not equivalent to removing 1/64 of attention capacity unless you define capacity purely by attention-layer count. Please clarify the unit being pruned (head vs layer) and base the percentage on (num_attention_layers × heads_per_layer) if you’re talking about head pruning.

Suggested change
1. **Attention is scarce**: With few attention layers, each head carries disproportionate weight. Pruning a low-value head in a model with 64 attention layers loses ~1.5% of attention capacity. In Qwen3.5-27B with 16 attention layers, pruning the same head loses ~6%. The remaining heads must compensate harder.
1. **Attention is scarce**: With few attention layers, each *attention head* carries disproportionate weight. Suppose a baseline transformer has 64 attention layers, each with \(H\) heads, for a total of \(64 \cdot H\) heads. Pruning a single low-value head there removes \(1 / (64 \cdot H)\) of total head capacity. In Qwen3.5-27B, only 16 of 64 layers have multi-head attention, so the same head represents \(1 / (16 \cdot H)\) of capacity — a 4× larger fraction. The remaining heads must compensate harder.

Copilot uses AI. Check for mistakes.

2. **Compensation drives specialization**: When retraining after pruning, the surviving attention heads experience stronger gradient pressure — they must handle the work of the removed heads. This pressure, combined with domain-specific training data, drives the heads to specialize more aggressively than in architectures with abundant attention.

3. **Context rot mitigation**: Qwen3.5's limited attention layers are known to cause "context rot" — degraded instruction following as context grows beyond ~9-15K tokens (observed independently by practitioners). By pruning low-entropy heads and retraining, the surviving heads develop sharper attention patterns, potentially improving context utilization within the model's effective window.

Copilot AI Mar 30, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The “context rot” claim is stated as a known architectural issue, but there’s no citation or pointer to a tracked issue/benchmark showing the ~9–15K degradation range. Please add a reference (paper/blog/issue thread) or rephrase to make clear it’s an anecdotal observation from specific evaluations.

Suggested change
3. **Context rot mitigation**: Qwen3.5's limited attention layers are known to cause "context rot" — degraded instruction following as context grows beyond ~9-15K tokens (observed independently by practitioners). By pruning low-entropy heads and retraining, the surviving heads develop sharper attention patterns, potentially improving context utilization within the model's effective window.
3. **Context rot mitigation**: In our own informal evaluations, and in anecdotal reports from other practitioners, Qwen3.5's limited attention layers have been associated with "context rot" — degraded instruction following as context grows beyond roughly 9–15K tokens. By pruning low-entropy heads and retraining, the surviving heads develop sharper attention patterns, potentially improving context utilization within the model's effective window.

Copilot uses AI. Check for mistakes.

**HumanEval verification**: The forged 4B model scores **~70%+ pass@1 on HumanEval** (164 problems, greedy decoding), competitive with dedicated coder models at 2-3x the parameter count (Qwen2.5-Coder-3B: 66%, Phi-3-mini: 62%). At 2.6GB GGUF (Q4_K_M), this runs on iPhone and Raspberry Pi.

### 3.4 Why Qwen3.5 Responds Strongly to Plasticity

Copilot AI Mar 30, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Section numbering is now duplicated: this new heading is "### 3.4", but later in the document there is already a "### 3.4 Cross-Architecture Validation" section. Please renumber one of them (and adjust any internal references) to keep section numbers unique and ordered.

Suggested change
### 3.4 Why Qwen3.5 Responds Strongly to Plasticity
### Why Qwen3.5 Responds Strongly to Plasticity

Copilot uses AI. Check for mistakes.
@joelteply
joelteply merged commit a36c81f into main Mar 30, 2026
6 of 7 checks passed
@joelteply
joelteply deleted the docs/paper-qwen-attention-scarcity branch March 30, 2026 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants