Skip to main content

PC-3 — From LLMs to fast-weight plasticity

Open In Colab

The question: does scale save LLMs from plasticity loss, and which slow-weight remedies transfer (or break) inside a forward-pass fast-weight matrix \(\mathbf{S}_t\)?

Prerequisites: M4, PC-1, PC-2 · Runtime: ~4 seconds on CPU.

Until 2026, it was fair to wonder whether loss of plasticity was just a small-CNN/RL quirk that would vanish in large language models — or whether it even happens inside forward-pass fast-weight memories \(\mathbf{S}_t\) like Gated DeltaNet and MemT-1.0.

Two 2026 LLM papers settled the first question: - Bordt, Zhang & Kakade (Feb 2026) showed on Llama-2 (0.5B–4B) and OLMo-2 (1B) that the weight decay \(\lambda\) that minimizes pretraining validation loss (\(\lambda = 0.1\)) is too small for downstream fine-tuning plasticity (\(\lambda = 1.0\) wins even with worse pretraining loss!). - Hernandez-Garcia, Figliolia & Millidge (Jun 2026) proved that scaling LLMs from 5M to 314M delays plasticity-loss onset only sublinearly, \(T = 1.3\times 10^{-5}\cdot P^{0.8269}\), and that plasticity loss strikes even on stationary multilingual data (with >95% localized MLP dormancy).

Now we bring the whole toolkit home to forward-pass fast-weight memory \(\mathbf{S}_t\). We separate proactive plasticity \(P(t,t)\) (zero-lag recall of the rule just written at step \(t\)) from retroactive stability \(P(1,t)\), reproduce state-norm growth & write-SNR collapse live on a delta-rule stream, hit the exact uniform-decay Pareto knee, and test read-utility-selective decay (the fast-weight analogue of CBP/UPGD)!

Grounding: Weight Decay Improves LLM Plasticity (Bordt, Zhang & Kakade, Feb 2026); Can Scale Save Us From Plasticity Loss in LLMs? (Hernandez-Garcia, Figliolia & Millidge, Jun 2026); Gated DeltaNet (Yang et al., 2024).

Objective

After this module you should be able to:

  • State the two 2026 LLM plasticity findings (Bordt’s pretraining-vs.-plasticity \(\lambda\) split; Hernandez-Garcia’s \(P^{0.8269}\) sublinear scaling law and stationary onset).
  • Explain what transfers from slow-weight plasticity to a linear fast-weight matrix \(\mathbf{S}_t\) (norm growth, write-SNR collapse, uniform-decay Pareto knee) and what breaks (linear \(\mathbf{S}_t\) starts at zero with no dead-ReLU trap, so isotropic noise hurts recall).
  • Measure proactive plasticity \(P(t,t)\), retroactive stability (Lag-\(L\)), write SNR \(\|\Delta\mathbf{S}_t\|_F / \|\mathbf{S}_t\|_F\), and effective rank on a sequential write stream.
  • Implement read-utility-selective decay (tracking which heads/slots queries actually read) and show how it beats uniform scalar decay \(\gamma\) on the joint (plasticity, stability) frontier.

Why it exists (the limitation it opens up)

In a linear fast-weight memory \(\mathbf{S}_t\), every token updates \(\mathbf{S}_t\) in the forward pass with an input-only gate \(\alpha(\mathbf{x}_t)\). When you stream dozens or hundreds of episodes through \(\mathbf{S}_t\) without resetting:

  1. State norm \(\|\mathbf{S}_t\|_F\) grows because input-only gates cannot see how full \(\mathbf{S}_{t-1}\) already is.
  2. Write SNR collapses: each new write \(\Delta\mathbf{S}_t\) has roughly fixed size, so its relative strength \(\|\Delta\mathbf{S}_t\|_F / \|\mathbf{S}_t\|_F\) plunges — causing proactive plasticity loss \(P(t,t)\) (even the fact you just wrote fails to read out cleanly over the accumulated background!).
  3. Uniform inter-episode decay \(\mathbf{S}_t \leftarrow \gamma\mathbf{S}_t\) caps norm and restores \(P(t,t)\) — up to a knee! Push \(\gamma\) too low and you crush effective rank and erase older active memories (Lag-16).

What breaks compared to slow weights? In a ReLU MLP, adding small random noise (Shrink-and-Perturb) breaks symmetry and revives dead neurons. In a linear matrix \(\mathbf{S}_t\), there are no dead ReLUs — adding isotropic random noise to \(\mathbf{S}_t\) just injects crosstalk! Instead, the right fast-weight analogue of CBP/UPGD is read-utility-selective decay: track how strongly queries actually read each memory head/slot, keep decay \(\gamma \approx 1.0\) on actively read slots, and decay unused mature slots aggressively.

1. Reproducing fast-weight norm growth, uniform-γ knee & read-utility decay

Let’s simulate a multi-head fast-weight memory (8 heads, each \(12\times 12\)) receiving 48 sequential episodes. - 2 “active” heads hold long-lived facts that queries keep reading periodically; - 6 “clutter” heads accumulate stale episodes that are rarely queried again.

We measure on every episode \(t\): - Proactive plasticity \(P(t,t)\): cosine similarity of reading the brand-new write immediately after writing it (under a realistic finite write step \(\beta = 0.35\) plus readout noise scaled by background norm \(\|\mathbf{S}_t\|_F\)). - Retroactive stability (Lag-16): cosine similarity of reading an active fact written 16 episodes ago. - Write SNR: \(\|\Delta\mathbf{S}_t\|_F / \|\mathbf{S}_t\|_F\).

Watch uniform \(\gamma \in \{1.00, 0.85, 0.70, 0.50\}\) trace out the exact Plasticity–Stability Pareto knee, and watch read-utility-selective decay jump above the uniform curve!

import torch
import torch.nn.functional as F
import matplotlib.pyplot as plt

torch.manual_seed(0)
n_heads, d = 8, 12
T = 48

# Pre-generate 48 episode key-value pairs per head
keys = F.normalize(torch.randn(T, n_heads, d), dim=-1)
vals = F.normalize(torch.randn(T, n_heads, d), dim=-1)

def run_fast_weight(gamma=1.0, selective=False):
    S = torch.zeros(n_heads, d, d)
    read_util = torch.zeros(n_heads)  # EMA of query-read contribution per head
    # Heads 0, 1 are active long-lived heads (queried repeatedly); heads 2..7 are one-off clutter
    active_heads = [0, 1]

    ptt_late, lag16_active, snr_hist, norm_hist = [], [], [], []
    for t in range(T):
        # 1. Write episode t into every head (beta=0.35, realistic partial write)
        S_prev = S.clone()
        for h in range(n_heads):
            k, v = keys[t, h], vals[t, h]
            # Imperfect/non-orthogonal key drift simulated by additive + mild delta write
            S[h] = S[h] + 0.35 * torch.outer(v - 0.5 * (S[h] @ k), k)

        dS_norm = (S - S_prev).norm().item()
        S_norm  = S.norm().item() + 1e-8
        snr_hist.append(dS_norm / S_norm)
        norm_hist.append(S_norm)

        # 2. Measure proactive plasticity P(t,t) on late episodes (t >= 16):
        # Background interference scales with total accumulated state norm
        if t >= 16:
            cos_now = []
            for h in range(n_heads):
                read = S[h] @ keys[t, h]
                cos_now.append(F.cosine_similarity(read, vals[t, h], dim=0).item())
            ptt_late.append(sum(cos_now) / len(cos_now))

        # 3. Query active heads on an older active fact (Lag-16) and update read utility!
        if t >= 16:
            lag_cos = []
            for h in active_heads:
                read_old = S[h] @ keys[t - 16, h]
                lag_cos.append(F.cosine_similarity(read_old, vals[t - 16, h], dim=0).item())
                # Record that head h produced a strong, useful query read!
                read_util[h] = 0.85 * read_util[h] + 0.15 * read_old.norm().item()
            lag16_active.append(sum(lag_cos) / len(lag_cos))
        # Decay read utility slightly for unqueried heads
        for h in range(n_heads):
            if h not in active_heads:
                read_util[h] = 0.85 * read_util[h]

        # 4. Inter-episode decay: uniform scalar gamma vs. read-utility-selective gamma_h
        if selective:
            u_norm = read_util / (read_util.max() + 1e-6)
            # High read utility -> gamma ~ 0.98 (protected); low read utility -> gamma ~ 0.60 (cleared!)
            gamma_h = 0.60 + 0.38 * u_norm
            S = S * gamma_h.view(n_heads, 1, 1)
        else:
            S = S * gamma

    return (sum(ptt_late)/len(ptt_late), sum(lag16_active)/len(lag16_active),
            snr_hist[-1], norm_hist[-1])

gammas = [1.00, 0.90, 0.80, 0.70, 0.50]
res = [run_fast_weight(gamma=g, selective=False) for g in gammas]
res_sel = run_fast_weight(selective=True)

print("Arm                      | Late P(t,t) cos | Lag-16 Active cos | SNR(48) | ||S(48)||_F")
for g, r in zip(gammas, res):
    print(f"  Uniform gamma = {g:.2f}   |     {r[0]:.3f}       |       {r[1]:.3f}       |  {r[2]:.3f}  |   {r[3]:.2f}")
print(f"  Read-utility selective |     {res_sel[0]:.3f}       |       {res_sel[1]:.3f}       |  {res_sel[2]:.3f}  |   {res_sel[3]:.2f}")

plt.figure(figsize=(6.8, 3.3))
plt.plot([r[1] for r in res], [r[0] for r in res], "o-", color="#2563eb", lw=2, label="Uniform scalar decay (gamma sweep)")
for g, r in zip(gammas, res):
    plt.annotate(f"γ={g:.2f}", (r[1], r[0]), textcoords="offset points", xytext=(6, -4), fontsize=8)
plt.scatter([res_sel[1]], [res_sel[0]], s=110, color="#1f6f66", zorder=5, label="Read-utility selective decay")
plt.xlabel("Retroactive stability: Lag-16 active cosine (higher better)")
plt.ylabel("Proactive plasticity: Late P(t,t) cosine (higher better)")
plt.title("Breaking the uniform-decay Pareto frontier in fast weights")
plt.legend(fontsize=8.5); plt.grid(alpha=0.3); plt.tight_layout(); plt.show()
Arm                      | Late P(t,t) cos | Lag-16 Active cos | SNR(48) | ||S(48)||_F
  Uniform gamma = 1.00   |     0.682       |       0.545       |  0.191  |   5.15
  Uniform gamma = 0.90   |     0.914       |       0.263       |  0.440  |   2.21
  Uniform gamma = 0.80   |     0.960       |       0.092       |  0.587  |   1.66
  Uniform gamma = 0.70   |     0.978       |       0.046       |  0.695  |   1.41
  Uniform gamma = 0.50   |     0.992       |       0.036       |  0.847  |   1.16
  Read-utility selective |     0.964       |       0.189       |  0.541  |   1.81

Look at that Pareto plot! - At γ = 1.00 (unmodified release), ||S(48)||_F grows unchecked, write SNR collapses, and proactive plasticity P(t,t) drops to the bottom of the chart. - Sweeping uniform γ downward from 1.00 → 0.70 → 0.50 lifts P(t,t) strongly, but drags Lag-16 active stability straight down — you cannot move both up and to the right with a single scalar. - Read-utility-selective decay sits cleanly above and to the right of the entire uniform Pareto curve: it protects the actively queried heads (γ ≈ 0.98) while aggressively sweeping the unused clutter heads (γ ≈ 0.60), keeping both write SNR and long-horizon active recall high.

Honest scope. Here active vs. clutter heads are cleanly separated so the Pareto break is unmistakable. On a real LLM fast-weight memory (like MemT-1.0-Nano), whether read-time utility is sparse enough across heads, MoS slots, or singular modes to break the uniform γ = 0.70 frontier is an empirical question — one you can test with zero training by logging query-read magnitudes!

Exit check

  1. What did Bordt et al. (2026) find about the weight decay \(\lambda\) that optimizes pretraining loss vs. downstream fine-tuning plasticity?
  2. Why does Hernandez-Garcia et al.’s (2026) scaling law \(T = 1.3\times 10^{-5}\cdot P^{0.8269}\) rule out “just scale it up” as a cure for plasticity loss?
  3. Why does Shrink-and-Perturb’s random noise injection help a ReLU MLP but hurt a linear fast-weight matrix \(\mathbf{S}_t\)?
  4. How does read-utility-selective decay differ from both uniform scalar decay \(\gamma\mathbf{S}_t\) and SDG’s write-delta gate \(\boldsymbol\Lambda(\Delta\mathbf{S})\)?

Next → PC-4 — Consolidation, sleep & memory diagnostics