arXiv:2610.19931cs.CVOct 2026

Manuscript Offprint

arXiv:2610.19931

SAM3RL: Memory Control via Reinforcement Learning for Visual Object Tracking

Tomáš Čížek, Matej Straka, Illia Volkov, Matěj Kripner, Ervin Macić, Jiri Matas, Klara Janouskova, Martin Schmid

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Segment Anything Model 3 (SAM 3) is a foundation model for image and video segmentation that sets the state of the art in visual object tracking. Its tracker, inherited from SAM 2, stores information from past frames in a memory bank, managed by a simple First-In-First-Out rule, allowing temporal consistency in complex videos. Several recent methods improve SAM 2 with hand-crafted memory update rules, each targeting a specific failure mode, such as distractors, occlusions, or object motion. However, their gains transfer only partially to the stronger SAM 3 backbone. We instead present a more general, data-driven approach that frames memory control as a sequential decision-making task. SAM3RL is an extension of the SAM 3 tracker with a lightweight memory controller, trained by reinforcement learning, that decides which frames enter the memory bank in order to maximize tracking performance. SAM3RL sets a new state of the art on 10 of 12 tracking and video object segmentation benchmarks, outperforming all hand-crafted rules without any runtime overhead. The same approach applied to SAM 2 gives SAM2RL, which outperforms hand-crafted rules on 9 of the 12 benchmarks, showing the generality of our method across model generations.

1 INTRODUCTION

Visual object tracking is a fundamental computer vision task in which a tracker is given a target object in the first frame of a video and must localize it, as a box or a segmentation mask, in all subsequent frames. Reliable tracking is a key component of applications such as autonomous driving, robotics, video surveillance, and sports analytics (Marvasti-Zadeh et al., 2022). The task remains difficult since the target may be surrounded by visually similar distractors, be occluded for long periods, or change its appearance. These challenges are amplified in long videos, where errors can accumulate over time and recovery depends critically on historical context (Javed et al., 2023).

Recent state-of-the-art trackers are built on the Segment Anything Model (SAM) family. SAM 2 (Ravi et al., 2025) is a promptable video segmentation model that conditions each mask prediction on features from past frames held in a small, fixed-size memory bank. SAM 3 (Carion et al., 2026) targets promptable concept segmentation, while inheriting the tracker architecture from SAM 2. The original SAM 2 populates the bank with a simple First-In-First-Out (FIFO) rule that keeps the most recent frames regardless of quality or relevance. Therefore, a line of follow-up work replaces FIFO with hand-crafted update rules, including motion-aware frame selection (Yang et al., 2026; Chen et al., 2026), distractor-aware memory (Videnović et al., 2026), and calibrated prototype memory with positional priors (Xu et al., 2025); some go further and also select among mask candidates by motion consistency (Yang et al., 2026; Chen et al., 2026) or maintain several banks and search over them (Ding et al., 2025b). SAM 3 also follows this approach and refines FIFO by keeping only frames in which the object is not occluded, plus the most recent frame.

Figure

Figure 1: Gains from hand-crafted rules vs. our learned memory control SAM3RL (left) and SAM2RL (right). Each axis is a tracking or video segmentation benchmark, spanning three categories: VOT(S) challenges (VOTS 2025/2026_{2025/2026}, VOTS-RT 2025_{2025}, and VOT-LT 2021/2022_{2021/2022}), visual object tracking (DiDi, LaSOT, LaSOT ext_{ext}), and video object segmentation (MOSE v2_{v2}, SA-V val/test_{val/test}, LVOS v2_{v2}). The radius shows the change in that benchmark's standard metric relative to the corresponding baseline tracker (SAM 3 or SAM 2). The outer labels give our score on each benchmark. The compared methods modify what the tracker stores in the memory bank, and in most cases also mask selection or the number of banks. In contrast, our policy operates with the memory bank only. The compared methods are evaluated on SAM 2 as published and on SAM 3 after our porting to that backbone.

However, each of the hand-crafted rules targets a particular failure mode, such as distractors, occlusions, or fast motion. Ideally, the tracker should be robust to all of them at the same time. Moreover, these rules are tied to the model generation they were designed for, as all heuristics developed for SAM 2 transfer poorly to the stronger SAM 3. Their gains on tracking benchmarks are limited, and on video object segmentation they even fall below SAM 3 on most benchmarks; see Figure 1.

In this work, we show that memory control should be learned rather than designed. We formulate memory control as a Markov Decision Process (MDP), designing the state, actions, and reward, but leaving the choice of what to remember to the agent. That choice is learned by reinforcement learning (RL) directly from data, without touching the tracker itself. We introduce SAM3RL, which applies this memory control formulation to SAM 3 and sets a new state of the art on several tracking benchmarks, most notably on the VOTS and VOT-LT challenges. It does so at no additional inference cost and, unlike hand-crafted rules, without sacrificing performance on video object segmentation. Applied to SAM 2, the same recipe yields SAM2RL, which still outperforms hand-crafted rules on most benchmarks, showing the generality of our learned method across model generations.

Our contributions are as follows:

Learned memory control for SAM-based trackers. We formulate memory bank control in SAM-based trackers as an MDP over a fixed-capacity bank. The state describes the content of the bank, the action selects the entry to evict, and the reward scores the resulting prediction against the annotation. This formulation allows the memory control to be learned instead of being manually designed.

State-of-the-art visual object tracker. We present SAM3RL, which extends SAM 3 with a memory controller obtained by optimizing the introduced MDP with RL. It improves over SAM 3 on 11 out of 12 benchmarks and ranks first on 10 of them. The largest gains are achieved on the VOT(S) challenges, with +3.6 on VOTS 2026_{2026} and +5.5 on VOT-LT 2022_{2022}. It is also the only tracker that consistently succeeds in video object segmentation, scoring +1.1 on MOSE v2_{v2} and +2.5 on SA-V val_{val}.

SAM3RL achieves this while optimizing the memory control only, whereas most compared methods additionally modify mask selection, prompting, or the number of banks maintained.

Online controller without a runtime penalty. The SAM3RL controller is a lightweight MLP evaluated once per memory update. It reads only values the tracker has already computed, and stays fully online without lookahead or extra feature extraction, unlike other methods. On tracking benchmarks, SAM3RL is faster than SAM 3, at 16.0 FPS against 15.3 FPS, as the memory is updated only every sixth frame, matching the decision rate used in training. Under the real-time FPS constraint of VOTS-RT 2025_{2025}, SAM3RL stays best at 75.1, dropping only 1.8 points, while SAM 3 drops 4.3.

Generality across model generations. SAM2RL is obtained by applying the same recipe to SAM 2. It improves the baseline on all 12 benchmarks and leads on 9 of them, although every compared rule was designed specifically for SAM 2. SAM2RL still remains faster than SAM 2, at 25.5 FPS against 25.1 FPS. Together with SAM3RL, this demonstrates the generality of the introduced method.

References (64)