arXiv(opens in a new tab)cs.CVAug 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2608.22368

DiD It in 87 Minutes: A Label-Free Softmax-to-Linear Adaptation of Vision Transformers for Object Detection

Huaiyuan Qin, Gabriel James Goenawan, Zihang Lin, Muli Yang, Hongyuan Zhu

Abstract

While linear attention is a compelling mechanism for high-resolution object detection due to its reduced cost for global token mixing, converting the Softmax-attention ViT backbone of a trained detector into a linear-attention one is not a trivial drop-in replacement. Directly swapping the attention operator leads to severe performance degradation, and generic label-free distillation, though effective for classification, often fails on detection tasks. We argue that the central challenge is detector-interface preservation: the converted backbone must reproduce the exact feature tensors expected by the fixed downstream detector, rather than merely imitating internal Softmax hidden states. To address this, we introduce Detector-Interface Distillation (DiD), a label-free conversion method that exclusively trains the linear-attention backbone by aligning detector-facing interface tensors with those of a frozen Softmax teacher. On DOTA-v1.5, DiD substantially outperforms established baselines and matches supervised, fully trained linear models. Adaptation completes in roughly 87 minutes on 4 GPUs, and the linearized backbone cuts inference latency by ~62% and peak memory by ~49%. We hope our findings offer the community a simple, label-free route to reusing trained Softmax detectors as efficient linear ones, and encourage interface-aware objectives in future architecture-conversion work.

1 Introduction

Vision Transformers (ViTs) have become a dominant backbone family in modern computer vision. Their strong performance is driven by scalable self-attention [1–3], large-scale pretraining [4–6], and effective transfer to downstream tasks such as image classification [7], semantic segmentation [8–11], and object detection [12–15]. In detection, ViT-based systems such as ViTDet [14] and transformer detectors such as YOLOs [12] show that pure or nearly pure transformer backbones can provide strong representations when paired with an appropriate detector head or feature pyramid. However, this success comes with a fundamental limitation: standard Softmax attention scales quadratically with the number of image tokens [16]. This cost becomes especially problematic for dense prediction, where high-resolution inputs are often required to localize small objects [17–21], as in application scenarios like remote sensing [22] and autonomous driving [23].

∗^{*} Equal first author. Authors are permitted to list their name first in their CVs.

†^{\dagger} This paper was completely accomplished when GJG worked and ZL interned at A*STAR.

Corresponding author.

Preprint.

Figure

(a)

(b)

Figure 1: Overview of the label-free Softmax-to-linear detector conversion setting. (a) Starting from a trained detector with a Softmax-attention ViT backbone, we construct a student by replacing the backbone attention operator with linear attention. During conversion, the Softmax teacher and the linear student receive the same unlabeled images; only the student backbone is updated, while the downstream detector remains fixed. Snowflake symbols indicate frozen modules, while the fire symbol indicates the trainable module. (b) After conversion, the distilled linear backbone is used directly in the detector without additional fine-tuning.

To address this cost, a large body of work has explored more efficient ViT designs. One line of research reduces attention complexity through locality or hierarchy [17, 18] that restricts self-attention to local windows or progressively aggregated regions, substantially improving efficiency while maintaining strong dense-prediction performance. These hierarchical backbones have become highly practical for detection and have been adopted in strong detector families [24–27]. Nevertheless, hierarchy and locality also impose architectural constraints: long-range interactions become indirect [19, 28, 29], and the model no longer preserves the same global token-mixing behavior as a standard Softmax-attention ViT.

Another line of work targets the quadratic attention operator itself [30–33], inspired by earlier work in NLP [34–36]. Linear-attention methods replace the Softmax kernel with feature-map-based formulations whose complexity scales linearly with sequence length. Early linear-attention variants often trailed quadratic Softmax attention in accuracy [30], but more recent approaches [31–33] have narrowed this gap and, in some settings, surpassed quadratic attention. These results suggest that linear attention can be competitive under suitable architectures and training regimes. However, adopting linear attention in an existing detector typically demands pre-training the linear backbone from scratch and then fine-tuning the entire detector to recover accuracy, both of which require substantial compute in addition to labeled data.

This creates a practical conversion problem: can a quadratic-attention backbone in an existing object detector be converted into a linear-attention backbone without labels and without retraining the entire detector?

In this paper, we study this problem in the setting of lightweight object-detection conversion. Rather than retraining the full detector, we replace the quadratic attention modules in the backbone of a trained ViT detector with linear attention and perform a short label-free adaptation stage that trains only the backbone, as illustrated in Figure 1. The difficulty is that the converted backbone must remain compatible with a detector pipeline that was trained around the original Softmax feature distribution.

We show that this is not merely a generic representation-transfer problem. For classification, preserving global semantic behavior is often sufficient [37, 38], but object detection is more restrictive because downstream performance depends on the deployed multi-scale interface tensors consumed by the detector [39, 40]. Prior detector distillation works suggest that supervision at intermediate detector features can be particularly effective for object detection [39, 40]. We build on this general intuition by preserving the detector-facing feature contract required by the fixed downstream detector after the attention operator is changed. Based on this observation, we propose Detector-Interface Distillation (DiD), a label-free conversion method that supervises detector-facing interface tensors rather than the full sequence of hidden states. Across our experiments, this simple detector-aware objective substantially improves Softmax-to-linear transfer for detection and yields a practical adaptation procedure that completes in roughly 87 minutes on 4 GPUs.

Our contributions are as follows:

  1. We identify detector-interface mismatch as a key failure mode in Softmax-to-linear attention conversion for object detection. Direct attention replacement collapses performance, and generic label-free distillation remains insufficient though it preserves classification behavior well.

  2. We propose Detector-Interface Distillation (DiD), a simple label-free conversion method that aligns detector-facing interface tensors while keeping the downstream detector fixed.

  3. We provide a controlled study showing that detector-interface supervision substantially outperforms direct copy, generic self-supervised distillation, and hidden-state distillation, and is competitive with full supervised training of the linear detector.

  4. We quantify the practical payoff of conversion, showing that the resulting ReLU backbone substantially reduces latency and memory while the conservative 40k-step adaptation completes in about 87 minutes on 4 GPUs.

References (52)