logoalt Hacker News

ec109685today at 2:40 PM4 repliesview on HN

Caching doesn’t work the way the bug reporter implies. Caches are shared (at least across the enterprise), but its key is always a function of the input before it.

We achieved significant savings simply by moving everything that varies across individuals out of the system prompt so every session starts from a cache point.

For example you never want your system prompt to start with the time that the session started. Move that to the first user message if needed.


Replies

macNchztoday at 2:51 PM

Caching is not supposed to work like that, but that doesn’t preclude the cache key computation function from having bugs.

show 2 replies
Waterluviantoday at 3:23 PM

There is a massive incentive for optimization, so I expect they’re doing a ton of very clever tricks, all of which make this kind of bug more likely.

estebarbtoday at 3:35 PM

Hash functions necesarily have collisions. Also, it is perfectly possible to introduce bugs in the hash function (hash inputs, hash function itself) that allows cross account contamination.

show 1 reply
supriyo-biswastoday at 2:53 PM

There could just also be a bug where the output tokens of session 1 were shared with session 2, due to a race condition or similar.