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] Feasible RAG: Hierarchical Multimodal Retrieval with Feasibility-Aware Embodied Memory for Mobile Manipulation
keio_smilab
PRO
0
130
[RSJ25] LILAC: Language‑Conditioned Object‑Centric Optical Flow for Open‑Loop Trajectory Generation
keio_smilab
PRO
0
75
[RSJ25] Multilingual Scene Text-Aware Multimodal Retrieval for Everyday Objects Based on Deep State Space Models
keio_smilab
PRO
0
82
[RSJ25] Everyday Object Manipulation Based on Scene Text-Aware Multimodal Retrieval
keio_smilab
PRO
1
62
[RSJ25] Enhancing VLA Performance in Understanding and Executing Free-form Instructions via Visual Prompt-based Paraphrasing
keio_smilab
PRO
0
110
[Journal club] Generalized Contrastive Learning for Multi-Modal Retrieval and Ranking
keio_smilab
PRO
0
58
[Journal club] Steering Your Generalists: Improving Robotic Foundation Models via Value Guidance
keio_smilab
PRO
0
55
[Journal club] Influence-Balanced Loss for Imbalanced Visual Classification
keio_smilab
PRO
0
18
[Journal club] Learning to Rematch Mismatched Pairs for Robust Cross-Modal Retrieval
keio_smilab
PRO
0
34
Other Decks in Technology
See All in Technology
dbt開発 with Claude Codeのためのガードレール設計
10xinc
2
1.3k
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
8.8k
[ JAWS-UG 東京 CommunityBuilders Night #2 ]SlackとAmazon Q Developerで 運用効率化を模索する
sh_fk2
3
450
新規プロダクトでプロトタイプから正式リリースまでNext.jsで開発したリアル
kawanoriku0
1
160
AI時代を生き抜くエンジニアキャリアの築き方 (AI-Native 時代、エンジニアという道は 「最大の挑戦の場」となる) / Building an Engineering Career to Thrive in the Age of AI (In the AI-Native Era, the Path of Engineering Becomes the Ultimate Arena of Challenge)
jeongjaesoon
0
220
RSCの時代にReactとフレームワークの境界を探る
uhyo
10
3.5k
自作JSエンジンに推しプロポーザルを実装したい!
sajikix
1
190
AWSで始める実践Dagster入門
kitagawaz
1
680
Firestore → Spanner 移行 を成功させた段階的移行プロセス
athug
1
490
Platform開発が先行する Platform Engineeringの違和感
kintotechdev
4
580
【NoMapsTECH 2025】AI Edge Computing Workshop
akit37
0
220
AI開発ツールCreateがAnythingになったよ
tendasato
0
130
Featured
See All Featured
Site-Speed That Sticks
csswizardry
10
820
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
252
21k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
188
55k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.1k
Testing 201, or: Great Expectations
jmmastey
45
7.7k
Build The Right Thing And Hit Your Dates
maggiecrowley
37
2.9k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
Why Our Code Smells
bkeepers
PRO
339
57k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Rebuilding a faster, lazier Slack
samanthasiow
83
9.2k
Building Adaptive Systems
keathley
43
2.7k
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 結果 高速かつ大規模モデルに匹敵する精度