2026_prefixcache / README.md
lauyeeyu's picture
README: clearer citation key
c9a6a2a verified
|
Raw History Blame Contribute Delete
4.58 kB
---
license: cc-by-4.0
pretty_name: LLM Prefix-Cache Block Traces
tags:
- llm-serving
- inference
- kv-cache
- prefix-caching
- cache-eviction
- workload-trace
size_categories:
- 100K<n<1M
---
# LLM Prefix-Cache Block Traces
Two LLM inference traces at KV-block granularity, for studying prefix-cache eviction. Each request lists the KV blocks of its prompt in prefix order, so a simulator can replay which blocks a request reuses from earlier requests. **No text is released**: a block is an opaque integer id.
The dataset accompanies the paper *When Fancy Eviction Fails: Rethinking Cache Replacement For LLM Prefix Reuse* ([arXiv:2609.28870](https://arxiv.org/abs/2609.28870)).
Both traces are tokenized with the Qwen3-Coder-30B-A3B tokenizer and cut into 16-token blocks, so 1k blocks hold 1.5 GiB of that model's bf16 KV cache. Requests whose input plus output exceed the model's 262,144-token context are removed, so no request is longer than 16,374 blocks.
| File | Size | Workload | Requests | Block accesses | Distinct blocks | Sessions | Span |
|---|---:|---|---:|---:|---:|---:|---:|
| `freeinference.lcp.zst` | 76 MB | Coding and assistant agents on the FreeInference gateway, 2026-07-11 to 07-17 | 327,548 | 656,240,179 | 39,578,367 | 222,934 | 7.0 days |
| `chutes.lcp.zst` | 232 MB | Chat and roleplay on the Chutes inference proxy, 2026-03-10 to 07-19 | 515,817 | 603,642,254 | 139,518,804 | 402,221 | 130.9 days |
The request-level traces of these platforms are [harvardMadsys/freeinference_agentic_trace](https://huggingface.co/datasets/harvardMadsys/freeinference_agentic_trace) and [harvardMadsys/chutes_metadata](https://huggingface.co/datasets/harvardMadsys/chutes_metadata).
## Format
The files are in `lcp`, [libCacheSim](https://github.com/1a1a11a/libCacheSim)'s binary format for prefix-cache traces, compressed with zstd. Each request is a record followed by its block entries:
- **Request:** arrival and completion time (microseconds, relative), session and user id (chutes has no user ids), turn, and input and output token counts. A request's blocks become reusable when it completes, and requests are ordered by completion time.
- **Block entry:** the block id, and the position of the block's next access, so offline-optimal policies such as Belady run in one forward pass.
The full specification is [`doc/lcp_format.md`](https://github.com/1a1a11a/libCacheSim/blob/develop/doc/lcp_format.md).
## Usage
See [libCacheSim](https://github.com/1a1a11a/libCacheSim) for how to build and use the tools. In short:
```bash
hf download harvardMadsys/2026_prefixcache --repo-type dataset --local-dir 2026_prefixcache
git clone https://github.com/1a1a11a/libCacheSim
cd libCacheSim
cmake -G Ninja -B _build -DCMAKE_BUILD_TYPE=Release
ninja -C _build
# Replay a 16k-block (24 GiB) cache under three eviction policies.
./_build/bin/prefixsim --trace ../2026_prefixcache/freeinference.lcp.zst \
--cache-size 16k --algo lru,s3fifo,belady_compute \
--cost-model qwen3coder30b_blksz_16
# Print a trace's statistics, or convert it to JSONL.
./_build/bin/tracePrint ../2026_prefixcache/chutes.lcp.zst lcp --print-stat 1
./_build/bin/traceConvLLM --input ../2026_prefixcache/chutes.lcp.zst --output chutes.jsonl
```
`prefixsim` streams the compressed file: an LRU run over `freeinference.lcp.zst` takes about 2 minutes and 150 MiB of memory. Its [quickstart](https://github.com/1a1a11a/libCacheSim/blob/develop/doc/quickstart_prefixsim.md) explains the options and the output, and its [design document](https://github.com/1a1a11a/libCacheSim/blob/develop/doc/prefixsim.md) explains the cache model.
## Integrity
Each file is a single zstd frame with zstd's built-in content checksum, so `zstd -t <file>` checks it. SHA-256:
| File | SHA-256 |
|---|---|
| `freeinference.lcp.zst` | `39f75bbba1ce912546517802719ef7742d0db7fa53dcbc66681bba090aa5d1f7` |
| `chutes.lcp.zst` | `da57f89c74db817c121d24d3d6e4bc415eb7dd54aa72548c6971a991bd99970b` |
## License
This dataset is released under the [Creative Commons Attribution 4.0 International License (CC BY 4.0)](https://creativecommons.org/licenses/by/4.0/).
If you use this dataset, please cite the paper below.
## Citation
```bibtex
@misc{liu2026fancyeviction,
title = {When Fancy Eviction Fails: Rethinking Cache Replacement For LLM Prefix Reuse},
author = {Liu, Yiyu and Yu, Minlan and Yang, Juncheng},
year = {2026},
eprint = {2609.28870},
archivePrefix = {arXiv},
primaryClass = {cs.DC},
url = {https://arxiv.org/abs/2609.28870}
}
```