트랜스포머는 다중 상태 RNN(순환 신경망)이다.
Transformers are Multi-State RNNs
January 11, 2024
저자: Matanel Oren, Michael Hassid, Yossi Adi, Roy Schwartz
cs.AI
초록
트랜스포머는 이전 세대의 최첨단 NLP 모델인 순환 신경망(RNN)과 개념적으로 다르다고 여겨져 왔습니다. 본 연구에서는 디코더 전용 트랜스포머가 사실상 무한 다중 상태 RNN(무제한 은닉 상태 크기를 가진 RNN 변형)으로 개념화될 수 있음을 보여줍니다. 또한, 사전 학습된 트랜스포머를 은닉 상태 크기를 고정함으로써 유한 다중 상태 RNN으로 변환할 수 있음을 입증합니다. 우리는 기존의 여러 트랜스포머 캐시 압축 기술이 이러한 변환 정책으로 설명될 수 있음을 관찰하고, 이러한 정책들에 비해 더 간단한 새로운 정책인 TOVA를 소개합니다. 여러 장거리 작업에 대한 실험 결과, TOVA는 다른 모든 기준 정책들을 능가하면서도 전체(무한) 모델과 거의 동등한 성능을 보이며, 경우에 따라 원본 캐시 크기의 1/8만 사용하는 것으로 나타났습니다. 우리의 결과는 트랜스포머 디코더 LLM이 실제로는 RNN처럼 동작하는 경우가 많음을 시사합니다. 또한, 이들이 가진 가장 큰 계산 병목 현상 중 하나인 캐시 메모리 크기를 완화할 수 있는 가능성을 제시합니다. 우리는 코드를 https://github.com/schwartz-lab-NLP/TOVA에서 공개합니다.
English
Transformers are considered conceptually different compared to the previous
generation of state-of-the-art NLP models - recurrent neural networks (RNNs).
In this work, we demonstrate that decoder-only transformers can in fact be
conceptualized as infinite multi-state RNNs - an RNN variant with unlimited
hidden state size. We further show that pretrained transformers can be
converted into finite multi-state RNNs by fixing the size of their
hidden state. We observe that several existing transformers cache compression
techniques can be framed as such conversion policies, and introduce a novel
policy, TOVA, which is simpler compared to these policies. Our experiments with
several long range tasks indicate that TOVA outperforms all other baseline
policies, while being nearly on par with the full (infinite) model, and using
in some cases only 1{8} of the original cache size. Our results
indicate that transformer decoder LLMs often behave in practice as RNNs. They
also lay out the option of mitigating one of their most painful computational
bottlenecks - the size of their cache memory. We publicly release our code at
https://github.com/schwartz-lab-NLP/TOVA.