更改
跳到导航
跳到搜索
←上一编辑
下一编辑→
ActAdd方法
(查看源代码)
2026年3月15日 (日) 15:04的版本
添加136字节
、
2026年3月15日 (星期日)
→ActAdd算法
第44行:
第44行:
# 对齐 token 长度:将 <math>(p_+,p_-)</math> 右侧填充到相同 token 长度,得 <math>(p'_+,p'_-)</math>。
# 对齐 token 长度:将 <math>(p_+,p_-)</math> 右侧填充到相同 token 长度,得 <math>(p'_+,p'_-)</math>。
−
#
读取两端激活:
+
#
将<math>(p'_+,p'_-)</math>分别输入模型,并在第[math]l[/math]层,读取模型的激活值:
#* <math>\mathbf{h}^l_+ = \mathbf{h}^l(p'_+)</math>
#* <math>\mathbf{h}^l_+ = \mathbf{h}^l(p'_+)</math>
#* <math>\mathbf{h}^l_- = \mathbf{h}^l(p'_-)</math>
#* <math>\mathbf{h}^l_- = \mathbf{h}^l(p'_-)</math>
−
#
计算引导[[向量]](差分):
+
#
根据激活值<math>\mathbf{h}^l_+,\mathbf{h}^l_-</math>计算引导向量的差分:
#* <math>\mathbf{h}^l_A = \mathbf{h}^l_+ - \mathbf{h}^l_-</math>
#* <math>\mathbf{h}^l_A = \mathbf{h}^l_+ - \mathbf{h}^l_-</math>
−
# 读取用户[[提示词]]
激活:
+
# 读取用户[[提示词]]
的激活:
#* <math>\mathbf{h}^l_* = \mathbf{h}^l(p^*)</math>
#* <math>\mathbf{h}^l_* = \mathbf{h}^l(p^*)</math>
# 注入并继续前向:在对齐位置 <math>a</math> 处进行加法[[干预]]并继续完成前向计算,得到输出 <math>S</math>:
# 注入并继续前向:在对齐位置 <math>a</math> 处进行加法[[干预]]并继续完成前向计算,得到输出 <math>S</math>:
Jake
行政员
、
界面管理员
、
管理员
3,094
个编辑
导航菜单
个人工具
登录
名字空间
页面
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
导航
集智百科
集智主页
集智斑图
集智学园
最近更改
所有页面
捐赠我们
帮助
工具
特殊页面
可打印版本