Record LiSA task and CPU performance results

This commit is contained in:
2026-11-24 01:16:08 +08:00
parent 59072884ff
commit c2aa23f32f
8 changed files with 2235 additions and 4 deletions
+15 -4
View File
@@ -12,10 +12,17 @@ At the same 22 layers, direct score sharing retained 46.76% and the direct
sharing plus LoRA baseline retained 65.95%. The published main uptraining
used 4.2 billion sampled RedPajama tokens on eight A800 GPUs. This experiment
uses a frozen Qwen3.5-2B backbone, two recipient layers, 12 synthetic fit
prompts and a single CPU runner. The comparable effect is an improvement
over direct sharing under a fixed layer schedule. The magnitude on a
32-item lookup test and the timing of CPU attention should be interpreted
within those settings. [Mu et al., Table 2 and Appendix C.1](https://aclanthology.org/2026.tacl-1.30.pdf)
prompts and a single CPU runner. Each epoch of the trainable variants sees
1,874 next-token targets drawn from those same 12 prompts. The comparable
effect is an improvement over direct sharing under a fixed layer schedule.
The magnitude on a 32-item lookup test and the timing of CPU attention should
be interpreted within those settings. [Mu et al., Table 2 and Appendix C.1](https://aclanthology.org/2026.tacl-1.30.pdf)
Qwen's text decoder has six full-attention layers and 18 linear-attention
layers. The chained configuration modifies two of the six full-attention
layers and two of the 24 decoder layers overall. Layer numbers are zero-based.
The source record in `results/lisa-effect-reproduction/runtime.json` pins
the original model revision, the checkpoint shard and its download-manifest hash.
## Task and layer screening
@@ -140,6 +147,10 @@ four-choice correctness in the primary test and the full-vocabulary pass.
Training scores *all* valid shifted tokens with exact full-vocabulary CE
and uses the validation four-option answer loss to freeze checkpoints. The
answer audit scores only the answer position over the whole vocabulary.
The answer is one token per prompt. In the fit set, it accounts for about
0.64% of the unweighted CE target mass and about 9.35% with the 16-fold answer
weight. The objective applies the same 0.75 coefficient to the resulting
mean CE in both trainable variants.
It does not report whole-prompt CE for the held-out items or free-form
multi-token answer accuracy. That distinction is important for interpreting
the previous experiment, in which those two losses moved in opposite
+31
View File
@@ -0,0 +1,31 @@
# Qwen3.5-2B 双层 LiSA 复现实验
在固定的 32 道查找题上,原模型、直接共享、线性修正和两版 LiSA 都答对 32 道。原版 LiSA 降低了接收层 K/V 缓存,并在投影权重常驻内存时缩短了两个接收层的单步解码时间。按本次 CPU 权重流式读取方式测量,第 19 层单步解码更快,第 23 层略慢,双层共享的预填充更慢。全词表答案复核正在运行。
## 四选一任务表现
开发筛选中,原模型和单层直接共享各答对 8/8,双层直接共享答对 7/8。以此冻结 16 条目查找任务,测试使用独立题目。共享链为 15→19→23,层号从 0 起算。第 19、23 层占 6 个全注意力层的三分之一,占 24 个解码层的十二分之一。
| 方法 | 留出正确数 | 四选一答案 NLL ↓ |
| --- | ---: | ---: |
| 原模型 | 32/32 | 0.1341 |
| 双层直接共享 | 32/32 | 0.0728 |
| 双层线性修正 | 32/32 | 0.0720 |
| 双层 LiSA | 32/32 | 0.1846 |
| 双层 LiSA,答案损失加权 | 32/32 | 0.1260 |
直接共享在留出集上丢失 0 道原模型答对的题,因此无法估计 LiSA 对这类错题的恢复率。答案加权把 LiSA 的四选一 NLL 降低了 0.0586,仍高于直接共享。三种训练方法各用 12 道拟合题跑两轮,并由另外 12 道验证题选择检查点。所选检查点都是第 2 轮。逐题 logits、训练轨迹及检查点哈希随结果归档。
## CPU 计时和缓存
| 测量范围 | 原模型 | LiSA |
| --- | ---: | ---: |
| 缓存前缀后的尾部预填充,157 tokens | 12.37 s | 16.31 s |
| 第 19 层单步,流式读取权重 | 136.15 ms | 96.32 ms |
| 第 23 层单步,流式读取权重 | 136.39 ms | 138.80 ms |
| 第 19 层单步,投影权重常驻 | 42.57 ms | 32.09 ms |
| 第 23 层单步,投影权重常驻 | 44.80 ms | 22.79 ms |
每个接收层的 FP32 K/V 实际分配从 643,072 降到 371,776 字节,下降 42.2%。计入该层所用的 5,024 字节上游分数行后,单层合计下降 41.4%。V 缓存为 321,536 字节。解码计时的单位是单个接收层的一步,计时范围从接收现成分数行开始,至该层注意力输出结束。预填充用 3 次计时的中位数,单层解码每个配置用 9 步计时的中位数。
论文表 2 的 96.44% 衡量 LLaMA2-13B 在共享 22 层时多个基准上的平均性能保留率。这里每轮只有 1,874 个训练目标 token,测到的是单一查找任务的表现和 CPU 组件耗时。 [论文表 2、表 3 和附录 C.1](https://aclanthology.org/2026.tacl-1.30.pdf)