Mamba는 토큰 간 상호작용을 ‘이산’ 상태공간 방정식으로 모델링
State Space Equation adopted by Mamba
문제1 ) 2D → 1D scan
문제2) Long-range Decay
멀리 떨어진 픽셀 간 정보 상호작용↓
= interaction between pixels
Proof
[General Form]
= contribution of to the generation of
입력 간 거리가 멀어질수록 (k가 커질수록), 영향력 감소 = long-range decay
SSM ↔ Attention 대응관계

self.embeddingB = nn.Embedding(num_tokens, inner_rank) # [T, r]
self.embeddingA = nn.Embedding(inner_rank, d_state) # [r, d]
full_embedding = self.embeddingB.weight @ token.weight # [T, r] @ [r, d] = [T, d]embeddingB.weightembeddingA.weight
프롬프트의 목적
L=토큰 수=픽셀 수
Routing Strategy
과정
1) Flattened Input Feature:
2) Linear Layer +LogSoftmax:
①~②까지의 코드 확인
self.route = nn.Sequential(
nn.Linear(self.dim, self.dim // 3), # 축소 + feature embedding
nn.GELU(), # 비선형 활성화
nn.Linear(self.dim // 3, self.num_tokens), # ③ 최종 projection
nn.LogSoftmax(dim=-1) # log-prob 변환
)
pred_route = self.route(x) # [B, L, T]
3) Gumbel-Softmax:
③ 코드 확인
cls_policy = F.gumbel_softmax(pred_route, hard=True, dim=-1) # [B, L, T]
4) Instance-Specific Prompt:
④ 코드 확인
prompt = torch.matmul(cls_policy, full_embedding) # [B, L, d]
# 토큰마다 선택된 프롬프트의 임베딩
# cls_policy: [B, L, T] × full_embedding(=P): [T, d] -> [B,L,d]
Problem
Proposal : SGN(Semantic Guided Neighboring)
Tasks
Experimental Settings
Ablations with MambaIRv2-light 2× SR model trained for 250K iterations on the DIV2K dataset
Effectiveness of Different Components
Abalation on Attentive State-space Equation
Lightweight Image Super-Resolution
Classic Image Super-Resolution
Model Complexity Comparison
Benefits from Reduced Scan Directions
Visualization of Attentive State Space