Skip to main content
QUICK REVIEW

[논문 리뷰] QKFormer: Hierarchical Spiking Transformer using Q-K Attention

Chenlin Zhou, Han Zhang|arXiv (Cornell University)|2024. 03. 25.
Advanced Memory and Neural ComputingEngineering인용 수 6
한 줄 요약

QKFormer는 선형 복잡도의 스파이크 형 Q-K 어텐션과 패치 임베딩 Deformed Shortcut을 도입하여, 계층적 스파이킹 트랜스포머를 가능하게 하고 기존의 SNN 모델을 ImageNet-1k 및 다른 데이터셋에서 직접 학습해 성능을 상회합니다.

ABSTRACT

Spiking Transformers, which integrate Spiking Neural Networks (SNNs) with Transformer architectures, have attracted significant attention due to their potential for energy efficiency and high performance. However, existing models in this domain still suffer from suboptimal performance. We introduce several innovations to improve the performance: i) We propose a novel spike-form Q-K attention mechanism, tailored for SNNs, which efficiently models the importance of token or channel dimensions through binary vectors with linear complexity. ii) We incorporate the hierarchical structure, which significantly benefits the performance of both the brain and artificial neural networks, into spiking transformers to obtain multi-scale spiking representation. iii) We design a versatile and powerful patch embedding module with a deformed shortcut specifically for spiking transformers. Together, we develop QKFormer, a hierarchical spiking transformer based on Q-K attention with direct training. QKFormer shows significantly superior performance over existing state-of-the-art SNN models on various mainstream datasets. Notably, with comparable size to Spikformer (66.34 M, 74.81%), QKFormer (64.96 M) achieves a groundbreaking top-1 accuracy of 85.65% on ImageNet-1k, substantially outperforming Spikformer by 10.84%. To our best knowledge, this is the first time that directly training SNNs have exceeded 85% accuracy on ImageNet-1K. The code and models are publicly available at https://github.com/zhouchenlin2096/QKFormer

연구 동기 및 목표

  • 비전 과제에서 에너지 효율이 높고 성능이 우수한 스파이킹 신경망을 동기화합니다.
  • 직접 학습(비컨버전)으로 학습 가능한 계층적 스파이킹 트랜스포머를 개발합니다.
  • 선형 복잡도의 스파이크 형 Q-K 어텐션 메커니즘을 제안합니다.
  • 정보 흐름을 개선하기 위해 Deformed Shortcut을 적용한 Patch Embedding 모듈을 설계합니다.
  • ImageNet-1k 및 기타 데이터셋에서 최첨단 결과를 입증합니다.

제안 방법

  • 스파이크 형 Query(Q)와 Key(K)를 사용하여 토큰 및 채널 중요도를 선형 복잡도로 계산하는 Q-K 어텐션을 제안합니다.
  • Q-K 어텐션을 Q-K 토큰 어텐션(QKTA)과 Q-K 채널 어텐션(QKCA)으로 분해하고 스파이크 기반 마스킹과 간단한 집계로 구현합니다.
  • 패치 임베딩에서 Deformed Shortcut(PEDS)을 통합하여 패치 임베딩에서 잔차 학습이 가능하도록 합니다.
  • 토큰 수를 점진적으로 줄이고 채널 차원을 증가시키는 세 단계의 계층적 스파이킹 트랜스포머(QKFormer)를 구축합니다.
  • 스파이킹 도메인에서 직접 모델을 학습하고 Spiking MLP(SMLP)와 최종 FC 계층으로 분류합니다.
  • ImageNet-1k, CIFAR-10/100, CIFAR10-DVS, DVS128 Gesture 등에서 퍼포먼스와 효율성을 검증하는 광범위한 실험을 제공합니다.

실험 결과

연구 질문

  • RQ1스파이크 형 Q-K 어텐션이 선형 계산 복잡도를 달성하면서도 스파이킹 신경망에서 토큰 및 채널 중요도를 효과적으로 모델링할 수 있는가?
  • RQ2Q-K 어텐션을 갖춘 계층적 스파이킹 구조를 도입하면 대규모 비전 작업에서 기존 SNN 트랜스포머보다 성능이 개선되는가?
  • RQ3Deformed Shortcut(PEDS) 기법이 스파이킹 트랜스포머의 정보 전달 및 정확도를 향상시키는가?
  • RQ4직접 학습된 SNN이 합리적인 시간 스텝으로 ImageNet-1k에서 85%대 Top-1 정확도에 도달하거나 초과할 수 있는가?

주요 결과

  • QKFormer는 4 time steps에서 ImageNet-1k에 대해 85.65% Top-1 정확도와 64.96M 매개변수(논문에서 최상의 수치)로 달성합니다.
  • QKFormer는 유사한 모델 크기에서 Spikformer보다 10.84p(85.65% vs 74.81%) 높은 성능을 보입니다.
  • 본 연구에서 처음으로 QKFormer의 직접 학습된 SNN이 ImageNet-1k에서 85% Top-1 정확도를 넘었습니다.
  • Q-K 어텐션은 선형 시간/공간 특성을 가지며 QKTA와 QKCA로 스파이크 형 연산을 통해 토큰- 및 채널 차원의 강조를 가능하게 합니다.
  • PEDS는 CIFAR100에서의 정확도 상승(+2.05%), CIFAR10-DVS에서의 상승(+1.3%) 등, 기저 Spikformer 대비 측정 가능한 정확도 향상을 제공합니다.
  • QKFormer는 정적 데이터셋과 뉴로모픽 데이터셋 모두에서 강력한 성능을 보이며, 제곱(attention) 대비 메모리 및 에너지 특성에서도 우수한 성능을 보여 줍니다.

이 논문 읽기

누빈트 뷰어에서 원문을 열고, 읽으면서 궁금한 곳을 바로 물어보세요.

누빈트에서 이 논문 읽기

이 리뷰는 AI가 논문 원문을 바탕으로 만들었습니다. 인용하기 전에 원문을 확인해 주세요.