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

Successful conversion is governed by compatibility at the detector-facing interface
Huaiyuan Qin1* Gabriel James Goenawan1*† Zihang Lin1,2*† Muli Yang1 Hongyuan Zhu1✉

1Institute of Advanced Intelligence and Computing (IAIC), A*STAR, Singapore
2Nanyang Technological University
*Equal first author   †Work done while at A*STAR   ✉Corresponding author

arXiv 2026

Figure 1
Figure 1. Overview of the label-free Softmax-to-linear detector conversion setting.

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.

What is DiD?

Label-Free Softmax-to-Linear 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.

Overview. Detector-Interface Distillation (DiD) adapts a linear-attention student backbone to a detector that was originally trained with a Softmax-attention backbone. DiD aligns the multi-scale tensors produced at the output of the neck/FPN, while updating only the student backbone. Softmax and linear attention implement different token-mixing rules, so their intermediate hidden states need not follow identical trajectories. DiD instead preserves the feature boundary on which the fixed detector depends. Algorithm 1 summarizes this computation in pseudocode.

Algorithm 1 DiD PyTorch-style pseudocode.
# B_t: frozen Softmax teacher backbone# B_s: trainable linear-attention student# N_t, N_s: identical frozen neck/FPN copies# H: frozen detector heads (unused in loss)# beta: weights, beta[i] for interface m = i+1B_s.params = B_t.params # copy compatible weightsfor x in unlabeled_images: # no detection labels    R_t = B_t.readout_features(x) # frozen path    R_s = B_s.readout_features(x) # trainable    Z_t = N_t(R_t) # tensors z_t^(1), ..., z_t^(M)    Z_s = N_s(R_s) # tensors z_s^(1), ..., z_s^(M)    # weighted detector-interface reconstruction    loss = 0    for i in range(M):        loss += beta[i]*mse(Z_s[i], Z_t[i].detach())    loss /= sum(beta)    loss.backward() # update only student backbone    update(B_s) # AdamW step# deploy: drop teacher, reuse the frozen detectorconverted_detector = H o N_s o B_s

Weighted Interface Objective. DiD aligns corresponding teacher and student interface tensors using the weighted reconstruction objective

L_DiD(x) = 1 / (sum over m=1..M of beta_m) times sum over m=1..M of beta_m ||z_s^(m)(x) - z_t^(m)(x)||_F^2(9)

where βm > 0 controls the contribution of interface output m.

Conversion and Deployment. After conversion, the teacher branch is discarded. The converted detector reuses the original neck/FPN and prediction modules without additional fine-tuning.

Why Is Generic Transfer Insufficient?

To test whether a classification-oriented transfer objective is sufficient for object detection, we compare direct copy and generic LightlyTrain-style global-feature distillation on ImageNet and CIFAR-100 classification, and on DOTA-v1.5 detection with RetinaNet.

ClassificationDetection
MethodImageNetCIFAR-100DOTA-v1.5
Acc.Retained (%)Acc.Retained (%)mAPRetained (%)
Softmax reference79.83100.078.09100.033.5100.0
Direct copy5.086.43.544.51.75.1
Generic distillation77.8397.575.9297.218.154.0
Table 1. Cross-task Softmax-to-ReLU transfer.

Direct copy collapses across all three tasks (Table 1), confirming that the attention operator cannot be replaced without adaptation. Generic distillation, however, exhibits a clear task gap: it retains 97.5% and 97.2% of the Softmax-reference accuracy on ImageNet and CIFAR-100, respectively, but only 54.0% of the reference mAP on DOTA-v1.5.

Preserving global semantic representations is therefore insufficient to maintain the structured, multi-scale features required by a fixed detector, motivating a supervision target tied to the deployed detection pathway.

Where Should Conversion Be Supervised?

Supervision targetmAPmAP50mAP75
Attention outputs7.817.45.6
Hidden states from all layers25.244.724.6
Hidden states from readout layers20.337.419.0
Final hidden state12.624.111.7
Post-neck/FPN detector features30.754.130.1
Table 2. Effect of supervision placement for RetinaNet conversion on DOTA-v1.5.

We ask where supervision should be applied so that the converted backbone remains compatible with the fixed detector.

As shown in Table 2, matching all transformer hidden states is the strongest detector-agnostic target, but it remains 5.5 mAP below supervision after the neck/FPN. Matching only the backbone layers supplied to the neck is also insufficient.

This experiment identifies the feature boundary between the frozen neck/FPN and the detector heads as the appropriate conversion target. We refer to this boundary as the detector-facing interface.

Main Results

Experimental Setup. We evaluate label-free detector conversion on DOTA-v1.5, a high-resolution aerial-detection benchmark where global token mixing is costly and small objects are common. We use RetinaNet and Faster R-CNN with a ViT-S backbone. We evaluate two linear-attention feature maps: φ(x) = ReLU(x) following Han et al. (2024), and φ(x) = ELU(x) + 1 following Katharopoulos et al. (2020).

Baselines. We compare DiD with four label-free alternatives and one supervised reference. Direct copy replaces the attention operator and evaluates the copied parameters without adaptation. Generic distillation uses LightlyTrain to align global teacher-student representations. Softmax-generated pseudo-label distillation uses AutoDistill to train the student from the frozen teacher’s predicted detections. Hidden-state distillation follows RADLADS-style intermediate representation matching across transformer layers. Full training trains the corresponding linear-attention detector using detection labels and is included only as a supervised reference.

DetectorMethodReLUELU
mAPmAP50mAP75mAPmAP50mAP75
RetinaNetSoftmax reference33.558.133.233.558.133.2
Full training30.953.330.930.853.031.3
Direct copy1.73.81.21.32.90.9
Generic distillation18.135.216.69.619.25.3
Softmax-generated pseudo-label distillation14.833.610.119.638.217.2
Hidden-state distillation28.149.727.726.747.426.6
DiD (Ours)31.154.531.031.154.430.7
Faster R-CNNSoftmax reference33.156.034.133.156.034.1
Full training28.950.029.128.650.028.6
Direct copy0.30.70.20.20.40.1
Generic distillation14.930.812.98.919.37.1
Softmax-generated pseudo-label distillation25.746.225.325.446.124.9
Hidden-state distillation27.148.126.927.248.126.6
DiD (Ours)29.351.129.828.950.229.4
Table 3. Label-free Softmax-to-linear conversion on DOTA-v1.5 with ViT-S.

Table 3 establishes three consistent trends: Firstly, direct copy produces near-zero mAP for both attention kernels and detector families. Secondly, generic representation matching and pseudo-label supervision recover only part of the lost detector performance. Thirdly, DiD is the strongest label-free method. Its performance is also comparable to the supervised linear-attention references.

The consistency between RetinaNet, an anchor-based one-stage detector, and Faster R-CNN, a proposal-based two-stage detector, indicates that DiD is not tied to a particular downstream detection architecture.

Interface Alignment and Conversion Dynamics

To understand why DiD outperforms hidden-state distillation, we compare how the two objectives affect teacher-student alignment inside the backbone and at the detector-facing interface. Figure 2(a) compares the normalized feature error nMSE(s, t) = E||s - t||_2^2 / E||t||_2^2 at internal backbone states and detector-facing tensors.

Figure 2(a)
(a)
Figure 2(b)
(b)
Figure 2. Conversion behavior on RetinaNet.

All-layer hidden-state distillation achieves lower mismatch within the transformer, whereas DiD achieves lower mismatch at the detector-facing interface and higher detector accuracy.

This result provides representational evidence for the internal-compensation interpretation: after the attention operator changes, close agreement at every intermediate state is not necessary, provided that the student resolves the discrepancy before its features are consumed by the frozen detector.

Figure 2(b) shows that DiD maintains an advantage over hidden-state distillation throughout conversion and reaches the supervised linear-training regime after approximately 20k-30k steps.

Inference Efficiency

Figure 3 compares backbone-only inference for Softmax attention and the ReLU-linearized ViT. The linearized backbone reduces average latency by approximately 62% and peak memory by approximately 49%.

Figure 3
Figure 3. Backbone-only inference comparison between the Softmax and ReLU-linearized ViT.
Our central finding is that successful conversion is governed by compatibility at the detector-facing interface: supervising the tensors actually consumed by the frozen detector lets the linear backbone compensate internally, where direct operator replacement and generic distillation fail.

BibTeX

@article{qin2026did,
  title   = {DiD It in 87 Minutes: A Label-Free Softmax-to-Linear
             Adaptation of Vision Transformers for Object Detection},
  author  = {Qin, Huaiyuan and Goenawan, Gabriel James and Lin, Zihang and
             Yang, Muli and Zhu, Hongyuan},
  journal = {arXiv preprint arXiv:2608.22368},
  year    = {2026}
}

Acknowledgements

This page is adapted from the ECHO project page, itself built on the Nerfies template.

References

  1. Dongchen Han, Yifan Pu, Zhuofan Xia, Yizeng Han, Xuran Pan, Xiu Li, Jiwen Lu, Shiji Song, and Gao Huang. Bridging the Divide: Reconsidering Softmax and Linear Attention. Advances in Neural Information Processing Systems (NeurIPS), 2024.
  2. Angelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, and François Fleuret. Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention. International Conference on Machine Learning (ICML), 2020.
  3. Daniel Goldstein, Eric Alcaide, Janna Lu, and Eugene Cheah. RADLADS: Rapid Attention Distillation to Linear Attention Decoders at Scale. Conference on Language Modeling (COLM), 2025.