ProxyFormer: A Dual-Stream Proxy Architecture for Ultra-Long Context and High-Resolution Generation

TL;DR

ProxyFormer uses a proxy architecture for ultra-long context and high-resolution generation, extending sequence length and retrieval accuracy.

cs.LG 🔴 Advanced 2026-08-25 5 views
Zhongpan Tang
long-sequence modeling efficient attention proxy token KV-cache compression flow matching

Key Findings

Methodology

ProxyFormer employs a dual-stream proxy architecture, compressing fine-grained local features into proxy states for global interactions, then decompressing and reinjecting them into the local stream. It introduces multi-level compression/decompression, layer-wise dynamic compression ratios, asymmetric dual embeddings, and a proxy-only KV-cache inference scheme.

Key Results

  • On a 16GB GPU, 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.
  • Preliminary image-generation experiments demonstrate the feasibility of ProxyFormer for both pixel-space and latent-space flow matching.

Significance

ProxyFormer addresses the bottleneck of attention computation and KV-cache in ultra-long-context language models and high-resolution generative models. By using a proxy architecture, it significantly reduces computational complexity and memory usage, advancing long-sequence modeling and efficient attention mechanisms.

Technical Contribution

ProxyFormer introduces proxy tokens and a dual-stream architecture, overcoming the limitations of single-shot irreversible compression. It supports unified processing of 1D sequences, 2D images, 3D point clouds/voxels/videos, offering new engineering possibilities.

Novelty

ProxyFormer is the first to apply proxy tokens in ultra-long context and high-resolution generation, with innovations like dual-stream architecture and layer-wise dynamic compression ratios, significantly enhancing model efficiency and performance.

Limitations

  • In short sequences or wide local streams, the linear compression term may exceed the quadratic attention term.
  • The implementation complexity of the proxy architecture is high, requiring additional engineering optimization.
  • Preliminary experimental results need further validation and expansion.

Future Work

Future work could explore ProxyFormer's application to more tasks and datasets, optimize the implementation details of the proxy architecture, and investigate its potential in other generative tasks.

AI Executive Summary

ProxyFormer addresses the computational bottleneck in ultra-long-context language models and high-resolution generative models through a proxy architecture. Traditional methods struggle with quadratic growth in attention computation and KV-cache when handling long sequences. ProxyFormer compresses fine-grained local features into proxy states for global interactions, then decompresses and reinjects them into the local stream, effectively reducing computational complexity and memory usage.

In experiments, ProxyFormer extends the trainable sequence length to about 0.7M on a 16GB GPU with a compression ratio of 64, and maintains high retrieval accuracy in a multi-needle retrieval task. Preliminary image-generation experiments demonstrate its feasibility in both pixel-space and latent-space flow matching. This method not only enhances model efficiency and performance but also provides new insights for the development of long-sequence modeling and efficient attention mechanisms.

Despite its impressive performance, ProxyFormer has high implementation complexity, and preliminary results require further validation and expansion. Future work could explore its application to more tasks and datasets, and optimize the implementation details of the proxy architecture.

Deep Analysis

Background

In recent years, long-sequence modeling and high-resolution generation have become research hotspots with the development of deep learning. Traditional Transformer architectures face limitations in efficiency due to quadratic growth in attention computation and KV-cache when handling long sequences. Researchers have proposed various methods to address this, such as linear, sparse, or fixed-pattern attention approximations, and state space models or recurrent forms as alternatives to attention.

Core Problem

The quadratic growth in attention computation and KV-cache in ultra-long-context language models and high-resolution generative models is a major bottleneck. This leads to inefficiency when handling long sequences, limiting inference throughput and training sequence length.

Innovation

ProxyFormer introduces proxy tokens and a dual-stream architecture, overcoming the limitations of single-shot irreversible compression. Its innovations include: 1) the application of proxy tokens; 2) the design of a dual-stream architecture; 3) the introduction of layer-wise dynamic compression ratios.

Methodology

  • �� Compress fine-grained local features into proxy states in each layer
  • �� Perform global interactions only in the compressed proxy space
  • �� Decompress and reinject globally contextualized proxies into the local stream
  • �� Introduce multi-level compression/decompression, layer-wise dynamic compression ratios, asymmetric dual embeddings, and a proxy-only KV-cache inference scheme

Experiments

Experiments used the GPT-2 tokenizer with a model width of 512 and a total of 10 layers. ProxyFormer's history embedding dimension is 64, generation region block size is 64, and compression ratio per layer is 64. Experiments were conducted on the WikiText dataset and evaluated using a multi-needle retrieval task.

Results

ProxyFormer extends the trainable sequence length to about 0.7M on a 16GB GPU with a compression ratio of 64. In a multi-needle retrieval task, a model trained with a 64K window retains 92%-95% retrieval accuracy on 1,048,576 tokens.

Applications

ProxyFormer can be applied to long-sequence modeling, high-resolution generation, flow matching image generation, and diffusion conditional generation tasks. Its proxy architecture provides efficient computation and memory usage, suitable for scenarios requiring large-scale data processing.

Limitations & Outlook

ProxyFormer may not be as effective in short sequences or wide local streams, and its implementation complexity is high. Preliminary results require further validation and expansion. Future work could optimize the implementation details of the proxy architecture and explore its application to more tasks and datasets.

Plain Language Accessible to non-experts

Imagine you're cooking in a kitchen. Traditional methods are like starting from scratch every time you prepare a meal, which is time-consuming and labor-intensive. ProxyFormer is like a smart assistant that prepares all the basic ingredients in advance and quickly combines them into dishes when needed. This way, you can focus on the final cooking steps, greatly improving efficiency. In this way, ProxyFormer significantly reduces computation and memory consumption when handling long sequences and high-resolution generation.

ELI14 Explained like you're 14

Imagine you're playing a super complex puzzle game. Traditional methods are like having to start from scratch every time you piece together all the fragments, which is super annoying! ProxyFormer is like a smart assistant that helps you piece together some small parts first, then quickly combine them into larger parts when needed. This way, you can complete the puzzle faster! This method makes handling super long texts and high-resolution images simpler and faster.

Glossary

Proxy Token

A token used for global interactions in a compressed space, reducing computational complexity.

Used in ProxyFormer for compressing and decompressing local features.

KV Cache

A cache storing keys and values of historical tokens for speeding up autoregressive decoding.

ProxyFormer reduces the size of the KV cache using proxy tokens.

Compression Ratio

The ratio of the length of the compressed sequence to the original length.

ProxyFormer uses high compression ratios to extend trainable sequence length.

Flow Matching

A technique for image generation that matches flows in pixel or latent space to generate images.

Used in preliminary image-generation experiments in ProxyFormer.

Attention Mechanism

A mechanism for computing correlations between elements in a sequence, widely used in Transformer models.

ProxyFormer optimizes attention mechanism computation with proxy tokens.

Open Questions Unanswered questions from this research

  • 1 ProxyFormer's performance in short sequences or wide local streams needs further research.
  • 2 How to further optimize the implementation details of the proxy architecture to reduce complexity.
  • 3 Potential applications on more tasks and datasets need exploration.

Applications

Immediate Applications

Long-sequence Modeling

ProxyFormer can be used for handling long text sequences, such as document analysis and natural language processing tasks.

High-resolution Generation

Suitable for applications requiring high-resolution image generation, such as medical imaging and computer vision.

Long-term Vision

Intelligent Assistants

ProxyFormer's proxy architecture could be used to develop smarter assistants, enhancing human-computer interaction experiences.

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.

cs.LG