更改

添加136字节 、 2026年3月15日 (星期日)
第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>: