by kiproping · 6mo ago · 0 comments
They explain some of the the reasons why they have a better solution and why they are very opinionated
>Automatic prefix caching activates only when the exact byte prefix of the previous request matches. Most agent loops reorder, rewrite, or inject fresh timestamps each turn — cache hit rate in practice: <20%.
So they optimize on this plus other techniques to improve cache hits, making it cheaper.
They do this to mitigate jailbreak attempts that rely on fabricated message history (e.g. making it look like the model was compliant in previous messages, increasing the likelihood that it'll continue to be compliant in future messages).
That's really surprising, since it'd defeat the whole point of KV caching. I mean I buy it considering how sloppily coded the harnesses seem to be, but this like obvious low hanging fruit.
I've also often wondered why LLMs aren't trained with a format of having a dedicated contextual system-instruction role at the _end_, which you could use to put context like current time or other misc stuff.
There are context pruning strategies that will prune old messages that are no longer relevant, and context compaction from summaries, etc. But to say "most" do this on "every turn" is overstating things. I think it's more correct to say that "many" do this "occasionally."
I'm also not sure what they mean about injecting fresh timestamps. I could see why you'd prepend/append a timestamp to the user's messages to make the model aware of the current time, and the passage of time, but I can't think of any good reason to edit timestamps in prior messages. I'm sure someone can come up with one, but I'd be very surprised if this was a thing that most agent loops do, let along doing it on every turn.
What I do is just point agents to a folder, have it loop around a few times on a repo, fact checks at the end, but people sometimes think the software/harness around the AI model doesn't do much which is TOTALLY wrong, its probably AS important or more.. file editing methods available matter a lot, context compaction methods... matter, caching matters. I am still fantasizing about a "best of N" coding agent, that tries to take all the best stuff from all of them.
I have an idea of a coding agent that puts a lot more effort into using more than one model at the same time. Sooo much can be done with that idea.. and no one is apparently doing it yet that I can find. I just am not sure I want to put that much time into a new coding agent project. I wonder how autonomous it could be - have weekly or daily scans of the current coding agent landscape and automatic scanning of coding agent/ai code related subreddits/hacker news, analyze it to figure out what the current problems are, complaints about existing coding agents, desires --> prioritized list of possible features/fixes ---> ai agents code and make releases
I haven't seen that, it'd be crazy slow if they did this. What "agent loops" are they talking about here specifically? The vagueness makes it sound potentially made up.