Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
論文紹介 Reformer: The Efficient Transformer
Search
Reo
May 27, 2020
Technology
0
240
論文紹介 Reformer: The Efficient Transformer
I will give a presentation on the following paper.
https://openreview.net/forum?id=rkgNKkHtvB
Reo
May 27, 2020
Tweet
Share
More Decks by Reo
See All by Reo
論文紹介 Taking Notes on the Fly Helps Language Pre-Trainig
reo11
0
40
EMNLP論文紹介 The Myth of Double-Blind Review Revisited: ACL vs. EMNLP
reo11
0
160
論文読み会 How Large Are Lions? Inducing Distributions over Quantitative Attributes
reo11
1
240
ACL読み会 Give Me More Feedback II: Annotating Thesis Strength and Related Attributes in Student Essays
reo11
0
170
NAACL読み会 Attention is not Explanation
reo11
0
120
Other Decks in Technology
See All in Technology
AI時代に必要なデータプラットフォームの要件とは by @Kazaneya_PR / 20251107
kazaneya
PRO
4
720
SREのキャリアから経営に近づく - Enterprise Risk Managementを基に -
shonansurvivors
1
740
AWS re:Invent 2025事前勉強会資料 / AWS re:Invent 2025 pre study meetup
kinunori
0
1.1k
JAWS UG AI/ML #32 Amazon BedrockモデルのライフサイクルとEOL対応/How Amazon Bedrock Model Lifecycle Works
quiver
1
830
AWSが好きすぎて、41歳でエンジニアになり、AAIを経由してAWSパートナー企業に入った話
yama3133
2
230
CLIPでマルチモーダル画像検索 →とても良い
wm3
2
800
ざっくり学ぶ 『エンジニアリングリーダー 技術組織を育てるリーダーシップと セルフマネジメント』 / 50 minute Engineering Leader
iwashi86
9
4.5k
設計は最強のプロンプト - AI時代に武器にすべきスキルとは?-
kenichirokimura
1
130
激動の2025年、Modern Data Stackの最新技術動向
sagara
0
870
技術の総合格闘技!?AIインフラの現在と未来。
ebiken
PRO
0
150
Copilotの精度を上げる!カスタムプロンプト入門.pdf
ismk
5
1.2k
30分でわかる!!『OCI で学ぶクラウドネイティブ実践 X 理論ガイド』
oracle4engineer
PRO
1
120
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
56
14k
Typedesign – Prime Four
hannesfritz
42
2.9k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
Product Roadmaps are Hard
iamctodd
PRO
55
11k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
34
2.3k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
36
6.1k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.1k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
Navigating Team Friction
lara
190
15k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
A Modern Web Designer's Workflow
chriscoyier
697
190k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1k
Transcript
Reformer: The Efficient Transformer Nikita Kitaev*, Lukasz Kaiser*, Anselm Levskaya*
*Google Research ICLR 2020 紹介者: 平尾 礼央(TMU, M1, 小町研究室) 26 May, 2020 @論文紹介
Abstract • Transformerの計算時間、メモリ使用量を効率化したReformerの提案 • Attention Weightが小さいものを計算するのは無駄 ➢ Locality Sensitive Hashingで近いものだけ計算
• 逆伝播のために各レイヤで値を保持しておくのがメモリを圧迫 ➢ Reversible Layerで逆伝播時に毎回計算 • Transformerと同程度の性能でメモリ効率を改善し、長い系列で高速化する 事に成功
Introduction • Transformerを使ったモデルは様々なNLPタスクでSoTA • 最近のモデルはレイヤ数、系列長が増加し、パラメータ数も膨大 • 計算資源がある限られた研究所だけが訓練できる • 計算が増える原因と対策: ◦
Attentionの計算では系列長Lに対して、時間、空間(メモリ)共に O(L^2)で増加 ➢ Locality Sensitive Hashingでクラスタに分け、近い単語のみを計算 ◦ レイヤ数がN倍になるとそれぞれのレイヤが格納しておくべき activationがN倍 ➢ Reversible Layerで全体で1つのactivation(1つ後のレイヤ出力)さえあればよい
Locality Sensitive Hashing(LSH) • Hash関数を使った近似近傍点探索アルゴリズム • n次元空間用のkd-treeのようなもの • k個のn-1次元の超平面を使用することで2^kクラスタに分けることができる https://www.researchgate.net/figure/Locality-sensitive-hashing-LSH_fig4_314300245
https://databricks.com/blog/2017/05/09/detecting-abuse-scale-locality-sensitive-hashing-uber-engineering.html https://www.youtube.com/watch?reload=9&v=LqcwaW2YE_c
Locality Sensitive Hashing Attention LSHによる ハッシュ化 同じグループ 同士で計算
Complexity in Attention Part • nr: ハッシュを繰り返す回数 ◦ LSHはシードによって異なる bucketに分けられる可能性があるため
• nc: LSHのchunk数 ◦ Lが長くなるほど増えるため、 L/ncが実質logL ➢ これでAttentionの計算量の問題は解決!では逆伝播は?
Reversible Residual Networks (Gomez et al. NIPS 2017) • 通常は順伝播時に各レイヤで値
(activation)を持っていないといけない • 下図のように各レイヤを反転すると元の値が求まるようにする • activationの数を全体で1/Lに出来る(L: レイヤ数)
Complexity of Reformer • Reversible Residual Networksと同様に各レイヤで反転できるように変更 • 空間、時間計算量共にLが取れてc(O(logL)) になっている
Experiments • データセット ◦ enwik8: 入力トークン64k ◦ imagenet64: 入力トークン12k •
パープレキシティカーブ(横軸: steps、縦軸: bpd(?)) ◦ 通常のTransformerとほぼ同じ
Translation Task • WMT2014 English-to-German ◦ オリジナルのTransformerとほぼ同じ
Number of Hashing and Layers • ハッシュは8回以上繰り返すことでオリジナルとほぼ一致 • レイヤ数を増やすほど改善
Speed of Transformer and Reformer • 系列長が1024程度だと従来のTransformerの方が高速 ◦ hash回数が1~4だと精度が落ちる •
系列長が2048以上になるとReformerの方が早い
Conclusion • ReformerはTransformerと同程度の表現力を持つ • 長い系列でも効率的に実行でき、レイヤ数が増えても少ないメモリ使用量で実行で きる • これにより、計算資源が少なくても大きいTransformerモデルを扱える • 時系列や動画、音楽など幅広い分野でTransformerを使うことできる