TL;DR
- I read this because.. : Qwen3-VL์์ ์ฌ์ฉํ๋ค๋ interleaved mRoPE ๊ฐ ์ดํด๊ฐ ์๋์ด์.
- task : RoPE in video LLM
- problem : mRoPE์์ head dimension์ 3๋ฑ๋ถ ํด์ ์ฌ์ฉํ๋๋ฐ, temporal ์ฐจ์์ด ์๋ถ๋ถ์ ํ ๋น๋๋๊ฒ ์ด์ํ๋ค.
- idea : temporal์ ๊ฐ์ฅ ๋ค๋ก (low frequency)๋ก ํ ๋นํ์.
- input/output : {video, question} -> answer
- architecture : ViT from Qwen2-7B, Qwen-7B LLM
- objective : CE loss
- baseline : Vanilla RoPE, mRoPE, RoPE-TIE
- data : 1.3M video pair from LLaVA-Video-178k
- evaluation : LongVideoBench, MLVU, Video-MME, V-NIAH, V-NIAH-D(proposed)
- result : Video-MME๋ฅผ ์ ์ธํ๊ณ ์ฑ๋ฅ์ด ๋ ์ข๊ณ , extrapolate๋ ๋ ์ํ๋๋ฏ.
- contribution : ๊ฐ๋จ sota
- etc. :
Details
Exisiting
- RoPE general
watch here
Q์ K์ ๊ฐ๊ฐ ๊ฐ๋ ๋ณํ ([[cos, -sin], [sin, cos]]) ์ ์ํค๋๋ฐ, ์ด ๊ฐ๋ ๋ณํ์ ์ํจ๊ฑธ self-attention ์ฐ์ฐ์ ํ๊ฒ ๋๋ฉด (m-n) (์๋ ๊ฑฐ๋ฆฌ)์ ๋ํ ๊ฐ๋๋ณํ์ผ๋ก๋ง ๋์ค๊ฒ ๋จ.
์ด๋ ์ฐ๋ฆฌ์ Q, K ๋ฒกํฐ๋ 2์ฐจ์์ด ์๋๋ผ n์ฐจ์์ด๊ธฐ ๋๋ฌธ์ ์ด์ ๋ํ trick์ผ๋ก ๊ฐ๊ฐ 2๋ก ๋๋ ์ ์ rotation weight ์ฐ์ฐ์ ํด์ฃผ๊ฒ ๋จ.
์ด๋ ์ ๊ธฐ ๊ณฑํด์ง๋ theta๊ฐ dimension์ด ๋์์๋ก (๋ค์ ์๋ dimension์ผ ์๋ก) ์์์ ธ์ (m-n)์ ๋ณํ์ ์กฐ๊ธ ์ฉ ์์ง์ด๋ low-frequency๊ฐ ๋จ.
์์ $R_{\theta,m}^d$ ์์ position ids(=m)์ ๊ตฌํ๋ ๊ณ์ฐ์๋ง (w, h, t)๋ก ๋๋์ด์ง๋ค๊ณ ๋ณด๋ฉด ๋จ.
# Q = [batch size, n heads, query len, head dim]
# K = [batch size, n heads, key len, head dim]
# V = [batch size, n heads, value len, head dim]
# k.permute(0, 1, 3, 2) = [batch size, n heads, head dim, key len]
energy = torch.matmul(Q, K.permute(0, 1, 3, 2)) / self.scale
# energy = [batch size, n heads, query len, key len]
๋ถ๋๋ฝ์ง๋ง ํท๊ฐ๋ ธ๋๋ฐ head_dim ๋ผ๋ฆฌ dot product๋ฅผ ํด์ scalar๋ฅผ ๊ตฌํ๋ ๊ฑฐ๊ธฐ ๋๋ฌธ์ ์ด๊ฑธ ๋๋ ์ dot product๋ก ํด์ ๋ํด๋ ๊ฐ์ ๊ฒ์ ใ ใ ;
why is this wrong?
Round and Round We Go! What makes Rotary Positional Encodings useful? https://arxiv.org/abs/2410.06205 high frequency๋ local ํ ์ ๋ณด๋ฅผ ๋ฝ๊ณ low frequency๋ long context๋ฅผ ๋ฝ๋๋ค๋ ๊ด์ฐฐ.