Abstract
We describe an efficient hierarchical method to compute attention in the Transformer architecture. The proposed attention mechanism exploits a matrix structure similar to the Hierarchical Matrix (H-Matrix) developed by the numerical analysis community, and has linear run time and memory complexity. We perform extensive experiments to show that the inductive bias embodied by our hierarchical attention is effective in capturing the hierarchical structure in the sequences typical for natural language and vision tasks. Our method is superior to alternative sub-quadratic proposals by over +6 points on average on the Long Range Arena benchmark. It also sets a new SOTA test perplexity on One-Billion Word dataset with 5x fewer model parameters than that of the previous-best Transformer-based models.- Anthology ID:
- 2021.acl-long.294
- Volume:
- Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers)
- Month:
- August
- Year:
- 2021
- Address:
- Online
- Venues:
- ACL | IJCNLP
- SIG:
- Publisher:
- Association for Computational Linguistics
- Note:
- Pages:
- 3801–3815
- Language:
- URL:
- https://aclanthology.org/2021.acl-long.294
- DOI:
- 10.18653/v1/2021.acl-long.294
- Cite (ACL):
- Zhenhai Zhu and Radu Soricut. 2021. H-Transformer-1D: Fast One-Dimensional Hierarchical Attention for Sequences. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 3801–3815, Online. Association for Computational Linguistics.
- Cite (Informal):
- H-Transformer-1D: Fast One-Dimensional Hierarchical Attention for Sequences (Zhu & Soricut, ACL-IJCNLP 2021)
- PDF:
- https://preview.aclanthology.org/paclic-22-ingestion/2021.acl-long.294.pdf
- Code
- additional community code
- Data
- Billion Word Benchmark, LRA