Abstract
Training Vision Transformers (ViTs) on high-resolution images is computationally prohibitive due to the quadratic complexity of self-attention. We present "Win-Win," a training strategy that utilizes only two random windows per image. This approach enables the model to learn both local details and global dependencies simultaneously while reducing training time by 3–4x and memory usage by half. Unlike traditional methods, Win-Win allows for direct full-resolution inference at test time, avoiding the latency and artifacts associated with tiling strategies.
Introduction
Vision Transformers (ViTs) have set new benchmarks in computer vision. However, their application to high-resolution imagery (e.g., Full HD) is limited by the quadratic complexity of self-attention relative to the number of tokens. Existing solutions often rely on architectural constraints like hierarchical models, low-resolution training that generalizes poorly, or test-time tiling which is slow and prone to "blocking artifacts."
The Win-Win framework addresses these challenges by enabling standard, non-hierarchical ViTs to be trained efficiently on high-resolution data while maintaining the ability to process full images during inference.
Methodology: The Two-Window Approach
The core innovation of Win-Win is a sparse training objective: masking out the majority of an image and feeding only $N$ random windows into the transformer. Empirical results suggest that $N=2$ is the optimal balance for learning spatial logic.
Key Components
- Local & Global Learning: By processing two distant windows, the model learns to handle both intra-window local interactions and inter-window long-range dependencies. This prepares the model for the full-image context it will encounter at test time.
- Rotary Positional Embeddings (RoPE): To facilitate generalization from small training windows to large test-time resolutions, the authors employ RoPE. This relative encoding allows the model to understand spatial relationships independently of the absolute image size.
- Softmax Temperature Adjustment: Increasing the number of tokens at test time can lead to "crowding" in the attention mechanism. A temperature scaling factor ($\tau$) is introduced to the softmax function to normalize the attention distribution during full-resolution inference.
Experimental Results
The authors evaluated Win-Win across semantic segmentation (BDD-100k) and optical flow (MPI-Sintel, Spring benchmark).
Efficiency and Performance
- Training Speed: Win-Win is 3–4x faster to train than full-resolution baselines and reduces memory overhead by 50%.
- Inference Speed: By avoiding tiling at test time, Win-Win is an order of magnitude faster than competitors on high-resolution benchmarks like Spring (Full HD).
- Accuracy: On BDD-100k, the model achieved 63.6 mIoU, matching full-resolution training. In optical flow, it demonstrated superior handling of large displacements compared to crop-based methods.
Conclusion and Limitations
Win-Win provides a scalable path for training high-resolution ViTs without specialized architectures. While highly effective, the method currently requires a post-training validation step to tune the softmax temperature for specific resolutions. Additionally, its reliance on relative positional embeddings like RoPE means it may not be directly applicable to architectures using absolute learned encodings. Future work will focus on automating temperature selection and extending the method to multi-modal high-resolution tasks.
Summary updated