打开主菜单
首页
随机
登录
设置
关于集智百科 - 复杂系统|人工智能|复杂科学|复杂网络|自组织
免责声明
集智百科 - 复杂系统|人工智能|复杂科学|复杂网络|自组织
搜索
更改
←上一编辑
下一编辑→
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
个编辑