# KV cache sizing

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fkv-cache-sizing%2F52010%3E%5C
**Category:** 🤗Transformers\
**Created:** [August 24, 2023, 5:21pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fkv-cache-sizing%2F52010 "2023-08-24T17:21:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sruthikesh](https://avatars.discourse-cdn.com/v4/letter/s/ee59a6/32.png) [@sruthikesh](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fsruthikesh)%5C
**Post date:** [August 24, 2023, 5:21pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fkv-cache-sizing%2F52010%2F1 "2023-08-24T17:21:17Z")

</div>

# KV cache sizing

Need help with understanding of KV cache

1. Is the KV cache fixed to a specific size (max\_seq\_length)? From generation utils it appears there is no limit to the size. IIUC `past_key_values` are always are forwarding without limiting the size
2. If yes, how are the older entries of KV cache replaced?

Thanks
