TL;DR
SAM 3 can natively segment objects from text prompts, yet it stumbles on complex descriptions because a single <start_of_text> token acts like a gravitational sink, swallowing over half of the model’s cross-attention budget. Rather than retraining the network or bolting on a heavy Large Language Model, eSAM fixes this at inference time by surgically editing SAM 3's internal attention maps and value tensors. The result is a fast, completely training-free upgrade that unlocks state-of-the-art referring segmentation across images and videos.
What Problem Does This Paper Address?
Imagine asking an AI to outline "the clear bottle between the candles without a yellow cap." This task—Referring Expression Segmentation (RES)—requires tight, pixel-level coordination between vision and free-form language. Training models specifically for RES requires mountains of expensive pixel-mask and text pairs. To dodge this annotation tax, researchers often stitch together Rube Goldberg pipelines—say, using CLIP or a massive Multimodal LLM to guess a bounding box, then feeding that box into SAM. Errors inevitably cascade down the line.
SAM 3 promised a cleaner path by building text-prompted segmentation natively into a single foundation model. Yet out of the box, its RES performance is underwhelming. Why? When the authors looked inside SAM 3’s multimodal fusion encoder, they found a severe attention sink: image patches route an average of 54.8% of their cross-attention mass straight to the <start_of_text> (SOT) token, starving the actual descriptive words (like "bottle" or "yellow") of influence.
Methods
The authors keep SAM 3 completely frozen and view its cross-attention layer through two distinct stages: routing (the softmax probabilities deciding which words each image patch listens to) and readout (the value vectors determining how loudly those words speak). eSAM intervenes in both stages at a single fusion layer during inference:
- Spatial Prior Generation (Standard): First, a lightweight, off-the-shelf open-vocabulary segmenter (CLIPSeg) generates a coarse heatmap from the image and text, normalized to $[0, 1]$. This serves as a rough "warm/cold" map of where the target likely lives.
- Attention Mask Editing – AME (Novel): Simply suppressing the SOT token everywhere causes freed-up attention to scatter randomly across the background. Instead, AME uses the spatial prior $h$ to modulate pre-softmax logits selectively. Where $h$ is high, AME simultaneously suppresses the SOT logit ($-\beta h_i$) and boosts content-token logits ($+\alpha h_i$). Where $h$ is near zero, SAM 3's native routing is left untouched.
- Value Tensor Editing – VTE (Novel): Fixing routing probabilities isn't the whole story if the content tokens' value vectors have small magnitudes. VTE scales up the value vectors of all content tokens by $(1 + \gamma)$, amplifying their contribution to the final fused visual features without altering vector directions.
Datasets
Because eSAM is completely training-free, no training datasets are used (hyperparameters are selected on the RefCOCO validation split and held fixed everywhere else). Evaluation spans seven standard benchmarks, with no new datasets introduced:
- Referring Image Segmentation (RIS): RefCOCO, RefCOCO+, RefCOCOg, and gRefCOCO (which tests multi-target and complex expressions).
- Referring Video Object Segmentation (RVOS): Ref-DAVIS17, Ref-YouTube-VOS, and MeViS (which focuses on challenging motion-centric descriptions).
Key Insights and Ideas
- Plug-and-play prompting fails where internal surgery succeeds: What if you just converted CLIPSeg’s heatmap into boxes, points, or masks and fed them into SAM 3 as standard prompts? The authors tried this, and performance dropped by 16–19 IoU points below vanilla SAM 3. Injecting that exact same noisy prior inside cross-attention yields a +6.39 IoU jump—proving SAM 3's internal text-visual fusion is far more resilient than external prompt conversion.
- Unconditional sink-plugging backfires: Uniformly suppressing the SOT token across every patch actually degrades accuracy slightly compared to just boosting content words. Freed attention needs directional guidance; otherwise, background patches latch onto foreground descriptions.
- The "Goldilocks" layer:SAM 3 has six fusion layers (L0–L5), and editing only Layer 1 (L1) consistently beats editing any other layer—or even editing multiple layers at once. L1 sits right after initial image-text contact, giving the remaining four layers enough depth to organically propagate and refine the edited features.
Key Results
Across non-LLM training-free baselines, eSAM sweeps the board:
- Images (RIS): Averaged across all 11 dataset splits, eSAM boosts overall IoU (oIoU) by +8.51 over vanilla SAM 3 and +12.20 over RefAM (the strongest prior training-free method). On RefCOCO val, it hits 53.62 oIoU—even beating zero-shot methods that require auxiliary training like VLM-VG (+8.22 oIoU).
- Videos (RVOS): Averaged across all three video benchmarks, eSAM improves the combined region and contour score ($\mathcal{J}\&\mathcal{F}$) by +13.64 over SAM 3 and +8.09 over RefAM (e.g., jumping from 42.43 to 57.50 $\mathcal{J}\&\mathcal{F}$ on Ref-YouTube-VOS).
- Negligible Overhead: eSAM adds just 1.5% extra FLOPs (entirely from tiny CLIPSeg) and 24 milliseconds of latency per image (0.146s $\rightarrow$ 0.170s on an A6000 GPU). By comparison, diffusion-based RefAM takes 3.97s, and MLLM-driven pipelines take 12–23s per image.
- Tough Linguistic Edge Cases: On complex subsets, eSAM leaps ahead of SAM 3 on lexical negation (+6.22 oIoU) and multi-target queries (+18.88 oIoU).
Limitations and Future Work
- Mystery of Layer 1: While empirical feature-change ratios confirm L1 is special in SAM 3, the authors note that why L1 dominates—and whether this sweet spot generalizes to other vision-language architectures—remains an open theoretical question.
- Reliance on External Priors: Routing guidance still leans on an external model (CLIPSeg). Stronger or task-adaptive spatial priors could push accuracy further.
- Symptom vs. Cure: eSAM patches an attention sink in a frozen network at test time. A natural next step is monitoring routing and readout distributions during pre-training, designing auxiliary loss terms that prevent foundation models from forming attention sinks in the first place.
Summary updated