ProxyFormer: A Dual-Stream Proxy Architecture for Ultra-Long Context and High-Resolution Generation
Organizations: Independent Researcher
Abstract
The quadratic growth of attention computation and key-value (KV) cache with respect to sequence length is a central bottleneck for ultra-long-context language models and high-resolution generative models. We propose ProxyFormer, a general dual-stream architecture built upon proxy tokens. In each layer, fine-grained local features are compressed bottom-up into a small set of proxy states; expensive global interactions are performed only in the compressed proxy space; the globally contextualized proxies are then decompressed and injected top-down back into the local stream. Because the local stream persists across layers, fine-grained information that is not captured by one compression step remains accessible for later refinement, alleviating the irreversible information loss of conventional one-shot compression. We further introduce factorized multi-level compression/decompression, layer-wise dynamic compression ratios, asymmetric dual embeddings, and a proxy-only KV-cache inference scheme. On a 16GB GPU with batch size 1, a standard decoder-only model can train sequences of only about 20K tokens, whereas ProxyFormer with a compression ratio of 64 extends the trainable sequence length to about 0.7M. A model trained with a 64K window retains 92%-95% retrieval accuracy on a multi-needle retrieval task with 1,048,576 tokens, and a model trained with an 8K window exceeds 94% accuracy when extrapolated to 256K tokens. Preliminary image-generation experiments demonstrate the feasibility of ProxyFormer for both pixel-space and latent-space flow matching.
Figures & tables
| Model | History | PPL |
|---|---|---|
| Base (decoder-only) | None | 21.36 |
| ProxyFormer | None | 22.10 |
| ProxyFormer | Yes | 21.01 |
| Model | History len. | Gen. len. | VRAM (GB) | Thr. (it/s) |
|---|---|---|---|---|
| Standard decoder-only | 0 | 20,496 | 15.6 | 2.6 |
| Base (full-history attention) | 20,992 | 128 | 15.6 | 1.3 |
| ProxyFormer ( ) | 20,992 | 128 | 2.9 | 16.10 |
| ProxyFormer ( ) | 716,800 | 128 | 15.1 | 2.70 |
| Dataset | Method | Space | FID | IS |
|---|---|---|---|---|
| CIFAR-10 | JIT | Pixel | 16.21 | 8.42 |
| MNIST | JIT | Pixel | 2.06 | 1.95 |
| MNIST | JLT | Latent | 4.36 | 1.93 |
Long-Context Language Modeling
Long-context language modeling studies how language models can use, retain, and efficiently process information across very long sequences.
See all 189 papers