0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Linear Transformerを理解する

0
Posted at

概要

Linear Transformerを理解するために参考にした記事とメモです。

論文

Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention

記事

  • 概要
    • https://www.alphaxiv.org/overview/2006.16236
    • Transformerはシーケンス長$N$に対して$O(N^2)$で計算量が増えるのが課題
    • 計算量とメモリを$O(N)$にする方法を提案する
    • $S_i$と$Z_i$についての累積和の式から、TransformerはRNNとみなすことができる
    • 累積和の式のため、各ステップの計算は$O(1)$で済むので、全体計算量は$O(N)$になる
    • MNISTやCIFAR-10での実験で推論が速くなったことを確認。学習も速くなった。精度は下がる
  • RNNの式
  • 数式と図
    • https://zenn.dev/headwaters/articles/84c6736cd78653
    • 論文におけるAttentionの出力(3)式から(5)式を追うのに参考になる
    • よくわからない関数simを$\phi$におきかえて計算させる、と考える
    • Attentionのアーキテクチャ図からLinear Transformerのアーキテクチャ図のように変わる。Linear Transformerは、Qの積よりKVの積が先になる
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?