Skip to content

Commit 8a42f2d

Browse files
committed
image fix
1 parent d7115c9 commit 8a42f2d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

05Infer/04LongInfer/08StarAttention.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ Author by: 于佼良
66

77

88
## 二、什么StarAttention?
9-
SA分两部分,第一部分称为上下文编码(Context encoding)。第二部分为查询编码于token生成
9+
SA分两部分,第一部分称为上下文编码(Context encoding)。第二部分为查询编码与token生成
1010

1111
### 1. 上下文编码
1212
对于输入序列,它通常由上下文c和紧跟其后的q组成,在上下文编码中,把这个c划分为n个连续的块,$c=[c_1,c_2,...c_n]$, 在每个块中,包含b个token。这里引入了一种锚定块机制,在这个机制中,除了第一个块,每个块都以第一个块作为前缀。图示如下:
1313

14-
![alt text](../04LongInfer/images/08StarAttention_1.png)
14+
![alt text](../04LongInfer/images/08StarAttention_01.png)
1515

1616
每个拼接后的块(下文称为增强块)可以表示为:
1717

@@ -30,7 +30,7 @@ $$ c'=[c_1,(c_1,c_2),(c_1,c_3)....(c_1,c_n)] $$
3030

3131
初看之下似乎,start attention 和 streaming llm提到的结论有点相悖,前者认为是信息重要,后者认为绝对位置比较重要。关于这一点,我认为它们本质上是一致的,即对于完整的序列来说,开头的block,是注意力得分较高的部分,也就是sink的部分,start attention得出的位置不重要的结论只是通过改动position id,而first block的重要性是他们的绝对位置决定的,这个position id带来的影响太小。不过这个自圆其说的想法不一定正确,欢迎大家提出指导意见~
3232

33-
### 2、
33+
### 2、查询编码与token生成
3434

3535

3636

0 commit comments

Comments
 (0)