Files
myWiki/concepts/generalized-delta-rule.md

69 lines
2.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: "Generalized Delta Rule"
created: 2026-06-18
updated: 2026-06-18
type: concept
tags: ["rwkv", "delta-rule", "state-evolution", "rnn"]
sources: ["https://arxiv.org/abs/2503.14456"]
---
# Generalized Delta Rule
## 定义
Generalized Delta Rule广义 Delta 规则)是 RWKV-7 对经典 [[delta-rule]] 的三重扩展,代表了 Delta 规则从学习记忆到序列建模的完整演进。它在保留梯度下降式状态更新框架的同时,引入向量值门控、上下文学习率和键解耦合。
## 三重扩展
### 1. 向量值上下文学习率
传统 Delta 规则 α 是标量 → RWKV-7 的 a_t 是 d 维向量:
```
S_t = S_{t-1} · (I - a_t · κ̂_t^2) + v_t^T · k_t (简化形式)
```
效果:模型可**逐通道**以不同速率更新状态——某些通道快速适应新信息,另一些保持稳定。
### 2. 向量值门控Vector-Valued Gating
引入动态衰减项 w_t[[vector-valued-gating]]
```
S_t = S_{t-1} · (diag(w_t) - κ̂_t^T (a_t ⊙ κ̂_t)) + v_t^T · k_t
```
其中 `diag(w_t)` 实现逐通道衰减,`κ̂_t^T (a_t ⊙ κ̂_t)` 实现基于内容的选择性遗忘。
### 3. 松弛值替换规则
解耦移除 keyk_remove和添加 keyk_add
- 传统 DeltaNet同一个 k_t 既用于检测需要移除的旧信息,也用于编码要添加的新信息
- RWKV-7分离两个 key → 模型可以"在不相关的维度移除,在相关的维度添加"
## 完全形式
```
S_t = S_{t-1} · (diag(w_t) - κ̂_remove^T (a_t ⊙ κ̂_add)) + v_t^T · k_add
```
其中 w_t, a_t, κ̂ 均依赖当前输入 x_t。
## 表达力提升
广义 Delta 规则使 RWKV-7 的表达力从 TC^0 跃升至 NC^1
- 可识别**所有正则语言**
- 单层可解决 S5 状态追踪
- 超越标准 Transformer 的理论上界
## 相关概念
- [[delta-rule]] — 经典 Delta 规则
- [[vector-valued-gating]] — 逐通道门控机制
- [[in-context-learning-rate]] — 向量值学习率
- [[dynamic-state-evolution]] — 完整的动态演化形式化
- [[regular-language-recognition]] — 理论结果
- [[peng-rwkv7|RWKV-7 论文]]
## 参考
- [[peng-rwkv7|RWKV-7 "Goose"]] (Peng et al., 2025) — Section 4