Loading...
Implement KV-cache for efficient autoregressive inference.
During autoregressive generation, we cache previous K and V values. At each new step:
Input:
Output: For each step, the attention output vector (d floats), rounded to 4 decimal places.
Use causal attention (each step sees all previous + current).
2 2 1 0 1 0 1 0 0 1 0 1 0 1
[1.0000 0.0000] [0.2689 0.7311]