피드로 돌아가기
Perceiver IO: a scalable, fully-attentional model that works on any modality
Hugging Face BlogHugging Face Blog
AI/ML

Google DeepMind이 Perceiver IO를 HuggingFace Transformers에 추가해 텍스트, 이미지, 오디오, 비디오, 포인트 클라우드 등 모든 모달리티를 단일 아키텍처로 처리

Perceiver IO: a scalable, fully-attentional model that works on any modality

2021년 12월 15일8intermediate

Context

기존 Transformer 아키텍처는 Self-Attention 메커니즘으로 인해 입력 크기에 대해 이차 함수(quadratic) 계산 복잡도와 메모리 복잡도를 가진다. 고차원 데이터(이미지, 비디오, 오디오 등)에 Transformer를 적용하려면 Wav2Vec2의 Feature Encoder, ViT의 Patch 토큰화, ViViT의 Spatio-temporal Tubes 추출 등 모달리티별 전처리가 필수적이다.

Technical Solution

  • Latent 변수 기반 Self-Attention 도입: Self-Attention을 입력이 아닌 256~512개 Latent 변수에 적용해 계산 비용을 Latent Space로 이동
  • Cross-Attention으로 모달리티 입력 처리: 입력 데이터는 Latent 변수와의 Cross-Attention만 수행 (입력이 Key-Value, Latent가 Query 생성)
  • 선택적 Preprocessor 구현: 임베딩되지 않은 입력(텍스트, 이미지, 오디오, 비디오)을 전처리하는 선택적 모듈 추가
  • 선택적 Decoder 구현: Latent 최종 hidden state를 분류 로짓, Optical Flow 등 유용한 형태로 디코딩
  • 선택적 Postprocessor 구현: Decoder 출력을 특정 특성으로 후처리 (Auto-encoding 작업 시)

Key Takeaway

단일 아키텍처에서 모달리티별 전처리 및 후처리 모듈을 교체 가능하게 설계하면 Named-Entity Recognition, Question-Answering, Audio Classification, Object Detection 등 다양한 작업을 동일한 Encoder로 처리할 수 있다. 향후 여러 모달리티를 공유 Latent Space에서 통합 학습하는 방향이 가능하다.


멀티모달 처리가 필요한 엔지니어링 팀에서 Perceiver IO의 Preprocessor-Encoder-Decoder-Postprocessor 구조를 채택하면 모달리티별 Custom Encoder 개발을 제거하고 표준화된 Latent Space를 중심으로 작업을 병렬화할 수 있다. HuggingFace Transformers 구현을 기반으로 NER, QA, 오디오 분류, 객체 탐지 등 특정 작업을 위한 Decoder와 Postprocessor만 작성하면 된다.

원문 읽기