4 ms·
Sharing a comment from a similar line of discussion: """ Complexity is quadratic in sequence length. For 512 tokens it is 262K, but for 4000 tokens it becomes
by dpflan 4y ago
Sharing a comment from a similar line of discussion:
"""
Complexity is quadratic in sequence length. For 512 tokens it is 262K, but for 4000 tokens it becomes 16M and goes OOM on a single GPU. We need about 100K-1M tokens to load whole books at once.
Since 2017 there have been hundreds of attempts to bring O(N^2) to O(N), but none of them replaced the vanilla attention yet in large models. They lose on accuracy. Maybe Flash attention has a shot (https://arxiv.org/abs/2205.14135 https://arxiv.org/abs/2205.14135).
"""
- source: https://news.ycombinator.com/item?id=34171503 https://news.ycombinator.com/item?id=34171503
- whimsicalism 4y agoThere is literally no way that GPT-4 is using classic O(N^2) attention exclusively. They haven't released the results, but I promise you this is not what they are using exclusively.
- anthlax 4y agoInteresting! How do you know this?