Mentatcurated
Artificial Intelligence medium · first-party

Deletion with a forwarding address

Xiaohongshu's Self-GC lets a second model decide what to cut from an AI agent's overflowing working memory, then parks each cut passage in a side file with a note saying where it went so the agent can fetch it back.

Engineers at Xiaohongshu, the Chinese social platform, gave their AI agents a second model whose only job is to decide what the first one should forget. A long-running agent accumulates every web page it fetched and every file it read until the pile outgrows what the model can hold, and shipping agents mostly cope by deleting the oldest turns or hiding old tool output. Whatever goes is gone.

An agent's context stops being a transcript to trim from the top and becomes a heap of objects with lifecycles.

Self-GC moves the text to a side file and leaves a note saying where it went, so an exact link or file path can be pulled back when a later step needs it. The side model reads over the accumulated context item by item and picks one of three moves: file it away with a pointer, keep the head and tail of a long passage and drop the middle, or delete it outright. On 33 deliberately punishing sessions the system removed 44% of the text, and in 85% of cases a judging model found that everything the agent later needed was still reachable. The rule-based methods it was compared against scored 55% to 70% on that same test.

That 85% deserves a careful read. It is one model's verdict on whether the links, file paths and record values a future turn would need remained available. Whether the agent's answers actually got better was never measured. And on live Xiaohongshu traffic the system trimmed the text fed into its models by 10 to 15% during the day, roughly a third of what the lab set showed. The paper does not account for the gap.

The authors named the system after garbage collection on purpose, and that borrowed idea outlasts the benchmark. Trimming that leaves a way back is cheap to bolt onto any agent, and it widens what a system can afford to forget.

The lenses

Novelty 3
Impact · breadth 3
Impact · depth 3
Actionable 2
Delight 2
Substance 4
Hype 1

The facts

StatusarXiv preprint from July 2026, not peer reviewed
Deployedrunning on live traffic inside Xiaohongshu, a social platform with hundreds of millions of users
Real-world saving10–15% less text fed to the models during the day, peaking near 20%
Open arxiv.org →

How this connects

Tap a node to open it

How this connects