modulabs / beyondBERT

11.5기의 beyondBERT의 토론 내용을 정리하는 repository입니다.
MIT License
60 stars 6 forks source link

Reformer: The Efficient Transformer #11

Closed seopbo closed 4 years ago

seopbo commented 4 years ago

어떤 내용의 논문인가요? 👋

본 논문에서는 locality-sensitive hashing, chunk-wise processing, reversible layers 등을 통해 efficient하게 Transformer을 훈련할 수 있게 만들었습니다.

Abstract (요약) 🕵🏻‍♂️

Large Transformer models routinely achieve state-of-the-art results on a number of tasks but training these models can be prohibitively costly, especially on long sequences. We introduce two techniques to improve the efficiency of Transformers. For one, we replace dot-product attention by one that uses locality-sensitive hashing, changing its complexity from O(L2) to O(LlogL), where L is the length of the sequence. Furthermore, we use reversible residual layers instead of the standard residuals, which allows storing activations only once in the training process instead of N times, where N is the number of layers. The resulting model, the Reformer, performs on par with Transformer models while being much more memory-efficient and much faster on long sequences.

Transformer architecture은 현재 NLP의 공식 레시피이지만, 사이즈에 따라 성능이 좌우되는 특징 덕분에 64층이 넘는 레이어, 0.5B per layer 이상의 패러미터 등으로 구현됩니다. Industry 중심의 개발로, 영세 연구자의 single GPU로는 엄두도 내지 못하는 상황에 이르게 되었습니다.

Transformer 자체가 원래 이렇게 huge resource를 요구할까요? Embedding size 1024, batch size 8일 때 64K tokens를 위한 activation은 0.5B floats이고, 2GB 정도의 메모리를 필요로 하는데, 이 정도는 원래 큰 무리가 없어야 합니다. 그치만 학습이 부담되는 것은 다음과 같은 문제 때문!

따라서 본 논문에서는 다음과 같은 solution들을 제안합니다.

이 논문을 읽어서 무엇을 배울 수 있는지 알려주세요! 🤔

https://docs.google.com/document/d/1jKUTHgvNIpM8F5r9mfrN6MLyUJxPTv0MkQY_3XlmN2E/edit?usp=sharing

별도의 문서로 정리하였습니다 😆

같이 읽어보면 좋을 만한 글이나 이슈가 있을까요?

핑퐁의 Reformer 리뷰 Patrick 선생님과 함께하는 Reformer (총 4개의 시리즈) Illustrating the Reformer

레퍼런스의 URL을 알려주세요! 🔗

https://arxiv.org/abs/2001.04451

inmoonlight commented 4 years ago

[질문]

DataLama commented 4 years ago

[질문]

LSH self attention을 사용할 때, 학습 초기 단계에서 lsh로 bucketing할 때, initial weight에 대한dependent 되기 때문에 실제 문장내에서는 관계가 높은 두 토큰 간의 관계가 학습이 잘 안될수도 있지 않을까요??