Long-Context Inference
Overview This post is divided into four parts; they are: • The Cost of a Long Context • Chunked Prefill • Managing Long-Lived KV State • Selecting Useful Context The Cost of a Long Context For full causal attention over a prompt of $N$ tokens, prefill attention computes a triangular portion of an $N \times N$ score matrix.
We haven't written up this one. Machine Learning Mastery has the full story — the link below goes straight to it.
Source: machinelearningmastery.com