Evaluate linear and forward-only optimization for attention sharing
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
# Qwen3.5-2B 注意力共享的线性拟合与无梯度搜索
|
||||
|
||||
保留 Qwen3.5-2B 底座和第 19→23 层的单点干预。检索题要求输出最新的记录值,部分题故意包含同一键的冲突记录。12 道拟合题、8 道验证题、16 道留出题均独立生成。留出含 8 道 10 项表。各方案在测试前冻结,随机搜索的整体候选由验证集 NLL 选出。
|
||||
|
||||
| 方法 | 留出全词表首个数字准确数 | 留出九数字 NLL |
|
||||
| --- | ---: | ---: |
|
||||
| 原模型 | 1/16 | 1.73505 |
|
||||
| 原序直接共享 | 1/16 | 1.80085 |
|
||||
| 供体头的线性拟合 | 1/16 | 1.75648 |
|
||||
| 供体与接收层 32 个 Q/K 坐标联合拟合 | 1/16 | 1.74997 |
|
||||
| 两系数网格 | 1/16 | 1.79451 |
|
||||
| 加噪择优,种子 1701(验证集选中) | 2/16 | 1.72949 |
|
||||
| 加噪择优,种子 1702 / 1703 | 1/16 / 1/16 | 1.76795 / 1.76090 |
|
||||
| 双向扰动,种子 1701 / 1702 / 1703 | 均 1/16 | 1.78861 / 1.79510 / 1.79207 |
|
||||
|
||||
三个加噪择优种子的平均留出 NLL 为 1.75278,较直接共享低约 0.048。联合线性拟合得 1.74997。验证集选中的加噪种子多答对一道重复键的 6 项表题,另外两个种子未多答对题。所有配置在 10 项表均为 0/8。这组小样本支持加噪和线性修正都能改善相对直接共享的数字排序损失,准确率收益只有单题、单种子的证据。网格选中供体增益 1.5、接收端增益 0。
|
||||
|
||||
加噪择优每个种子有 25 次拟合前向,包含起点。双向扰动每种子有 73 次,包含正负扰动及接受判断。另有验证前向。该预算下双向扰动提升较小,两个搜索的前向预算不同。优化只改变小型头混合矩阵,底座权重冻结,无反向传播。闭式线性拟合用原模型内部注意力分数作为目标,不用答题标签。九数字 NLL 只在数字 1–9 上归一化。全词表准确率只检查首个答案 token。
|
||||
|
||||
## 验证和复现
|
||||
|
||||
- 在已授权的原 Qwen 远程 CPU 运行 12 项检查,全部通过。
|
||||
- 原模型末层重放与完整前向的最大绝对差分别为拟合 5.25e-6、验证 5.72e-6、留出 7.63e-6。逐题数字 NLL已从归档 logits 独立复算。
|
||||
- 小型合成检查点还覆盖了抓取、续跑、校准、冻结和评估的端到端流程。
|
||||
- 完整真实激活缓存保留于服务器,仓库仅保存合成题、模型与代码指纹、适配器及轨迹和评测。未测自由生成整段答案、多层替换或运行时加速。
|
||||
|
||||
复现命令见 [crossqkv/README.md](../../crossqkv/README.md)。
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,260 @@
|
||||
{
|
||||
"fit": [
|
||||
{
|
||||
"prompt": "Records (oldest first): pine=6, cedar=5, maple=9, moss=5, yew=7, oak=2. What is the latest value of moss? Answer with one digit:",
|
||||
"gold": 5,
|
||||
"entries": 6,
|
||||
"duplicate": false,
|
||||
"id": "fit-00"
|
||||
},
|
||||
{
|
||||
"prompt": "Records (oldest first): fir=2, maple=1, moss=1, fern=4, fern=1, elm=5. What is the latest value of fern? Answer with one digit:",
|
||||
"gold": 1,
|
||||
"entries": 6,
|
||||
"duplicate": true,
|
||||
"id": "fit-01"
|
||||
},
|
||||
{
|
||||
"prompt": "Records (oldest first): pine=1, elm=4, ash=2, birch=7, moss=3, fir=4. What is the latest value of moss? Answer with one digit:",
|
||||
"gold": 3,
|
||||
"entries": 6,
|
||||
"duplicate": false,
|
||||
"id": "fit-02"
|
||||
},
|
||||
{
|
||||
"prompt": "Records (oldest first): cedar=7, pine=8, elm=7, fern=5, yew=1, elm=3. What is the latest value of elm? Answer with one digit:",
|
||||
"gold": 3,
|
||||
"entries": 6,
|
||||
"duplicate": true,
|
||||
"id": "fit-03"
|
||||
},
|
||||
{
|
||||
"prompt": "Records (oldest first): maple=5, fir=4, elm=4, moss=2, cedar=9, fern=4. What is the latest value of fir? Answer with one digit:",
|
||||
"gold": 4,
|
||||
"entries": 6,
|
||||
"duplicate": false,
|
||||
"id": "fit-04"
|
||||
},
|
||||
{
|
||||
"prompt": "Records (oldest first): ash=2, ash=1, fir=7, yew=4, cedar=9, maple=9. What is the latest value of ash? Answer with one digit:",
|
||||
"gold": 1,
|
||||
"entries": 6,
|
||||
"duplicate": true,
|
||||
"id": "fit-05"
|
||||
},
|
||||
{
|
||||
"prompt": "Records (oldest first): yew=4, fir=5, ash=1, elm=3, cedar=1, pine=5. What is the latest value of pine? Answer with one digit:",
|
||||
"gold": 5,
|
||||
"entries": 6,
|
||||
"duplicate": false,
|
||||
"id": "fit-06"
|
||||
},
|
||||
{
|
||||
"prompt": "Records (oldest first): fern=3, reed=6, cedar=2, moss=1, fir=1, moss=9. What is the latest value of moss? Answer with one digit:",
|
||||
"gold": 9,
|
||||
"entries": 6,
|
||||
"duplicate": true,
|
||||
"id": "fit-07"
|
||||
},
|
||||
{
|
||||
"prompt": "Records (oldest first): elm=5, reed=4, fern=5, fir=9, moss=9, cedar=6. What is the latest value of reed? Answer with one digit:",
|
||||
"gold": 4,
|
||||
"entries": 6,
|
||||
"duplicate": false,
|
||||
"id": "fit-08"
|
||||
},
|
||||
{
|
||||
"prompt": "Records (oldest first): fern=8, ash=7, oak=9, maple=2, pine=5, pine=9. What is the latest value of pine? Answer with one digit:",
|
||||
"gold": 9,
|
||||
"entries": 6,
|
||||
"duplicate": true,
|
||||
"id": "fit-09"
|
||||
},
|
||||
{
|
||||
"prompt": "Records (oldest first): maple=3, fir=1, birch=4, fern=6, yew=9, cedar=6. What is the latest value of fern? Answer with one digit:",
|
||||
"gold": 6,
|
||||
"entries": 6,
|
||||
"duplicate": false,
|
||||
"id": "fit-10"
|
||||
},
|
||||
{
|
||||
"prompt": "Records (oldest first): yew=5, birch=4, birch=3, fir=8, oak=1, elm=9. What is the latest value of birch? Answer with one digit:",
|
||||
"gold": 3,
|
||||
"entries": 6,
|
||||
"duplicate": true,
|
||||
"id": "fit-11"
|
||||
}
|
||||
],
|
||||
"validation": [
|
||||
{
|
||||
"prompt": "Records (oldest first): ash=7, fern=4, birch=9, yew=8, moss=9, cedar=9. What is the latest value of cedar? Answer with one digit:",
|
||||
"gold": 9,
|
||||
"entries": 6,
|
||||
"duplicate": false,
|
||||
"id": "validation-00"
|
||||
},
|
||||
{
|
||||
"prompt": "Records (oldest first): fern=2, cedar=6, yew=6, fir=1, elm=8, fern=8. What is the latest value of fern? Answer with one digit:",
|
||||
"gold": 8,
|
||||
"entries": 6,
|
||||
"duplicate": true,
|
||||
"id": "validation-01"
|
||||
},
|
||||
{
|
||||
"prompt": "Records (oldest first): birch=1, pine=2, yew=5, ash=1, fern=9, fir=3. What is the latest value of ash? Answer with one digit:",
|
||||
"gold": 1,
|
||||
"entries": 6,
|
||||
"duplicate": false,
|
||||
"id": "validation-02"
|
||||
},
|
||||
{
|
||||
"prompt": "Records (oldest first): reed=6, maple=6, cedar=1, ash=3, yew=8, reed=4. What is the latest value of reed? Answer with one digit:",
|
||||
"gold": 4,
|
||||
"entries": 6,
|
||||
"duplicate": true,
|
||||
"id": "validation-03"
|
||||
},
|
||||
{
|
||||
"prompt": "Records (oldest first): maple=5, pine=3, fern=7, oak=8, birch=6, yew=2. What is the latest value of oak? Answer with one digit:",
|
||||
"gold": 8,
|
||||
"entries": 6,
|
||||
"duplicate": false,
|
||||
"id": "validation-04"
|
||||
},
|
||||
{
|
||||
"prompt": "Records (oldest first): cedar=6, birch=6, oak=6, cedar=4, ash=8, elm=6. What is the latest value of cedar? Answer with one digit:",
|
||||
"gold": 4,
|
||||
"entries": 6,
|
||||
"duplicate": true,
|
||||
"id": "validation-05"
|
||||
},
|
||||
{
|
||||
"prompt": "Records (oldest first): maple=5, yew=5, fir=4, pine=4, elm=6, reed=3. What is the latest value of yew? Answer with one digit:",
|
||||
"gold": 5,
|
||||
"entries": 6,
|
||||
"duplicate": false,
|
||||
"id": "validation-06"
|
||||
},
|
||||
{
|
||||
"prompt": "Records (oldest first): fir=4, yew=4, moss=4, moss=1, oak=3, reed=4. What is the latest value of moss? Answer with one digit:",
|
||||
"gold": 1,
|
||||
"entries": 6,
|
||||
"duplicate": true,
|
||||
"id": "validation-07"
|
||||
}
|
||||
],
|
||||
"test": [
|
||||
{
|
||||
"prompt": "Records (oldest first): pine=4, ash=1, birch=9, maple=7, fern=6, fir=9. What is the latest value of pine? Answer with one digit:",
|
||||
"gold": 4,
|
||||
"entries": 6,
|
||||
"duplicate": false,
|
||||
"id": "test-00"
|
||||
},
|
||||
{
|
||||
"prompt": "Records (oldest first): fir=9, pine=5, cedar=8, elm=9, maple=3, elm=8. What is the latest value of elm? Answer with one digit:",
|
||||
"gold": 8,
|
||||
"entries": 6,
|
||||
"duplicate": true,
|
||||
"id": "test-01"
|
||||
},
|
||||
{
|
||||
"prompt": "Records (oldest first): yew=4, fir=6, maple=1, oak=9, moss=2, reed=2, cedar=4, elm=7, fern=5, pine=3. What is the latest value of reed? Answer with one digit:",
|
||||
"gold": 2,
|
||||
"entries": 10,
|
||||
"duplicate": false,
|
||||
"id": "test-02"
|
||||
},
|
||||
{
|
||||
"prompt": "Records (oldest first): moss=5, ash=4, pine=6, reed=4, cedar=7, oak=7, elm=6, birch=8, fir=6, ash=6. What is the latest value of ash? Answer with one digit:",
|
||||
"gold": 6,
|
||||
"entries": 10,
|
||||
"duplicate": true,
|
||||
"id": "test-03"
|
||||
},
|
||||
{
|
||||
"prompt": "Records (oldest first): maple=9, elm=7, oak=7, pine=5, reed=4, cedar=8. What is the latest value of elm? Answer with one digit:",
|
||||
"gold": 7,
|
||||
"entries": 6,
|
||||
"duplicate": false,
|
||||
"id": "test-04"
|
||||
},
|
||||
{
|
||||
"prompt": "Records (oldest first): ash=7, fir=4, pine=5, fern=8, fern=9, oak=7. What is the latest value of fern? Answer with one digit:",
|
||||
"gold": 9,
|
||||
"entries": 6,
|
||||
"duplicate": true,
|
||||
"id": "test-05"
|
||||
},
|
||||
{
|
||||
"prompt": "Records (oldest first): elm=5, reed=9, oak=4, yew=8, cedar=1, fir=1, ash=4, maple=5, fern=3, pine=7. What is the latest value of elm? Answer with one digit:",
|
||||
"gold": 5,
|
||||
"entries": 10,
|
||||
"duplicate": false,
|
||||
"id": "test-06"
|
||||
},
|
||||
{
|
||||
"prompt": "Records (oldest first): moss=8, ash=7, pine=7, reed=7, yew=3, birch=4, elm=9, maple=3, ash=6, fir=9. What is the latest value of ash? Answer with one digit:",
|
||||
"gold": 6,
|
||||
"entries": 10,
|
||||
"duplicate": true,
|
||||
"id": "test-07"
|
||||
},
|
||||
{
|
||||
"prompt": "Records (oldest first): birch=5, elm=9, yew=9, ash=3, cedar=9, reed=9. What is the latest value of yew? Answer with one digit:",
|
||||
"gold": 9,
|
||||
"entries": 6,
|
||||
"duplicate": false,
|
||||
"id": "test-08"
|
||||
},
|
||||
{
|
||||
"prompt": "Records (oldest first): maple=7, yew=6, birch=3, reed=8, ash=6, maple=2. What is the latest value of maple? Answer with one digit:",
|
||||
"gold": 2,
|
||||
"entries": 6,
|
||||
"duplicate": true,
|
||||
"id": "test-09"
|
||||
},
|
||||
{
|
||||
"prompt": "Records (oldest first): ash=9, cedar=3, maple=5, fern=4, oak=2, reed=3, birch=7, pine=5, moss=3, elm=6. What is the latest value of elm? Answer with one digit:",
|
||||
"gold": 6,
|
||||
"entries": 10,
|
||||
"duplicate": false,
|
||||
"id": "test-10"
|
||||
},
|
||||
{
|
||||
"prompt": "Records (oldest first): elm=2, birch=3, moss=6, oak=2, fir=5, pine=9, yew=2, pine=2, cedar=7, fern=2. What is the latest value of pine? Answer with one digit:",
|
||||
"gold": 2,
|
||||
"entries": 10,
|
||||
"duplicate": true,
|
||||
"id": "test-11"
|
||||
},
|
||||
{
|
||||
"prompt": "Records (oldest first): yew=2, pine=2, fir=2, elm=3, moss=4, reed=9. What is the latest value of yew? Answer with one digit:",
|
||||
"gold": 2,
|
||||
"entries": 6,
|
||||
"duplicate": false,
|
||||
"id": "test-12"
|
||||
},
|
||||
{
|
||||
"prompt": "Records (oldest first): maple=8, birch=9, birch=2, oak=1, moss=8, cedar=2. What is the latest value of birch? Answer with one digit:",
|
||||
"gold": 2,
|
||||
"entries": 6,
|
||||
"duplicate": true,
|
||||
"id": "test-13"
|
||||
},
|
||||
{
|
||||
"prompt": "Records (oldest first): fern=2, pine=4, maple=3, yew=4, ash=8, reed=1, birch=3, fir=5, elm=6, cedar=2. What is the latest value of birch? Answer with one digit:",
|
||||
"gold": 3,
|
||||
"entries": 10,
|
||||
"duplicate": false,
|
||||
"id": "test-14"
|
||||
},
|
||||
{
|
||||
"prompt": "Records (oldest first): birch=7, yew=4, elm=5, cedar=3, pine=1, oak=8, fern=3, ash=7, reed=1, ash=8. What is the latest value of ash? Answer with one digit:",
|
||||
"gold": 8,
|
||||
"entries": 10,
|
||||
"duplicate": true,
|
||||
"id": "test-15"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"donor": 19,
|
||||
"recipient": 23,
|
||||
"seeds": {
|
||||
"fit": 22301,
|
||||
"validation": 22302,
|
||||
"test": 22303
|
||||
},
|
||||
"capture_code_sha256": "5b9d218fccf1bb9c64a27425e37f2f7abe58164083b3e0fbdc699ede3f9ab7fd",
|
||||
"source_files_sha256": {
|
||||
"manifest.json": "28efbaf94a5034333339a35f08ead151459a7d20c6c2d2f07a451e7f3bf154de",
|
||||
"model_config.json": "ed1c1723241f23f7f4e23430759cbd7dcfb4103cbdfe052bfe7626b57c2615b4",
|
||||
"tokenizer.json": "5f9e4d4901a92b997e463c1f46055088b6cca5ca61a6522d1b9f64c4bb81cb42"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user