Ttt E2e Long Context

Enable long-context modeling via test-time training with meta-learning. Inner loop continues training on context, compressing information into weights rather than KV cache, outer loop optimizes initialization—maintaining full-attention quality with RNN-like constant inference latency across 8K-128K token contexts.

adu2021 fe4aaf8 1019 B Updated

File contents

Overview

Reformulates long-context as continual learning problem solved at test time.

Core Technique

Meta-Learning for Test Time:

# Inner loop: compress context into weights
for token in context:
    gradient = compute_gradient_on_token(model, token)
    model.weights += gradient  # Compress context

# Outer loop: optimize initialization
# Treat inner loop as differentiable step

Performance

  • Full-attention quality across context lengths
  • 2.7× faster than attention at 128K
  • Constant-time inference

References

  • Test-time meta-learning
  • Weight compression of context
  • End-to-end optimization

adu2021/skillxiv/tree/main/skills/skillxiv-v0.0.2-claude-opus-4.6/ttt-e2e-long-context commit fe4aaf8247

Frequently asked questions

npx skillmds@latest add adu2021/ttt-e2e-long-context