Reading library

Documentation

How inference caching works

A concrete account of keys, values, and the state reused during autoregressive generation.

On this page
  1. Why this is on the reading desk
  2. A question to keep

By Hugging Face. Read the original source.

Why this is on the reading desk

Useful for drawing the boundary between sequence state and a stored answer. Follow what is appended at a decoding step and what remains valid from earlier tokens.

A question to keep

A question for implementation: who owns the lifetime of a sequence cache, and what state is architecture-specific?