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
[Journal club] LambdaNetworks: Modeling Long-R...
Search
Semantic Machine Intelligence Lab., Keio Univ.
PRO
September 03, 2021
Technology
0
220
[Journal club] LambdaNetworks: Modeling Long-Range Interactions Without Attention
Semantic Machine Intelligence Lab., Keio Univ.
PRO
September 03, 2021
Tweet
Share
More Decks by Semantic Machine Intelligence Lab., Keio Univ.
See All by Semantic Machine Intelligence Lab., Keio Univ.
[RSJ25] Multilingual Scene Text-Aware Multimodal Retrieval for Everyday Objects Based on Deep State Space Models
keio_smilab
PRO
0
7
[RSJ25] Everyday Object Manipulation Based on Scene Text-Aware Multimodal Retrieval
keio_smilab
PRO
0
35
[RSJ25] Enhancing VLA Performance in Understanding and Executing Free-form Instructions via Visual Prompt-based Paraphrasing
keio_smilab
PRO
0
7
[Journal club] Generalized Contrastive Learning for Multi-Modal Retrieval and Ranking
keio_smilab
PRO
0
49
[Journal club] Steering Your Generalists: Improving Robotic Foundation Models via Value Guidance
keio_smilab
PRO
0
51
[Journal club] Influence-Balanced Loss for Imbalanced Visual Classification
keio_smilab
PRO
0
15
[Journal club] Learning to Rematch Mismatched Pairs for Robust Cross-Modal Retrieval
keio_smilab
PRO
0
32
[Journal club] AuroraCap: Efficient, Performant Video Detailed Captioning and a New Benchmark
keio_smilab
PRO
0
43
[MIRU25] NaiLIA: Multimodal Retrieval of Nail Designs Based on Dense Intent Descriptions
keio_smilab
PRO
1
220
Other Decks in Technology
See All in Technology
Devinを使ったモバイルアプリ開発 / Mobile app development with Devin
yanzm
0
200
Vault meets Kubernetes
mochizuki875
0
100
「守る」から「進化させる」セキュリティへ ~AWS re:Inforce 2025参加報告~ / AWS re:Inforce 2025 Participation Report
yuj1osm
1
150
モダンな現場と従来型の組織——そこに生じる "不整合" を解消してこそチームがパフォーマンスを発揮できる / Team-oriented Organization Design 20250825
mtx2s
6
2.8k
認知戦の理解と、市民としての対抗策
hogehuga
0
390
[CV勉強会@関東 CVPR2025 読み会] MegaSaM: Accurate, Fast, and Robust Structure and Motion from Casual Dynamic Videos (Li+, CVPR2025)
abemii
0
200
JOAI発表資料 @ 関東kaggler会
joai_committee
1
430
『FailNet~やらかし共有SNS~』エレベーターピッチ
yokomachi
1
130
LLMエージェント時代に適応した開発フロー
hiragram
1
430
KINTO FACTORYから学ぶ生成AI活用戦略
kintotechdev
0
110
見てわかるテスト駆動開発
recruitengineers
PRO
6
1.6k
モバイルアプリ研修
recruitengineers
PRO
4
900
Featured
See All Featured
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
8
480
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
A Modern Web Designer's Workflow
chriscoyier
695
190k
How to train your dragon (web standard)
notwaldorf
96
6.2k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3.1k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.4k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4k
Embracing the Ebb and Flow
colly
87
4.8k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
900
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
50
5.5k
Scaling GitHub
holman
462
140k
Transcript
-BNCEB/FUXPSLT .PEFMJOH-POH3BOHF*OUFSBDUJPOT 8JUIPVU"UUFOUJPO 慶應義塾大学 杉浦孔明研究室 飯田 紡 Irwan Bello (Google)
ICLR 2021 Bello, I. (2021). Lambdanetworks: Modeling long-range interactions without attention. arXiv preprint arXiv:2102.08602.
എܠɿ"UUFOUJPOͷܭࢉྔଟ͍ Self-Attention シーケンス長 ! -> "(!!) 画像をFlattenして入力する場合 画像全体を入力は困難(256×256 → 256")
わずかな部分しか入力不可 画像全体との関係を捉えられない 1 I have a pen I 0.5 0.2 0.1 0.2 have 0.1 0.4 0.1 0.4 a 0.2 0.1 0.5 0.2 pen 0.2 0.2 0.1 0.5
ؔ࿈ݚڀ Attentionの計算量削減手法は汎用的 画像特有の構造を考慮しつつ画像全体を入力したい 2 Linear Transformer [Katharopoulos+, ICML20] Transformerを低ランク近似することで計算量削減 [Shazeer,
arXiv preprint19] Queryを分割することでattentionの計算量削減 ViT [Dosovitskiy+, arXiv preprint21] パッチ入力により画像にTransformerを適用 パッチは高解像度の画像やdetectionに応用できるか不明
ఏҊख๏ɿ-BNCEB/FUXPSLT 3 入力 Inputs: ! ∈ ℝ!×# Context: $
∈ ℝ$×# ! = $のときSelf-attentionと同等 出力 & ∈ ℝ!×# ': Query, (: Key, ): Value ' = !*% , ( = $*& , ) = $*' + Content Lambda Position Lambdas * ! + , - . / 0# = 2# $3# = 2% + 2# & $ 3# 5 = 2' , 2! , ⋯ , 2( 2# = 2% + 2# &
ఏҊख๏ɿ$POUFOU-BNCEB Attentionに対応 Key, Valueを集約後Queryに作用 → 計算量削減 4 + Position Lambdas
Content Lambda * ! + - . /
"UUFOUJPOͱ$POUFOU-BNCEBͷൺֱ 5 +(×* *+×* /(×, -!×# -+×, .+×* -!×# -!×!
8(×+ 9 8(×+ soft max ,(×* !, #の積でAttention map を作成 画像データでは一般に データ長 $, % : 大 &, ' ∶ 小さくできる(ハイパラ) 大きな ! × : を使用せずに ! × ; の出力できないか? Attention Layer
"UUFOUJPOͱ$POUFOU-BNCEBͷൺֱ 6 画像データでは一般に データ長 :, ! : 大 ;, <
∶ 小さくできる(ハイパラ) -, .の積で5%を作成 ! × : → k × ; Content Lambda +(×* *+×* /(×, -!×# -+×, .+×* -!×# -!×! ,(×* soft max ? -+×, 5% ,×* ※正確には.$と同じ/×0の Position Lambdasを足したものを1にかける
"UUFOUJPOͱ$POUFOU-BNCEBͷൺֱ 7 /(×, -+×, .+×* 8(×+ 9 8(×+ soft max
,(×* /(×, -+×, .+×* ,(×* soft max ? -+×, 5% ,×* " !:(< + ; ) " ! + : <; Attention Layer Content Lambda 2×3, 3×5行列の積は6(235) 時間計算量 空間計算量 " !: " <; ((*+)などもありえますが 後にO +. しか使わないので省略
ఏҊख๏ɿ1PTJUJPO-BNCEBT Positional Encodingに対応 ポジション1つ(1〜,)につき -×/の行列0を使用 0は全てのデータで同じ 時間計算量 1(,-/3) 空間計算量 1(,-/)
8 + Content Lambda Position Lambdas * ! + , - . / . +×* @' +×, 5' & ,×* 5! & ,×* 5( & ,×* … @( +×, …
ܭࢉྔͷൺֱ 9 時間計算量 空間計算量 Attention 6(9:; / + 0 )
6(9:;) Content only 6( : + ; /0) 6(9/0) Position only 6(9:;/0) 6(:;/) Lambda 6(9:;/0) 6(:;/ + 9:/0) 入力サイズ %×& , $×& バッチサイズ * !, #の大きさ ' 時間計算量 ほぼ等しい(工夫で高速化可能) 空間計算量 Positionは全部同じ → *に非依存 = 大きな%$がバッチサイズ非依存 → バッチサイズを大きくできる 画像サイズ224 × 224, バッチサイズ 128 Attention: 120 GB Lambda: 0.63 GB
ߴԽͷ Multi-Query Queryをℎ 個に分割 ! = [!! , !"
, ⋯ , !# ] 並列にlambdaを計算して結合 0 = 1 !! , 1 !" , ⋯ , 1 !# % → $ # より時間計算量 3 %$&'( # に(Key, Valueはそのまま) Lambda Convolution 計算量の多いPosition LambdasをCNNに置き換え 4) &×' = Conv2D(<) 11
ఆྔత݁Ռɿ-BNCEB͕BUUFOUJPO$//Λ্ճΔ 12 ResNet50の3 × 3Convを Layerに置き換え ImageNetの 224 ×224画像を使用 最も少ないパラメータ数で
Top-1 accuracy最大を達成
ఆྔత݁Ռɿܭࢉྔগ͔ͭਫ਼ྑ 13 Lambda Layerは • メモリ使用量 少 • Throughput 大
全レイヤーでpos lambdasを 共有しても精度は落ちない Attentionでは画像全体を使 用できない(Global ~) 9 ∶ バッチサイズ, ℎ ∶ ヘッド/クエリ数, : ∶ inputの長さ ; ∶ contextの長さ, / ∶ Q, Kのdepth, ? ∶ レイヤー数 画像全体 軸ごと クロップ
ఆྔత݁Ռɿগͳ͍ύϥϝʔλ͔ͭߴͰେܕϞσϧʹ ඖఢ͢Δਫ਼Λୡ 14 横軸:Trainにかかる時間 ≒ モデルサイズ LambdaResNet420, 画像サイズ320 LambdaResNet350, 画像サイズ320
350 epochの訓練をしたとき 3〜4倍高速でEfficientNetに匹敵 ViTには劣るものの、非常に高速
"CMBUJPO4UVEJFT 16 Content, Position片方のみを使用 Positionが精度に大きく貢献 ConvとLambdaの併用 前方にL → Throughput低下 後方にL
→ Throughputそのまま 後ろ2つL → 精度向上かつ高速
·ͱΊ 17 背景 Attentionの計算量削減 提案 先にKey, ValueをまとめるLambda Networks 結果 高速かつ大規模モデルに匹敵する精度