mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
[GH-ISSUE #655] Feature request: cross-model KV-cache handoff (SwaT, arXiv 2610.15095) - start with KV export/import #269
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
mw00/project-maya#269
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Gazelle221B on GitHub (Oct 29, 2026).
Original GitHub issue: https://github.com/mw00/project-maya/issues/655
Request: a way to hand a conversation's context from one Maya model to another without the receiver re-reading the prompt, along the lines of Swarm Telepathy: Prefill-Free KV-Cache Transfer Across Families (SwaT, arXiv:2610.15095, code at Ar-Kareem/SwaT).
What SwaT does. Both models stay frozen. A small trained "mapper" (about 300M parameters, B blocks of cross-attention over the sender's grouped K/V, with the sender's RoPE removed and the receiver's RoPE applied at integer positions) predicts the receiver's full KV cache from the sender's. The receiver then prefills only the new query. The tokenizers don't have to match: alignment goes through shared character spans. The paper reports about 4x lower wall-clock than text-to-text agent handoffs, and on Qwen 3 4B → Llama 3 8B the mapper costs 5.7 ms vs 52.9 ms of re-prefill at 1K tokens, and 1.3 s vs 8.0 s at 64K. It needs one mapper per sender→receiver pair, trained in under 1 GPU-day on text only.
Why it would matter for Maya. People run several large models behind one router and switch between them in agent workflows, for example a planner on one model and a coder on another. Every switch re-reads the whole context. On a 2x 32 GB AMD box that costs tens of seconds to minutes at 64K-120K tokens, for each model change.
What I think Maya would need (smallest first):
Caveats. The SwaT repository has no license file at the time of writing, so its code can't be reused directly; the method itself is described in the paper. The authors also note that a transferred cache can carry information that isn't visible in the text, which matters for auditing.
I can test on 2x 32 GB AMD GPUs (HIP) with DeepSeek-V4.1 (Maya-XS) and GLM-5.3-Flash. Step 1 alone would already be useful to me.