microsoft / torchscale

Foundation Architecture for (M)LLMs
https://aka.ms/GeneralAI
MIT License
2.98k stars 201 forks source link

Question about LongNet attention map overlap #108

Open RmZeta2718 opened 2 months ago

RmZeta2718 commented 2 months ago

The attention maps of different Dilated Rates overlap with each other. In the figure, the same token is calculated only once, but in the code, the overlapped token is taken into account multiple times (because the output is a weighted sum of all Dilated Rates).

image

Would you have any comments on this? Is this expected behavior? @donglixp @shumingma