Caching stores reusable data or computation results so later work can avoid repeating retrieval or computation. In autoregressive generation, past tokens stay fixed, so their attention keys and values can be reused across steps. section 16.2.3
Two practical uses show what caching avoids:
- Generation: cache past key and value vectors at each Transformer layer instead of recomputing them for the growing sequence. section 16.2.3
- TPU training: for a small-enough dataset, call dataset.cache() to keep it in virtual-machine memory and read it from Google Cloud Storage only once. section 18.2.3





































