SparVAR: 시각적 오토리그래시브 모델링에서 희소성을 활용한 학습 불필요 가속화 연구
SparVAR: Exploring Sparsity in Visual AutoRegressive Modeling for Training-Free Acceleration
시각적 오토리그래시브(VAR) 모델링은 혁신적인 차원 예측 방식을 통해 상당한 주목을 받고 있습니다. 그러나 기존 VAR 모델은 각 오토리그래시브 단계에서 모든 과거 차원의 토큰에 주의를 기울입니다. 예측 차원의 해상도가 증가함에 따라 어텐션 연산의 계산 복잡도는 해상도에 대해 4차 함수적으로 증가하며, 이는 상당한 지연 시간을 초래합니다. 기존 가속화 방법은 종종 고해상도 차원을 건너뛰어 추론 속도를 높이지만, 이로 인해 고주파 상세 정보가 손실되고 이미지 품질이 저하됩니다. 이러한 문제점을 해결하기 위해, 우리는 학습이 필요 없는 가속화 프레임워크인 SparVAR를 제안합니다. SparVAR는 VAR 어텐션의 세 가지 특징, 즉 (i) 강한 어텐션 집중 영역, (ii) 차원 간 활성화 유사성, 그리고 (iii) 뚜렷한 지역성이라는 특징을 활용합니다. 구체적으로, 우리는 효율적인 인덱스 매핑 메커니즘을 통해, 비교적 낮은 해상도의 차원에서 후속 고해상도 차원의 희소 어텐션 패턴을 동적으로 예측하고, 차원 자체의 자기 유사성을 활용하여 희소 어텐션을 구성함으로써, 대규모 차원에서 고효율적인 희소 어텐션 연산을 가능하게 합니다. 또한, 우리는 차원 간 지역적 희소 어텐션을 제안하고, 효율적인 블록 기반 희소 커널을 구현하여 FlashAttention보다 $old{5배}$ 이상 빠른 연산 속도를 달성했습니다. 광범위한 실험 결과는 제안된 SparseVAR가 $1024 imes1024$ 고해상도 이미지를 생성하는 80억 파라미터 모델의 생성 시간을 1초 이내로 단축할 수 있으며, 마지막 차원을 건너뛰지 않고도 이를 달성할 수 있음을 보여줍니다. FlashAttention으로 가속화된 기존 VAR 모델과 비교했을 때, 우리의 방법은 $old{1.57배}$의 속도 향상을 제공하며, 거의 모든 고주파 상세 정보를 유지합니다. 기존 차원 건너뛰기 전략과 결합할 경우, SparseVAR는 최대 $old{2.28배}$의 가속화를 달성하며, 동시에 경쟁력 있는 시각적 생성 품질을 유지합니다. 코드 및 관련 자료는 https://github.com/CAS-CLab/SparVAR 에서 확인할 수 있습니다.
Visual AutoRegressive (VAR) modeling has garnered significant attention for its innovative next-scale prediction paradigm. However, mainstream VAR paradigms attend to all tokens across historical scales at each autoregressive step. As the next scale resolution grows, the computational complexity of attention increases quartically with resolution, causing substantial latency. Prior accelerations often skip high-resolution scales, which speeds up inference but discards high-frequency details and harms image quality. To address these problems, we present SparVAR, a training-free acceleration framework that exploits three properties of VAR attention: (i) strong attention sinks, (ii) cross-scale activation similarity, and (iii) pronounced locality. Specifically, we dynamically predict the sparse attention pattern of later high-resolution scales from a sparse decision scale, and construct scale self-similar sparse attention via an efficient index-mapping mechanism, enabling high-efficiency sparse attention computation at large scales. Furthermore, we propose cross-scale local sparse attention and implement an efficient block-wise sparse kernel, which achieves $\mathbf{> 5\times}$ faster forward speed than FlashAttention. Extensive experiments demonstrate that the proposed SparseVAR can reduce the generation time of an 8B model producing $1024\times1024$ high-resolution images to the 1s, without skipping the last scales. Compared with the VAR baseline accelerated by FlashAttention, our method achieves a $\mathbf{1.57\times}$ speed-up while preserving almost all high-frequency details. When combined with existing scale-skipping strategies, SparseVAR attains up to a $\mathbf{2.28\times}$ acceleration, while maintaining competitive visual generation quality. Code is available at https://github.com/CAS-CLab/SparVAR.
No Analysis Report Yet
This paper hasn't been analyzed by Gemini yet.