Submitted by enryu42 t3_122ppu0 in MachineLearning
Haycart t1_jdtcnc5 wrote
Reply to comment by liqui_date_me in [D] GPT4 and coding problems by enryu42
Where are they getting O(1) from? Has some new information been released regarding GPT-4's architecture?
The standard attention mechanism in a transformer decoder (e.g. GPT 1-3) has a time complexity of O(N^2) w.r.t. the combined input and output sequence length. Computing the output autoregressively introduces another factor of N for a total of O(N^3).
There are fast attention variants with lower time complexity, but has there been any indication that GPT-4 actually uses these? And in any case, I'm not aware of any fast attention variant that could be described as having O(1) complexity.
visarga t1_jdtypz6 wrote
Doesn't autoregressive decoding cache the states for the previous tokens when decoding a new token?
Haycart t1_jdu7hlp wrote
Oh, you are probably correct. So it'd be O(N^2) overall for autoregressive decoding. Which still exceeds the O(n log n) that the linked post says is required for multiplication, though.
Viewing a single comment thread. View all comments