crimsonred-paper-replication
收藏资源简介:
CrimsonRed 跨架构情感-基元引导复制数据集是一个用于可解释性人工智能研究的数据集,旨在复现并扩展 arXiv:2607.18691 论文中提出的情感-基元引导协议。核心发现是,当遵循论文参考代码(而非其文字描述)的注入协议时,语义基元配方在引导大型语言模型情感方面比 Scherer 评估方法更有效,且这一结论在多个模型架构(如 Llama-3.2-1B、Qwen3.5-2B、Gemma-4-E2B 等)上得到验证。数据集包含跨架构实验结果摘要、方法学审计报告,以及详细的数据生成过程:使用激活引导技术,在模型前向传播的残差连接处注入未归一化的探针权重方向,跨越三个模型层。引导方向来源于32个语义基元(从210个对比对中提取)、20个 Scherer 评估维度和13种基本情感。评估指标为目标情感在答案位置的对数偏移量,并计算偏移比率。目标情感包括内疚、愤怒、快乐和悲伤。数据集文件包括JSON格式的结果摘要、方法论文档和具体实验结果文件,适用于研究大型语言模型的情感机制、激活引导技术有效性、跨架构泛化性以及代码与论文一致性。
The CrimsonRed Cross-Architecture Sentiment-Priming Replication Dataset is a dataset for explainable artificial intelligence (XAI) research, aiming to reproduce and extend the sentiment-priming protocol proposed in the paper arXiv:2607.18691. The core finding is that when following the injection protocol specified in the paper's reference code (rather than its textual description), the semantic priming recipe is more effective in steering the sentiment of large language models than the Scherer evaluation method, and this conclusion has been validated across multiple model architectures including but not limited to Llama-3.2-1B, Qwen3.5-2B, Gemma-4-E2B and others. The dataset includes cross-architecture experimental result summaries, methodological audit reports, and detailed data generation procedures: activation steering techniques are used to inject unnormalized probe weight directions at residual connections during the model's forward pass across three model layers. The steering directions are derived from 32 semantic primitives extracted from 210 contrastive pairs, 20 Scherer evaluation dimensions, and 13 basic emotions. The evaluation metrics are the logarithmic offset of the target sentiment at the answer position, with the offset ratio calculated. The target sentiments include guilt, anger, joy and sadness. The dataset files contain JSON-formatted result summaries, methodological documents, and specific experimental result files, which are applicable to research on the sentiment mechanisms of large language models, the effectiveness of activation steering techniques, cross-architecture generalization, and the consistency between code and the published paper.
数据集概述
数据集名称: CrimsonRed — Cross-Architecture Emotion-Prime Steering Replication
数据集地址: https://huggingface.co/datasets/musicakamusic/crimsonred-paper-replication
许可证: AGPL-3.0
任务类型: 文本生成
标签: emotion, steering, activation-steering, interpretability, replication, cross-architecture
核心发现
该数据集复现了 arXiv:2607.18691 论文中提出的情感-原语(emotion-prime)引导协议,并将其扩展至四种不同架构。核心发现为:当注入协议与参考代码(而非论文文本描述)匹配时,语义原语配方方向(prime recipe)比 Scherer 评估方向(appraisal)在跨架构上更强烈地引导情感,效果约为 2.9 倍。
| 模型 | 层 | 原语配方 | 单一评估 | 操作区间比 | 论文验证 |
|---|---|---|---|---|---|
| Llama-3.2-1B | 11 | +0.26 | +0.15 | 2.80× | ✅ |
| Qwen3.5-2B | 18 | +0.09 | +0.01 | 2.95× | ✅ |
| Gemma-4-E2B | 15 | +0.04 | −0.03 | 原语 >> 评估 | ✅ |
| Gemma-4-E4B | 20 | 待定 | 待定 | 待定 | 待定 |
论文文本与代码的不一致(方法论贡献)
论文 §4 描述的注入方式与参考代码实际执行方式存在显著差异:
| 方面 | 论文 §4 描述 | 参考代码实现 |
|---|---|---|
| 方向 | 单位归一化 | 原始探针权重(未归一化) |
| 缩放 | β × 层平均残差范数 | β × 1.0(固定值) |
| Token位置 | 所有位置 | 仅最后一个 token |
| 层数 | 单层(L11) | 跨度3层(L10, L11, L12) |
| 对比去除 | 未提及 | 禁用(Beta2 = 0.0) |
遵循论文文本会产生假阴性结果(Qwen 0.82×, Gemma 0.91×,看似“Llama特异性”),而遵循代码则在每个模型上复现了约 2.9 倍的论文结果。
协议说明(源模式)
- 注入方式: 使用 Hugging Face
register_forward_hook,在 MLP 后残差连接处,于最后一个 token 位置添加β × raw_probe_weight,跨越3层。 - 方向:
- 32 个原语(L2 逻辑回归,C=1.0,每个原语 210 个对比对,保留验证准确率 0.987)
- 20 个评估(Ridge α=5.0,基于 enVent 6,800 个事件)
- 13 种情感(L2 逻辑回归,基于 enVent 标签)
- 评估指标: 目标情感在 Tak 等人提出的2-shot分类提示中的答案位置处的 logit 变化。选择性限制在 [−1, 1] 区间。
- 操作区间比: 在目标情感天花板变化为正的(目标, β)单元格中,原语/评估的变化比率。
- 目标情感: 内疚、愤怒、喜悦、悲伤。
文件列表
| 路径 | 描述 |
|---|---|
summary_2026-07-27_source_mode.json |
跨架构源模式摘要 |
docs/METHODOLOGY_AUDIT_PAPER_FAITHFUL_2026-07-27.md |
与论文的完整方法论审计 |
docs/PAPER_DRAFT_CROSS_ARCH_PRIMES_2026-07-27.md |
出版物草稿 |
results/source/paper_faithful_llama1b_L11_source_cal.json |
Llama L11 源模式,β=0.01–0.2 |
results/source/paper_faithful_qwen35_L18_source.json |
Qwen3.5-2B L18 源模式 |
results/source/paper_faithful_gemma_e2b_L15_source.json |
Gemma-4-E2B L15 源模式 |
results/source/paper_faithful_gemma_e4b_L20_source.json |
Gemma-4-E4B L20 源模式(运行完成时追加) |
results/papermode/paper_faithful_llama1b_L11_sweep_v2.json |
Llama 论文模式 v2(修正指标) |
results/papermode/paper_faithful_llama1b_L11_paperverse.json |
Llama 论文 β=0.5–2.0(崩溃) |
legacy/… |
早期论文模式结果,保留以追溯来源 |
复现命令
bash python scripts/paper_faithful_steering.py --model <path> --layer <L> --inject-tokens last --layer-span 3 --beta 0.01 0.02 0.05 0.1 0.2 --mode source --pairs-per-prime 210 --output data/<name>.json
来源项目: CrimsonRed




