Post
  1. Portrait of Onur Solmaz

    Letting models edit their own context without invalidating KV cache

    @onusoz · /2026/10/02 · View on
    New paradigm alert 🚨 If this ever becomes feasible/useful, it will create a lot of complexity at the application layer 😩 (just when you thought things have settled) tl;dr You let the model edit its context, including KV cache-breaking modifications like taking out a piece from the middle like a Jenga block, or replacing it with another block "But won't it break the cache and cost a ton??!?!?!?!" I hear you say Well, apparently transformers have some tolerance for reusing stale KV states after such modifications According to the paper, if you have A B C in the context and replace it with A B' C apparently you can just keep using the stale cache for C and just have to recompute the cache for B' I had the idea of giving the model a "Context Editor API" around the time "function calling" was becoming a thing in 2024. But had then quickly realized the implications of my folly and stopped it 😁 (I was a mere GPT wrapper engineer back then) If the inference engine supports it and does not bill me extra for it, this might indeed be a superior way to work with agents