Search

How Attentive are Graph Attention Networks?

Person
Files & media
Journal / Conference
ICLR
Progress
Done
Year
2022
๋น„๊ณ 
Index

Abstract

Graph Attention Networks (GATs) are one of the most popular GNN architectures and are considered as the state-of-the-art architecture for representation learning with graphs.
In GAT, every node attends to its neighbors given its own representation as the query.
However, in this paper we show that GAT computes a very limited kind of attention: the ranking of the attention scores is unconditioned on the query node.
We formally define this restricted kind of attention as static attention and distinguish it from a strictly more expressive dynamic attention.
Because GATs use a static attention mechanism, there are simple graph problems that GAT cannot express: in a controlled problem, we show that static attention hinders GAT from even fitting the training data.
To remove this limitation, we introduce a simple fix by modifying the order of operations and propose GATv2:a dynamic graph attention variant that is strictly more expressive than GAT.
We perform an extensive evaluation and show that GATv2 outperforms GAT across 12 OGB and other benchmarks while we match their parametric costs.

์„ธ ์ค„ ์š”์•ฝ

1. ๋‹ค๋“ค GAT๋กœ ์ด๊ฑฐ(Veliฤkoviฤ‡ et al.) ์“ฐ๋˜๋ฐ,

2. ๊ทธ๊ฑฐ ์“ฐ๋ฉด Attention์ด staticํ•˜๋”๋ผ

์ฆ๋ช…
query์— ๊ด€๊ณ„ ์—†์ด ๋™์ผํ•œ key(k8)์— ๊ฐ€์žฅ ์ ์ˆ˜๊ฐ€ ๋†’์Œ. ์ ์ˆ˜๋“ค์˜ ์ˆœ์„œ๋„ k8 > k6 > ~~ ์œผ๋กœ ๋ชจ๋‘ ๋™์ผ.
โ€ข
static attention := ๋ชจ๋“  query์— ๋Œ€ํ•ด ์ตœ๊ณ  attention score์„ ๋ฐ›๋Š” key๊ฐ€ ๋™์ผํ•จ
โ€ข
์‹ฌ์ง€์–ด (Veliฤkoviฤ‡ et al.)๊ฑฐ ์“ฐ๋ฉด query์— ์ƒ๊ด€์—†์ด key๋“ค์˜ attention score ranking๊นŒ์ง€ ๋™์ผํ•จ
โ€ข
๊ฒฝํ—˜์ ์œผ๋กœ๋งŒ ๊ทธ๋Ÿฐ ๊ฒŒ ์•„๋‹ˆ๋ผ, ํ•ญ์ƒ ๊ทธ๋ ‡๋‹ค๋Š” ์ฆ๋ช…๋„ ํ•  ์ˆ˜ ์žˆ์Œ.
โ€ข
attention์€ query์— ๋งž๊ฒŒ key๋ฅผ ์ž˜ ๊ณจ๋ผ์•ผ ํ•˜๋Š” ๋ชจ๋“ˆ์ธ๋ฐ, query์— ์ƒ๊ด€ ์—†์ด ๋˜‘๊ฐ™์€ key์—๋งŒ ์ง‘์ค‘ํ•˜๋Š” attention์ด๋ฉด ์จ ๋จน๊ฒ ์Œ?

3. ๊ทธ๋ž˜์„œ ์šฐ๋ฆฌ๊ฐ€ ์—ฐ์‚ฐ ์ˆœ์„œ๋งŒ ๋ฐ”๊ฟ” ๋ดค๋”๋‹ˆ(GATv2) ์ด์ œ static ํ•˜์ง€ ์•Š์Œ

query์— ๋”ฐ๋ผ ์„œ๋กœ ๋‹ค๋ฅธ key์— ์ง‘์ค‘ํ•˜๊ฒŒ ๋จ
โ€ข
12๊ฐœ ๋ฒค์น˜๋งˆํฌ๋กœ ์„ฑ๋Šฅ ํ…Œ์ŠคํŠธํ•ด๋ดค๋”๋‹ˆ GAT๋ณด๋‹ค GATv2๊ฐ€ ๋” ์ž˜ํ•จ.

์‹คํ—˜ ๊ฒฐ๊ณผ๋“ค

1. DictionaryLookup

โ€ข
Dynamic Attention์ด ๋˜๋Š”์ง€๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋Š” ํ•ฉ์„ฑ ๋ฐ์ดํ„ฐ์…‹
โ€ข
Query Node(attribute๋งŒ ์žˆ์Œ)์™€ Key Node(attribute, value๊ฐ€ ๋ชจ๋‘ ์žˆ์Œ)๊ฐ€ ์ฃผ์–ด์กŒ์„ ๋•Œ, Query Node์— ๋Œ€ํ•ด value๋ฅผ ์˜ˆ์ธกํ•˜๋Š” ๋ฌธ์ œ
โ€ข
query node์— ๋Œ€ํ•ด ๋™์ผํ•œ attribute๋ฅผ ๊ฐ–๋Š” key node์— ์ง‘์ค‘ํ•˜์—ฌ ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•  ์ˆ˜ ์žˆ์Œ
โ€ข
์„ฑ๋Šฅ?
โ—ฆ
GATv2๋Š” v1 ํ•˜์ดํผํŒŒ๋ผ๋ฏธํ„ฐ ๊ทธ๋Œ€๋กœ ์“ฐ๊ณ , ํŒŒ๋ผ๋ฏธํ„ฐ ์ˆซ์ž๋„ ๋™์ผํ•˜๊ฒŒ ๋งž์ถฐ์คฌ๋Š”๋ฐ๋„ ์„ฑ๋Šฅ์ด ์›”๋“ฑํ•˜๋‹ค.
โ—ฆ
์• ์ดˆ์— GATv1๋Š” head๊ฐ€ ํ•˜๋‚˜์ผ ๋•Œ๋Š” ํ•™์Šต๋„ ๋˜์ง€ ์•Š์•˜๊ณ , head๊ฐ€ ๋Š˜์–ด๋‚˜๋Š” ์กฑ์กฑ ๊ฒ€์ฆ ์„ฑ๋Šฅ์ด ์˜ฌ๋ผ๊ฐ„๋‹ค(ํ‘œํ˜„๋ ฅ์ด ์ œํ•œ์ ์ด๋‹ค).
โ—ฆ
GATv2๋Š” ํ—ค๋“œ๊ฐ€ ํ•˜๋‚˜์—ฌ๋„ ์„ฑ๋Šฅ์ด ์ข‹๋‹ค: ์ผ๋ฐ˜ํ™” ์„ฑ๋Šฅ์ด ์ด๋ฏธ ๋›ฐ์–ด๋‚˜๋‹ค.

2. Robustness to Noise

โ€ข
๋‘ ๊ฐœ์˜ Node Prediction ๋ฌธ์ œ(ogbn-arxiv|mag)์—์„œ, ์‹ค์ œ ๊ทธ๋ž˜ํ”„์— ์—†๋Š” ์—ฃ์ง€๋ฅผ p์˜ ๋น„์œจ๋กœ ์ž„์˜๋กœ ์ถ”๊ฐ€ํ•˜์—ฌ(๋…ธ์ด์ฆˆ) Task ์„ฑ๋Šฅ์„ ํ™•์ธ
โ€ข
์—ญ์‹œ GATv2๊ฐ€ ๋” ์„ฑ๋Šฅ ์ข‹๋‹ค.
โ€ข
dynamic attention์ด ๋…ธ์ด์ฆˆ์™€ ๋…ธ์ด์ฆˆ๊ฐ€ ์•„๋‹Œ ์—ฃ์ง€๋ฅผ ๊ตฌ๋ถ„ํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋˜๊ธฐ ๋•Œ๋ฌธ์ผ ๊ฒƒ์ด๋‹ค.

3. VarMisuse: Node-Pointing Problem

VarMisuse
โ€ข
์ž…๋ ฅ์— ๋Œ€ํ•œ ์ตœ์  ๋…ธ๋“œ๋ฅผ ์„ ํƒํ•˜๋Š” ๋ฌธ์ œ
โ€ข
๋…ธ๋“œ ๊ฐ„ ์ƒํ˜ธ์ž‘์šฉ ์ข…๋ฅ˜๊ฐ€ ๋ณต์žก๋‹ค์–‘(11์ข…์˜ ์ƒํ˜ธ์ž‘์šฉ)
โ€ข
์—ญ์‹œ v2>v1

4. Node-Prediction

โ€ข
๋…ธ๋“œ์˜ ์†์„ฑ์„ ์˜ˆ์ธกํ•˜๋Š” ๋ฌธ์ œ
โ€ข
v2 > v1
โ€ข
proteins ๋ฌธ์ œ์—์„œ v1๋Š” ํ—ค๋“œ ์ˆ˜๋ฅผ ๋Š˜๋ ค์•ผ ์ž˜ํ•˜์ง€๋งŒ, v2๋Š” ํ—ค๋“œ ํ•˜๋‚˜๋„ ์ถฉ๋ถ„ํžˆ ์ž˜ํ•œ๋‹ค

5. Graph-Prediction

โ€ข
๊ทธ๋ž˜ํ”„ ์ž์ฒด์˜ ์†์„ฑ์„ ์˜ˆ์ธกํ•˜๋Š” ๋ฌธ์ œ
โ€ข
v2 > v1
โ€ข
๊ทผ๋ฐ ๋ช‡๋ช‡ ์†์„ฑ์— ๋Œ€ํ•ด์„œ๋Š” Attention์ด ์—†๋Š” ์นœ๊ตฌ๋“ค์ด ๋” ์ž˜ํ•œ๋‹ค.

6. Link-Prediction

โ€ข
๋…ธ๋“œ ๊ฐ„ ์—ฐ๊ฒฐ ๊ด€๊ณ„๋ฅผ ์˜ˆ์ธกํ•˜๋Š” ๋ฌธ์ œ
โ€ข
v2 > v1
โ€ข
๊ทผ๋ฐ Attention์ด ์—†๋Š” ์นœ๊ตฌ๋“ค์ด ํ›จ์”ฌ ๋” ์ž˜ํ•œ๋‹ค. ์™œ?
โ—ฆ
๊ฐ€์„ค: ํ‰๊ท ์ ์œผ๋กœ high-degree์ธ ๊ทธ๋ž˜ํ”„์—์„œ attention์ด ๋” ์ ํ•ฉํ•  ๊ฒƒ
โ—ฆ
ogbn-proteins(avg deg=597), ogbn-products(avg deg=50.5)์—์„œ๋Š” attention ์žˆ๋Š” ๋ชจ๋“ˆ๋“ค์ด ๋” ์ž˜ํ–ˆ์Œ
โ—ฆ
dynamic attention ์„ฑ์งˆ์€ degree๊ฐ€ ๋†’๊ณ  relevant ๋…ธ๋“œ๋ฅผ ์ž˜ ์„ ํƒํ•ด์•ผ ํ•˜๋Š” ๊ฒฝ์šฐ์— ์œ ์šฉํ•  ๊ฒƒ

๊ฒฐ๋ก 

static attention๋ฐ–์— ์•ˆ ๋˜๋Š” ๋ฌธ์ œ์˜ ์‹ค์ œ ๋ฐ์ดํ„ฐ์…‹์—์„œ์˜ ํ•œ๊ณ„๋ฅผ ์ง€๋ชฉํ•œ ๊ฑด ์šฐ๋ฆฌ๊ฐ€ ์ฒ˜์Œ์ด๋‹ค.
Velickovic๋„ GATv1์€ global node importance๊ฐ€ ์ ์šฉ๋˜๋Š” ์ƒํ™ฉ์—์„œ ์ข‹๋‹ค๊ณ  ์–˜๊ธฐํ–ˆ๋‹ค.
๊ทธ๋ž˜์„œ ์—ฐ์‚ฐ ์ˆœ์„œ๋งŒ ๋ฐ”๊ฟ”์„œ v2 ๋งŒ๋“ค์—ˆ๋‹ค. ์—ฐ์‚ฐ ๋ณต์žก๋„ ๋™์ผํ•œ๋ฐ dynamic attention ๋˜๊ณ  ์„ฑ๋Šฅ์€ ๋” ๋›ฐ์–ด๋‚˜๋‹ค.