Hacker News new | ask | show | jobs
by hedgehog 49 days ago
The thing that surprises me is that any of the popular harnesses break cache this way. Is it just an artifact of too much LLM code and not enough tests?
2 comments

One of the main things I've noticed is that several of the techniques are well intentioned for other reasons. For example, when we debug low cache rates with users probably culprit #1 is usually some memory system. Many of those memory systems are trading a stable prefix for the ability to augment the current turns request with some new memory data. For some -- this may be the right trade-off, but the impact is slower responses times due to the extra prefill compute.

So when a memory system promises better LLM performance the other trade-offs aren't necessarily well understood (at the expense of caching).

Features like OMP trying to clean up history to shrink context I think are also well intentioned. But I found these trade-offs interesting hence wanting to share.

I've never seen a case where mucking with the prefix to a long context pays off. Append a message to the session, do a compaction/truncation in the current session, or launch a sub-agent, all ways to inject new information from the harness without a big uncached read. I don't think that cache hit rate is very a useful metric to optimize for, much better to come up with an approximate cost model and benchmark task completions.
if you can, where do you work where this is something you help customers with?
They're the author of the post ;)

https://neuralwatt.com/about

thanks, missed that one

I recall this company now for their unintuitive/abstracted pricing model I have no interest in, but it does make clear why they would be helping customers with cache hit rates, that's going to lower bills on a per-request basis

It's easy to break the cache and there's a number of very valid usecases (mostly context management such as compaction or tool shaking).

Not to mention that it can be very strategic to break context. E.g, after chasing a bug for a while it does make sense to summarise all the approaches that did not work so that you have more context available for newer approaches.

Getting 99% cache hit rates while providing a good user experience is the hard part!

Compaction for sure, but putting git status in the system prompt? Why? (also I'm not sure about common approaches to compaction, they make context window management tricky and cost more generated tokens)
the fun ones are putting the current date in the system prompt, iirc OpenCode has fixed this, such that if your session spans day change, your cache does not bust
In all fairness, only Xiaomi and Deepseek have a long enough cache time for this to matter. As far as I know, most providers use a 5m cache timeout so unless you're working exactly around midnight your cache is more likely to be nuked by a distraction.