---
title: Motion-Aware Transformer (MATR)
url: https://www.emergentmind.com/topics/motion-aware-transformer-matr
type: topic
---

# Motion-Aware Transformer (MATR)

Searching arXiv for the specified papers to ground the article in current literature.
Searching arXiv for "2205.05854 Motion-aware Transformer".
“Motion-Aware Transformer” (MATR) denotes a class of Transformer-based architectures that incorporate explicit motion modeling into representation learning, attention, positional encoding, or query propagation. In the literature provided here, the name has been used for distinct systems addressing language-driven action localization, multi-object tracking, action detection, and occluded person re-identification, while closely related work on 4D reconstruction adopts motion-aware Transformer components without using the same acronym [2205.05854], [2509.21715], [2405.08204], [2202.04243], [2603.05078]. Across these formulations, the common design principle is that standard Transformer operations are supplemented with motion-specific inductive structure in order to improve temporal precision, boundary estimation, association robustness, spatiotemporal semantics, or part alignment.

## 1. Scope and usage of the term

In the sources considered here, MATR is not a single canonical architecture but a recurring designation for task-specific Transformer designs that make motion an explicit computational object. In language-driven action localization, the Motion-aware Transformer is the second stage of a two-stage pipeline and refines start and end boundaries within a shrunken temporal window by modeling fine-grained motion dynamics via an LSTM-augmented self-attention Transformer guided by motion queries [2205.05854]. In multi-object tracking, MATR is a module inserted between encoder and decoder to predict object movement across frames and update track queries in advance, thereby reducing “query collisions” [2509.21715]. In action detection, the acronym denotes a Semantic and Motion-Aware Spatiotemporal Transformer Network whose motion-aware network encodes the locations of action semantics in video frames utilizing a motion-aware 2D positional encoding algorithm [2405.08204]. In occluded person re-identification, MATR refers to a transformer encoder-decoder architecture coupled with self-supervised keypoint detection, affine motion estimation, and motion-assisted part segmentation [2202.04243].

A related but differently named system is MoRe, a “Motion-aware Feed-forward 4D Reconstruction Transformer,” which extends a static-scene reconstruction Transformer with attention-forcing, grouped causal attention, and a bundle-adjustment-like global refinement to recover dynamic 3D scenes from monocular videos [2603.05078]. This suggests that “motion-aware Transformer” functions less as a single method name than as a design family spanning several computer vision subfields.

## 2. Core architectural motifs

A shared architectural pattern is the modification of standard Transformer components so that motion is represented explicitly rather than left to emerge implicitly from generic self-attention. The precise mechanism differs by task.

For language-driven action localization, motion enters through both query construction and self-attention. The sentence is embedded with GloVe and a standard Transformer, and motion query features are defined by retaining only those word embeddings relevant to motion or “others,” using POS-derived one-hot tags. Within the video branch, each Q/K/V linear projection is replaced by a multi-scale LSTM so that the self-attention head operates on motion-sensitive projected features rather than conventional linear projections [2205.05854].

For multi-object tracking, the central architectural intervention is the Motion-Aware Transformer module placed between the encoder and the deformable decoder. Track queries from the previous frame are first updated through self-attention and cross-attention with the current encoder memory, and the residual update is applied both to the query features and to the positional box embeddings. The updated track queries are then concatenated with fixed detection queries and passed into a standard multi-layer Deformable Transformer Decoder [2509.21715].

For action detection, motion awareness is built into the spatiotemporal backbone at several levels. RGB frames are processed with a DETR-style detector to identify persons and objects, optical flow is extracted via FastFlowNet, and a Motion-Memory Module produces 2D motion offsets and motion memory features. These are fused with spatial and motion embeddings through motion-aware positional encoding, multi-feature selective semantic attention, and sequence-based temporal attention [2405.08204].

For occluded person re-identification, a CNN plus Transformer encoder-decoder first produces globally aware features. A self-supervised keypoint-detection branch predicts unsupervised keypoint heatmaps and local Jacobians, and a part-segmentation branch uses transformer features together with motion cues derived from the keypoints to generate refined segmentation maps for body parts plus background [2202.04243].

For 4D reconstruction, motion awareness is realized through attention-forcing during training, grouped causal attention for streaming inference, incremental KV-caching, and one global “bundle-adjustment-like” attention pass over cached keys and values to refine camera poses [2603.05078].

## 3. Mechanisms for representing motion

The formulations differ substantially in how motion is encoded, supervised, and coupled to attention.

In the action-localization MATR, motion is represented linguistically and visually. Motion queries are derived from sentence tokens with POS-derived one-hot vectors $p_i=[p_e,p_m,p_o]$, and the motion query features are
$$
f_{q,i}^m = f_{q,i}\cdot (p^m_i + p^o_i),
$$
so that $F_q^m\in\mathbb R^{N\times d}$ collects only those word embeddings relevant to motion or “others.” On the visual side, the model replaces each self-attention projection with a multi-scale LSTM:
$$
f_{\nu} = \mathrm{LSTM}^S_{\nu}(V^{in}),\quad \nu\in\{Q,K,V\},
$$
with
$$
\mathrm{LSTM}^S(V^{in}) = \bigl[L_1(V^{in});\,L_2(V^{in});\cdots;L_S(V^{in})\bigr].
$$
At scale $\ell$, the recurrent unit processes temporally strided subsequences such as $\{\ldots,v_{i-2\ell}^{in},v_{i-\ell}^{in},v_i^{in},v_{i+\ell}^{in},v_{i+2\ell}^{in},\ldots\}$ in order to capture motion at temporal stride $\ell$ [2205.05854].

In the multi-object-tracking MATR, motion is represented as an explicit update of track-query features and bounding-box embeddings. If $Q_{\mathrm{trk}}^t$ are track embeddings and $PE_{\mathrm{trk}}^t\in\mathbb R^{N_{\mathrm{trk}}\times 4}$ are box embeddings, the MAT module computes
$$
U_{\mathrm{trk}}^{t} = Q_{\mathrm{trk}}^{t} + \mathrm{CrossAtt}(\mathrm{SelfAtt}(Q_{\mathrm{trk}}^{t}),\,M^t),
$$
and regresses a box update $\Delta p^t$ that is added to $PE_{\mathrm{trk}}^t$. The paper also writes the motion view as
$$
\Delta p^t = f_{\mathrm{motion}}(Q_{\mathrm{trk}}^t), \qquad
Q_{\mathrm{trk}}^{t+1} = Q_{\mathrm{trk}}^t + \Delta p^t .
$$
This construction treats motion as a supervised pre-alignment step before the decoder [2509.21715].

In the action-detection MATR, motion is represented by learned 2D offsets in positional encoding. If $p_i^x,p_i^y$ are initial patch indices and $\Delta p_i^x,\Delta p_i^y$ are horizontal and vertical motion offsets from the Motion-Memory module, then the motion-aware positional encoding is
$$
P_A^X(p_i^x,2n)=\sin\!\Bigl(\frac{p_i^x+\Delta p_i^x}{\psi^{2n/d_m}}\Bigr),\quad
P_A^X(p_i^x,2n+1)=\cos\!\Bigl(\frac{p_i^x+\Delta p_i^x}{\psi^{2n/d_m}}\Bigr),
$$
with an analogous definition for $P_A^Y$. Concatenating these gives $P_A\in\mathbb R^{(N+N')\times d_f}$, which is added to both spatial and motion features [2405.08204].

In the re-identification MATR, motion is represented by local affine maps induced by self-supervised keypoints. If $\mathcal I_r,\mathcal I_t$ are two images of the same identity in different poses, the local warp near keypoint $i$ is approximated by
$$
\mathbf p' = A_i\,\mathbf p + b_i,\qquad A_i=J_i,
$$
and the dense motion field for pixel $z$ in part region $M_i^t$ is
$$
F_{r\gets t}(z)= s_i^r + J_i\bigl(z-s_i^t\bigr).
$$
The target feature map is then warped as
$$
f^{rt}(z)=f^t(F_{r\gets t}(z)),
$$
and this motion-warped feature is fed back to the segmentation branch [2202.04243].

In MoRe, motion is encoded through motion masks during training and through constrained temporal attention during inference. The attention-forcing strategy defines patch-level staticity scores
$$
a_i = 1 - \frac1{s^2}\sum_{(u,v)\in m_i} M_t(u,v), \qquad a_i\in[0,1],
$$
and penalizes camera-token attention on moving regions via
$$
\mathcal L_{\mathrm{attn}}
=
\frac1M\sum_{i=1}^M \max(0,a_i-C)\,\alpha_i .
$$
Streaming inference applies grouped causal attention:
$$
F_t=\mathrm{Attn}\bigl(Q_t,[K_{1:t-1},K_t],[V_{1:t-1},V_t]\bigr),
$$
followed by a global camera-query refinement over the full cache after all frames have been processed [2603.05078].

## 4. Attention design and temporal reasoning

The attention mechanisms used in these systems show several distinct strategies for incorporating motion priors into Transformer computation.

The action-localization MATR modifies the self-attention head itself by replacing the standard linear Q/K/V projections with multi-scale LSTMs, then performing
$$
h = \mathrm{softmax}\Bigl(\frac{f_Q f_K^\top}{\sqrt d}\Bigr)\cdot f_V .
$$
The resulting motion-aware visual features $F_v^m$ are fused with motion queries by context-query attention,
$$
F^{vm} = \mathrm{CQA}\bigl(F_q^m,\;P_e\odot F_v^m\bigr),
$$
where $P_e$ is the action-relevant score from the first stage [2205.05854]. This design localizes motion modeling at the point where temporal neighborhoods are projected into attention space.

The action-detection MATR uses a more heterogeneous attention stack. Its Multi-Feature Selective Semantic Attention defines four pairings—GG, MM, GM, and MG—between spatial and motion streams:
$$
A^{GM}=\mathrm{Softmax}\bigl(\tfrac{Q^G (K^M)^T}{\sqrt{d_h}}\bigr)V^M,\quad
A^{MG}=\mathrm{Softmax}\bigl(\tfrac{Q^M (K^G)^T}{\sqrt{d_h}}\bigr)V^G,
$$
with analogous terms for $A^{GG}$ and $A^{MM}$. Queries are formed only from person embeddings, while keys and values come from all semantics. The model then applies a sequence-based temporal attention whose correlation matrix is designed to penalize differences between frame features with respect to the global covariance of the sequence, rather than relying only on similarity [2405.08204]. A plausible implication is that this formulation aims to prioritize frames that are discriminative for action identity even when they are not maximally self-similar.

The multi-object-tracking MATR retains standard Transformer operations but changes when and where they are applied. Motion-aware self-attention and cross-attention are executed on track queries before those queries enter the shared detection-and-tracking decoder. The stated purpose is to reduce the gap between a stale query and its true object before Hungarian matching, thereby lowering query collisions [2509.21715].

MoRe adopts a different temporal attention regime oriented toward real-time reconstruction. Within each frame, image tokens attend bidirectionally for spatial consistency; across frames, each token at time $t$ may only attend to keys and values from frames $1\ldots t$, enforcing temporal causality. After all frames, camera queries receive one global attention pass over the entire cache to recover long-range consistency in camera estimation [2603.05078]. This combination separates streaming efficiency from global pose refinement.

## 5. Optimization objectives and supervision

The various MATR formulations are also distinguished by their supervisory signals, which reflect the kind of motion information each task requires.

For language-driven action localization, boundary precision is optimized with a start-end classification loss and an auxiliary inner-frame prediction loss:
$$
\mathcal L^{boundary} = \mathrm{XE}(P_s^b,\tau_s)+\mathrm{XE}(P_e^b,\tau_e),
$$
$$
P^{in}=\sigma\bigl(\mathrm{FC}_b(\mathrm{ReLU}(\mathrm{FC}_a(F^{vm})))\bigr),\qquad
\mathcal L^{inner} = \mathrm{BXE}(P^{in},Y^{in}),
$$
and the total loss is
$$
\mathcal L = \lambda_1\,\mathcal L^{boundary} + \lambda_2\,\mathcal L^{inner},
$$
with $\lambda_1=1$ and $\lambda_2=10$ [2205.05854].

For multi-object tracking, the overall objective is
$$
L_{\mathrm{MATR}} = \tau_{\mathrm{traj}}L_{\mathrm{traj}} + L_{\mathrm{MOTR}},
$$
where $L_{\mathrm{MOTR}}$ is the original MOTR loss with 1-to-1 Hungarian matching, per-query classification cross-entropy, and per-matched-query L1 plus GIoU box regression, while
$$
L_{\mathrm{traj}} = \frac1N \sum_{b=1}^B \sum_{t=1}^S \sum_{i=1}^{N_{\mathrm{trk}}}
\|\hat Y_{\mathrm{bbox}}^{b,t,i} - Y_{\mathrm{bbox}}^{b,t,i}\|_1 .
$$
The weighting $\tau_{\mathrm{traj}}$ is set to $5$ [2509.21715].

For action detection, the training loss combines frame-level and sequence-level cross-entropy:
$$
L = -\sum_{t=1}^{\tau}\sum_{c=1}^{C_l}y_t^{(c)}\log\hat y_t^{(c)}
-\alpha\sum_{c=1}^{C_l}Y^{(c)}\log\hat Y^{(c)},
$$
with $\alpha=2.4$ [2405.08204].

For occluded person re-identification, training is end-to-end with six losses: global and local ID losses, global and local triplet losses, an equivariance loss on keypoints, and a feature-consistency loss on warped features. The full objective is
$$
\mathcal L
= \lambda_1 \mathcal L_{\mathrm{id}}^g
+ \lambda_2 \mathcal L_t^g
+ \lambda_3 \mathcal L_{\mathrm{id}}^p
+ \lambda_4 \mathcal L_t^p
+ \lambda_5 \mathcal L_{eq}
+ \lambda_6 \mathcal L_{fc},
$$
with $\lambda_{1\ldots4}=1$, $\lambda_5=10$, and $\lambda_6=5$ [2202.04243].

For MoRe, the supervision combines confidence-weighted regression for depth and point maps, motion mask classification, attention-forcing, and relative camera-pose loss. The depth and point-map term is
$$
\mathcal{L}_{\mathrm{conf}}
= \sum_{i=1}^N \Bigl(\hat c_i\,\|\hat y_i - y_i\|_2^2 - \lambda\log\hat c_i\Bigr),
$$
the motion-mask term is binary cross-entropy, and the camera term averages geodesic rotation error and translation error over frame pairs [2603.05078].

## 6. Empirical behavior across tasks

The reported results indicate that motion-aware Transformer designs improve performance in several distinct regimes, but the gains are tied to different evaluation criteria and should not be conflated across tasks.

For language-driven action localization, the pure motion-aware module was compared on Charades-STA using R@1 at IoU $=0.5$. The Standard Transformer (“FC Trans”) obtained $48.14\%$, Temporal-Conv + Trans obtained $55.86\%$, the Multi-scale LSTM layer without self-attention obtained $59.14\%$, and the Full LSTM-augmented Transformer obtained $61.69\%$. The same source reports that TACoS improves to $38.16\%$ at R@1 and IoU $=0.5$ [2205.05854].

For multi-object tracking, ablations on DanceTrack show a progression from the MOTR baseline at HOTA $=54.2$, DetA $=73.5$, AssA $=40.2$, MOTA $=79.7$, and IDF1 $=51.5$, to a strengthened baseline with DAB-style box propagation at HOTA $=58.8$, and then to the MAT module with a single decoder layer at HOTA $=63.6$, AssA $=52.7$, and IDF1 $=66.4$. The reported state-of-the-art results include HOTA $=71.3$ on DanceTrack with Swin-Tiny, HOTA $=72.7$ on SportsMOT, and mTETA $=54.7$, mHOTA $=41.6$, mAssocA $=59.0$ on the BDD100k validation set [2509.21715].

For action detection, the Semantic and Motion-Aware Spatiotemporal Transformer Network, denoted “SMAST” in the paper, reports state-of-the-art performance on AVA v2.2, AVA v2.1, UCF101-24, and EPIC-Kitchens. The listed figures are $40.2\%$ on AVA v2.2, $33.1\%$ on AVA v2.1, $85.5\%$ on UCF101-24, and on EPIC-Kitchens top-1 scores of Action $50.9\%$, Verb $70.1\%$, and Noun $64.8\%$. Its ablations attribute gains to motion-aware positional encoding, multi-feature attention, selective attention, and sequence-based temporal attention [2405.08204].

For occluded person re-identification, MATR reports on Occluded-Duke $66.2\%$ Rank-1 and $58.8\%$ mAP, on Occluded-REID $83.2\%$ and $73.5\%$, on Partial-REID $88.6\%$ Rank-1, on Partial-iLIDS $76.9\%$, and on Market-1501 and DukeMTMC-reID mAP values of $89.4\%$ and $81.8\%$. An ablation on Occluded-Duke shows a Baseline ResNet50 at $46.0\%/38.8\%$, then gains from segmentation plus self-supervised keypoints, then from a Transformer encoder, and finally the full encoder-decoder at $66.2\%/58.8\%$ [2202.04243].

For 4D reconstruction, MoRe reports camera pose estimation on Sintel, Bonn, TUM-dynamics, and ScanNet using ATE, RPE$_{\mathrm{trans}}$, and RPE$_{\mathrm{rot}}$. On Sintel, the streaming version reports ATE $=0.147$ m, RPE$_{\mathrm{trans}}=0.077$ m, and RPE$_{\mathrm{rot}}=0.616^\circ$. For video depth estimation on Sintel, the same source gives AbsRel $=0.254$ and $\delta<1.25=0.637$. For inference speed on KITTI at $512\times144$ on NVIDIA A800, the table lists VGGT at $7.3$ FPS, CUT3R at $16.6$ FPS, Stream3R$^\alpha$ at $23.5$ FPS, 3R$^\beta$ window $=5$ at $32.9$ FPS, and MoRe with grouped causal attention plus window $=5$ at $30.1$ FPS. Ablations report that removing attention-forcing changes Sintel ATE from $0.147$ to $0.163$, removing BA-refinement changes it to $0.155$, and removing grouped causal attention degrades Sintel depth AbsRel from $0.254$ to $0.277$ [2603.05078].

## 7. Interpretation, recurring advantages, and limitations

Across the formulations surveyed here, the principal recurring claim is not that Transformers alone suffice for motion understanding, but that explicit motion structure improves performance when standard attention is otherwise poorly matched to the task. In action localization, the stated motivation is that standard linear projections in Transformer cannot capture local, successive frame-to-frame motion changes, so Q/K/V are replaced by multi-scale LSTMs [2205.05854]. In multi-object tracking, the problem is that stale queries drift and collide under Hungarian matching, so motion prediction is used to pre-shift track queries before decoding [2509.21715]. In action detection, the motion-aware mechanism is introduced because standard 1D patch positional encoding cannot adapt when an object or person moves from one patch to another [2405.08204]. In 4D reconstruction, the motivation is that static backbones confuse moving objects with background when estimating camera pose, which leads to attention-forcing and grouped causal attention [2603.05078]. In occluded person re-identification, motion cues are used to identify major human body components and refine part segmentation under occlusion [2202.04243].

A common misconception would be to treat MATR as a single reusable architecture. The literature here indicates the opposite: the acronym is attached to substantially different mechanisms, including LSTM-augmented attention, motion-aware query updates, motion-aware positional encoding, affine keypoint warping, and training-time attention forcing. Another potential misconception is that “motion awareness” always implies optical flow. That is not the case in these sources: optical flow is explicit in the action-detection system, but motion is represented elsewhere through POS-filtered motion queries, track-box deltas, self-supervised affine fields, or binary motion masks.

The limitations are also task-specific. The occluded person re-identification paper notes that under extreme occlusions where few keypoints are visible, the affine approximation may degrade, that the current model processes still images in pairs, and that transformer plus motion-flow estimation is heavier than pure CNN pipelines [2202.04243]. For the other systems, the reported ablations imply that performance is sensitive to whether motion-aware components are retained: removing attention-forcing or BA-style refinement in MoRe degrades ATE, and replacing the full motion-aware module in action localization with simpler variants lowers R@1 [2603.05078], [2205.05854].

Taken together, these works define Motion-Aware Transformer not as a single standardized model but as a family of Transformer adaptations in which motion is injected into the computational graph as a first-class signal. The consistent pattern is that explicit motion-aware structure is used to correct a specific failure mode of generic attention: imprecise temporal boundaries, stale track queries, motion-insensitive positional encodings, unstable part grouping under occlusion, or camera-pose corruption from dynamic content.

Source: https://www.emergentmind.com/topics/motion-aware-transformer-matr