eSAM: Editing SAM3 Attention for Training-Free Referring Segmentation
Abstract
Referring expression segmentation (RES) aims to segment objects described by natural language in images (RIS) or videos (RVOS). Existing zero-shot methods reduce reliance on mask-language annotations but still require auxiliary training or multi-model pipelines. SAM 3 enables native text-prompted segmentation within a single foundation model, yet performs poorly when directly applied to RES. We trace this gap to an attention sink in its multimodal fusion encoder, where the start-of-text token absorbs a substantial portion of each image patch's cross-attention mass, limiting the influence of content tokens. Suppressing the sink alone redistributes attention indiscriminately, making spatial guidance necessary. We therefore introduce eSAM, a fully training-free framework that addresses this issue by editing SAM 3's cross-attention. Attention Mask Editing (AME) suppresses the sink and uses a CLIPSeg-derived, patch-dependent spatial prior to redirect attention toward relevant content tokens. Value Tensor Editing (VTE) rescales value tensors to amplify content-token contributions to the fused visual features. On RIS (RefCOCO/+/g) and RVOS (Ref-DAVIS17, Ref-YouTube-VOS, MeViS) benchmarks, eSAM achieves state-of-the-art performance among training-free methods without auxiliary LLMs.