Skip to content
ModelsThatRun

GTR

Gated Token Recurrence: a 2026 real-time detector with a linear-attention ViT backbone, four sizes on COCO's 80 classes, MIT.

Size

Commercial use OK for size s: code MIT, weights MIT. Measured on our RTX 4090: 34.0 ms median, 636 MiB VRAM peak. We scored it 53.3 box AP on COCO val2017. PyTorch weights, 93 MB.

License

Commercial use OK

Code
MITchecked 26 Oct 2026
Weights
MITall sizes, checked 26 Oct 2026

MIT code and weights. Its COCO checkpoints are fine-tuned from Objects365 pre-training, and the paper distills the backbone from a DINOv3 teacher; whether those terms reach the weights isn't settled.

On our RTX 4090, measured

34.0ms median

p90 36.3 ms, fp16, batch 1, 640x640

VRAM peak
636 MiB
Status
Runs as is
Environment, 27 Oct 2026

NVIDIA GeForce RTX 4090, driver 580.173.02, CUDA 12.8, torch 2.11.0+cu128, Python 3.11.11, Intellindust-AI-Lab/GTR@f8ffd2444bfc2c1adfa70933e28afa37a0377830. Baseline 848 MiB. 10 warm-up + 100 timed. Scope: predict(): pre-processing, forward pass and post-processing; input file decoded beforehand.

Accuracy

53.3box APmeasured

COCO val2017, box AP, 5,000 images, fp16, pycocotools==2.0.11 · 26 Oct 2026

Paper 53.6 COCO APREADME, object detection model zoo (EMA weights)

Weights

PyTorch

Size
93 MB
sha256
69b8bed4d2bd…dd1979
Download s weights

Same photos and one score threshold for every model of this task. Failures are marked.

Sizes

SizeLatencyVRAMAccuracyWeightsRunsLicense
s34.0 ms640x640636 MiB53.3 box AP, measured53.6 COCO AP paper93 MBAs isCommercial OK
m34.8 ms640x640681 MiB57.1 box AP, measured57.3 COCO AP paper174 MBAs isCommercial OK
l32.9 ms640x640697 MiB58.6 box AP, measured58.9 COCO AP paper285 MBAs isCommercial OK
x33.5 ms640x640732 MiB59.1 box AP, measured59.4 COCO AP paper356 MBAs isCommercial OK

From the authors

In their words, with their numbers. Ours are in the cards at the top of this page.

Paper

GTR: Gated Token Recurrence for Efficient Dense Prediction

Zhe Feng, Longfei Liu, Wei Liu, Kai Chen, Jiangang Kong, Wei Zhou and 4 others

arXiv 2609.26590, 22 Sept 2026

Abstract

Self-attention-based vision backbones perform well on dense prediction, but the quadratic computational cost of global softmax attention limits their efficiency as image resolution increases. We introduce Gated Token Recurrence (GTR), a softmax-free recurrent vision backbone that combines gated linear attention, alternating spatial scan directions, and spatially enhanced SwiGLU blocks. GTR is distilled from a detection-specialized DINOv3 teacher using only final-layer patch-token alignment through a linear projection and squared $\ell_2$ loss, without masked-token prediction or intermediate-layer supervision. With Objects365 detector pre-training, GTR-L achieves 58.9 box AP on COCO \texttt{val2017} with 1.908\,ms median batch-one latency under compiled FP16 execution on an RTX~4090. The same backbone also transfers to instance segmentation, pose estimation, oriented detection, semantic segmentation, and monocular depth estimation. In an isolated kernel benchmark, our specialized chunkwise CUDA operator is $4.0\times$ faster than FLA v0.5.0 at 1.6K tokens on RTX~4090. TensorRT deployment on DRIVE AGX Thor achieves 2.282--8.769\,ms median batch-one latency across the evaluated models. These results show that recurrent token mixing can provide an efficient alternative to global softmax attention for high-resolution dense prediction and edge deployment. Project page: https://intellindust-ai-lab.github.io/projects/GTR/

README

Copied from the authors' repository at commit f8ffd24 on 3 Nov 2026. Numbers and license claims in it are theirs, not measured or checked by us. We removed badges, replaced images with links and adjusted headings.

Gated Token Recurrence for Efficient Dense Prediction

Zhe Feng1,2,3, Longfei Liu2, Wei Liu1, Kai Chen5, Jiangang Kong1, Wei Zhou1, Yifeng Qian5, Dexiong Chen4, Xuanlong Yu2, Xi Shen2

1 Didi International Business Group,
2 Intellindust AI Lab,
3 Institute of Automation, Chinese Academy of Sciences,
4 The Hong Kong University of Science and Technology (Guangzhou),
5 Didi Research

() corresponding author, shenxiluc@gmail.com

Figure teaser

We introduce Gated Token Recurrence (GTR), a softmax-free recurrent vision backbone that combines gated linear attention, alternating spatial scan directions, and spatially enhanced SwiGLU blocks. GTR models deliver strong dense predictions across segmentation, pose, depth, and detection, while scaling efficiently to high-resolution inputs.

Figure demo multitask

One GTR backbone, five dense prediction tasks on the same driving clip: object detection, instance segmentation, pose estimation, semantic segmentation and metric depth.

Figure demo depth3d driving Figure demo depth3d indoor

Metric depth predicted by GTR, unprojected into a 3D point cloud: an outdoor driving scene (left) and an indoor scene (right).

🔥 Changelog

  • [2026-10-15] 🚀 Optimized training infrastructure with batched matching-index transfers and caching, reducing CPU–GPU synchronization.
  • [2026-09-27] 🥳 Thanks to Xuban Ceccon (@EHxuban11) for integrating GTR into LibreYOLO!

📚 Table of Contents

Overview

Figure gtr pipeline

Each backbone block combines GLA with Spatial SwiGLU, whose 3×3 depthwise convolution mixes neighboring patch tokens in the value branch. The 12-layer backbone alternates two-dimensional scan directions and exposes intermediate features to a lightweight three-scale projector. A query-based head decodes the resulting feature pyramid.

Chunkwise CUDA operator

Figure chunk gla latency

Isolated GLA operator latency on RTX 4090 (log scale), comparing FLA v0.5.0 with our inference-only operator under FP16 inputs and CUDA Graph execution. The source is in engine/gtr/backbone/csrc.

Getting Started

Prepare Environment

Reference environment: Python 3.11, CUDA 12.8, PyTorch 2.11.0.

git clone https://github.com/Intellindust-AI-Lab/GTR.git && cd GTR
Install Packages
pip install -r requirements.txt
bash engine/gtr/backbone/csrc/build.sh   # optional: fused CUDA GLA kernel used for the latency numbers

Without the CUDA extension (or with GTR_DISABLE_CUDA_GLA=1) the backbone falls back to the flash-linear-attention Triton kernel.

Prepare Data

The dataset configs in configs/dataset/ expect the following layout under ./dataset:

dataset/
├── coco/{train2017,val2017,annotations}
├── cityscapes/{leftImg8bit,gtFine,train.txt,val.txt}
├── nyu/{nyu_depth_v2_labeled.mat,splits.mat}
└── DOTA/...

Model zoo

All checkpoints live in one Hugging Face repository: GTR. Fetch everything with

hf download Phoenix8125/GTR --local-dir weights

Every task checkpoint stores both the raw weights (model) and the EMA weights (ema). All reported numbers are evaluated with the EMA weights, which is what --test-only uses. Latency is the median single-image FP16 forward time on one RTX 4090 (see the paper for the full protocol).

Object detection — COCO val2017, 640×640
ModelParams (M)GFLOPsLatency (ms)APAP50AP75APSAPMAPLConfigWeights
GTR-S12.133.81.22553.671.158.336.458.370.2ymlgtr_s_coco.pth
GTR-M22.762.61.46257.375.062.441.162.074.1ymlgtr_m_coco.pth
GTR-L37.2106.01.90858.976.864.342.464.076.0ymlgtr_l_coco.pth
GTR-X46.5130.22.11559.477.364.742.164.676.4ymlgtr_x_coco.pth
Instance segmentation — COCO val2017, 640×640 (mask AP)
ModelParams (M)GFLOPsLatency (ms)APAP50AP75APSAPMAPLConfigWeights
GTR-S12.646.81.46545.067.948.323.848.465.9ymlgtrseg_s_coco.pth
GTR-M23.684.21.80747.771.351.627.751.369.3ymlgtrseg_m_coco.pth
GTR-L38.1127.62.25049.573.553.628.553.571.3ymlgtrseg_l_coco.pth
GTR-X47.4151.62.47249.874.253.828.553.771.4ymlgtrseg_x_coco.pth
Human pose estimation — COCO val2017 keypoints, 640×640
ModelParams (M)GFLOPsLatency (ms)APAP50AP75APMAPLARConfigWeights
GTR-S11.937.01.45570.189.776.862.681.176.1ymlgtrpose_s_coco.pth
GTR-M22.869.81.86074.191.580.767.584.179.6ymlgtrpose_m_coco.pth
GTR-L38.4115.52.32874.791.981.668.384.579.9ymlgtrpose_l_coco.pth
GTR-X47.6142.92.59075.592.481.869.185.380.7ymlgtrpose_x_coco.pth
Semantic segmentation — Cityscapes val, 1024×1024 sliding window
ModelParams (M)GFLOPsLatency (ms)mIoUConfigWeights
GTR-S6.982.81.49581.5ymlgtrsemseg_s_cityscapes.pth
GTR-M12.9153.01.97083.0ymlgtrsemseg_m_cityscapes.pth
GTR-L25.0258.72.95883.2ymlgtrsemseg_l_cityscapes.pth
GTR-X32.2317.13.48283.6ymlgtrsemseg_x_cityscapes.pth
Monocular depth estimation — NYU Depth V2, Eigen test split

🔴 GTR performs metric depth estimation and directly predicts depth in meters.

Six test-time views and a per-image log-affine fit to ground truth, no NYU fine-tuning (tools/eval_nyu_depth.py).

ModelParams (M)GFLOPsLatency (ms)δ1 ↑AbsRel ↓RMSE ↓ConfigWeights
GTR-S11.565.01.2960.9460.0740.336ymlgtrdepth_s.pth
GTR-M19.493.21.5080.9520.0690.319ymlgtrdepth_m.pth
GTR-L33.9136.61.9480.9510.0690.328ymlgtrdepth_l.pth
GTR-X41.1159.42.1580.9540.0670.317ymlgtrdepth_x.pth
Oriented object detection — DOTA-v1.0 test (evaluation server), 1024×1024
ModelParams (M)GFLOPsLatency (ms)AP50ConfigWeights
GTR-S12.182.81.94680.0ymlgtrobb_s_dota.pth
GTR-X46.3324.03.96081.3ymlgtrobb_x_dota.pth
Pre-trained weights

Evaluation

Per-task evaluation commands

train.py --test-only -r <checkpoint> evaluates the EMA weights of a checkpoint:

# detection / instance segmentation / pose / semantic segmentation
python train.py -c configs/det/coco_finetune/gtr_s.yml             --test-only -r weights/det/gtr_s_coco.pth
python train.py -c configs/seg/coco_seg_finetune/gtrseg_s.yml      --test-only -r weights/seg/gtrseg_s_coco.pth
python train.py -c configs/pose/coco_pose_finetune/gtrpose_s.yml   --test-only -r weights/pose/gtrpose_s_coco.pth
python train.py -c configs/semseg/cityscapes_finetune/gtrsemseg_s.yml --test-only -r weights/semseg/gtrsemseg_s_cityscapes.pth

# monocular depth on NYU Depth V2 (paper protocol)
python tools/eval_nyu_depth.py -c configs/depth/pretrain/gtrdepth_s.yml -r weights/depth/gtrdepth_s.pth

# DOTA-v1.0 test: writes the Task1 files to upload to the evaluation server
python tools/dota_submit.py -c configs/obb/dota_finetune/gtrobb_s.yml -r weights/obb/gtrobb_s_dota.pth \
    --weights ema --img-dir <test patches> --out-dir outputs/dota_submit/gtrobb_s

Training

Launch script, staged initialisation and per-task commands

train.sh launches torchrun on the visible GPUs, logs to the output folder and auto-resumes from the newest checkpoint found there:

CONFIG=configs/det/coco_finetune/gtr_s.yml ./train.sh -t weights/init/gtr_s_obj365_full_raw.pth

All released models were trained on 8 GPUs in pure FP32 with TF32 matmul/conv enabled (use_amp: False, GTR_TF32=1, the defaults of train.sh) and with the global batch size written in each config. Seed 0 everywhere except pose, which used SEED=1.

Staged initialisation

Every stage starts from the raw (model, non-EMA) weights of the previous stage, passed to train.py with -t. Since -t uses the EMA weights when available, we first re-pack the raw checkpoint with tools/export_init_weights.py:

StageInitialised fromHow to build the -t file
COCO detectionObjects365 detector, whole model--ckpt weights/obj365/gtr_s_obj365.pth
COCO instance segmentationCOCO detector, whole model--ckpt weights/det/gtr_s_coco.pth
COCO poseCOCO detector, backbone only--ckpt weights/det/gtr_s_coco.pth --backbone-only
Cityscapes semantic segmentationObjects365 detector, backbone only--ckpt weights/obj365/gtr_s_obj365.pth --backbone-only
DOTA oriented detectionObjects365 detector, backbone only--ckpt weights/obj365/gtr_s_obj365.pth --backbone-only
DepthObjects365 detectorpass weights/obj365/gtr_s_obj365.pth to -t directly
python tools/export_init_weights.py --ckpt weights/obj365/gtr_s_obj365.pth \
    --out weights/init/gtr_s_obj365_full_raw.pth
python tools/export_init_weights.py --ckpt weights/obj365/gtr_s_obj365.pth \
    --out weights/init/gtr_s_obj365_backbone_raw.pth --backbone-only
Commands
CONFIG=configs/det/coco_finetune/gtr_s.yml              ./train.sh -t weights/init/gtr_s_obj365_full_raw.pth
CONFIG=configs/seg/coco_seg_finetune/gtrseg_s.yml       ./train.sh -t weights/init/gtr_s_coco_full_raw.pth
CONFIG=configs/pose/coco_pose_finetune/gtrpose_s.yml SEED=1 ./train.sh -t weights/init/gtr_s_coco_backbone_raw.pth
CONFIG=configs/semseg/cityscapes_finetune/gtrsemseg_s.yml ./train.sh -t weights/init/gtr_s_obj365_backbone_raw.pth
CONFIG=configs/obb/dota_finetune/gtrobb_s.yml           ./train.sh -t weights/init/gtr_s_obj365_backbone_raw.pth
CONFIG=configs/depth/pretrain/gtrdepth_s.yml            ./train.sh -t weights/obj365/gtr_s_obj365.pth

Replace _s with _m, _l or _x for the other scales. The released checkpoint of each run is its last epoch, except oriented detection (GTR-S: epoch 11 of 20, GTR-X: epoch 13 of 30).

Inference and benchmarks

Single-image inference, FLOPs and latency
python tools/inference/torch_inf.py -c configs/det/coco_finetune/gtr_s.yml -r weights/det/gtr_s_coco.pth -i image.jpg
python tools/benchmark/flops.py --config configs/det/coco_finetune/gtr_s.yml
python tools/benchmark/torch_speed.py --configs configs/det/coco_finetune/gtr_s.yml --dtype fp16

TensorRT deployment🚀

TensorRT support lives in tensorrt_plugin/. It includes ONNX export, fp32/fp16 engine builds with trtexec, and PyTorch-vs-TensorRT checks. GLA is handled by a TensorRT plugin backed by the CUDA kernels in engine/gtr/backbone/csrc.

More details are in tensorrt_plugin/README.md.

Acknowledgements💗

This code base builds on EdgeCrafter, RF-DETR, DPT, RiO-DETR and flash-linear-attention.

We thank Zhangchi Hu for helpful suggestions on the oriented object detection task.

Citation

If you find GTR useful in your research or applications, please consider giving us a star ⭐ and citing it by the following BibTeX entry.

@article{gtr2026feng,
  title   = {GTR: Gated Token Recurrence for Efficient Dense Prediction},
  author  = {Feng, Zhe and Liu, Longfei and Liu, Wei and Chen, Kai and Kong, Jiangang and Zhou, Wei and Qian, Yifeng and Chen, Dexiong and Yu, Xuanlong and Shen, Xi},
  journal = {arXiv preprint arXiv:2609.26590},
  year    = {2026}
}

Alternatives

Model output
Input test photo
⇆
InputOutput