I don't see how you could fit causal masking into this framework without having to do n different FFTs, and there's no mention of positional embeddings either, so I guess the self-attention implementation being compared against is noncausal NoPE, which would make this a case of baseline sandbagging and maybe not so impressive. If the results were close to state-of-the-art, probably the author would've mentioned it?
They do show their model as winning every category in Long Range Arena (LRA) benchmark. Hopefully they have not excluded losing categories or better models.
The FFT Strikes Back: An Efficient Alternative to Self-Attention
41–50 of 175 posts
Re: The FFT Strikes Back: An Efficient Alternative to Self-Attention
#42Can someone confirm the big O time complexities of 1. traditional Self-Attention; 2. Flash-Attention? 3. Any novel others?
Mamba is O(n). But I guess it has other drawbacks.
Re: The FFT Strikes Back: An Efficient Alternative to Self-Attention
#43OK, I admit that the math flies way over my head and I barely understand the text around the math. Can someone please explain (in basic English) how this is equivalent to attention mechanism? What friquencies does it talk about? How does it encode positional relations between tokens?
You can see conceptually how this is similar to a convolution with some simplification, e.g. https://openreview.net/pdf?id=8l5GjEqGiRG
Convolutions are often used in contexts where you want to account for global state in some way. - https://openreview.net/pdf?id=8l5GjEqGiRG
Re: The FFT Strikes Back: An Efficient Alternative to Self-Attention
#44I am very out of my depth here haha with the math, appreciate those below taking the time to baby walk me along with the understanding! Great links too!
Re: The FFT Strikes Back: An Efficient Alternative to Self-Attention
#45Re: The FFT Strikes Back: An Efficient Alternative to Self-Attention
#46Man, this all really gets increasingly more complex in increasingly complex math…
matrix multiplications and some very simple activation functions (plus automatic derivates, some magic and some scientific glasses which you can ignore)
Re: The FFT Strikes Back: An Efficient Alternative to Self-Attention
#47I would like to see additional experiments using the lesser known Fourier transform over finite groups [1], which is permutation invariant but shares many properties with the standard Fourier transform.
I also wonder if this becomes the next big thing for LLMs, how easy will it be for inference engines(eg vLLM, llama.cpp) to integrate it?
[1] https://en.wikipedia.org/wiki/Fourier_transform_on_finite_gr...
Re: The FFT Strikes Back: An Efficient Alternative to Self-Attention
#48Can someone confirm the big O time complexities of 1. traditional Self-Attention; 2. Flash-Attention? 3. Any novel others?
Mamba is O(n). But I guess it has other drawbacks.
Operation Type|Mamba Complexity|Transformer Complexity
Training(per iteration)|O(L)|O(L^2)
Autoregressive Inference(per step)|O(T)|O(L)
Memory Requirements|O(C)|O(L)
Where: L stands for the sequence length. T denotes a fixed constant that accounts for compression and selection time in Mamba's autoregressive inference. C reflects the fixed size of the SSM (State Space Model) latent state in Mamba
Re: The FFT Strikes Back: An Efficient Alternative to Self-Attention
#49Google introduced this idea in 2022 with "FNet: Mixing Tokens with Fourier Transforms" [0]. Later they found out that, performance of their TPU(s) for matrix multiplication was faster than FFT in the most scenarios. [0]: https://arxiv.org/abs/2105.03824
That seems like an odd comparison, specialty hardware is often better, right? Hey, do DSPs have special hardware to help with FFTs? (I’m actually asking, this isn’t a rhetorical question, I haven’t used one of the things but it seems like it could vaguely be helpful).
Re: The FFT Strikes Back: An Efficient Alternative to Self-Attention
#50Machines going to be thinking in the frequency domain. We cooked.