← Robot Learning Notes / Others

SAM 3: Segment Anything with Concepts

10 min read

Find every instance of a concept, then keep each object's identity through video.

Model~850M parametersVision encoder~450MText encoder~300MDetector + tracker~100MPE pretraining5.4B image-text pairsHQ data4M phrases · 52.3M masksOntology22.4M nodesInput1008 × 1008 · 32 text tokens

Give SAM 3 “red cup” and it returns a separate pixel mask for every matching cup, with boxes and confidence scores. In video, each cup keeps an identity across frames. This is Promptable Concept Segmentation (PCS). Positive exemplar boxes show what to include; negative boxes show unwanted matches. Clicks can then refine an individual mask, preserving the visual-prompt capability of SAM 1 and SAM 2.

Paper §3; Appendix C.1–C.3

Inside the model

SAM 3 architecture: shared PE encoders, a concept-conditioned detector, and a SAM 2-style tracker with per-object memory. The detector has object queries, a presence token and segmentation heads.
Figure 10, original paper, p. 19. Original architecture: PE in cyan, SAM 2 components in blue, new SAM 3 components in yellow. Click the figure to enlarge.

1. Encode the image and the concept

The shared Perception Encoder (PE) vision transformer has ~450M parameters and 32 layers. It processes 1008 × 1008 images using mostly local attention in nine 336-pixel windows; four layers use global attention. Image features are computed once per frame and reused. The ~300M causal text transformer encodes up to 32 tokens, aligned with visual features through image-text pretraining.

An exemplar combines a box’s position, its positive/negative label and ROI-pooled visual features. A small transformer encodes it. Text and exemplar tokens jointly form the prompt. A six-layer fusion encoder lets image features attend to that prompt, highlighting evidence relevant to the concept.

2. Decode objects and check concept presence

A six-layer DETR-style decoder uses 200 learned object queries as candidate instance slots. They attend to each other, the prompt and the conditioned image, refining boxes at each layer. A MaskFormer-style head predicts instance masks, with SimpleFPN supplying feature scales. A semantic head also predicts all pixels matching the concept.

A separate global presence token decides whether the concept exists anywhere in the image. Each object query estimates its match conditional on presence; the final confidence multiplies the two:

score(queryᵢ) = P(concept present) × P(queryᵢ matches | present)

This separates global recognition from local mask placement. A cup-like patch should not get high confidence when the requested concept is absent. Negative image-phrase pairs train the presence head; per-query classification is supervised on positive pairs. A two-expert ambiguity head adjusts classification logits for competing phrase interpretations while sharing masks and boxes.

3. Track identities through video

On each frame, the detector finds concept matches while a SAM 2-style tracker propagates existing objects from per-object memory. IoU matching associates detections with propagated masks. New detections start new masklets, meaning sequences of masks for one object. Temporal confirmation removes spurious or duplicate tracks, and reliable detections periodically refresh the tracker to reduce drift.

The tracker predicts three candidate masks and chooses the most confident, with an occlusion head estimating visibility. It stores confidently present frames in memory. The default confirmation delay is 15 frames, and periodic re-prompting occurs every 16 frames when confidence and overlap pass thresholds. Detection treats cups as equivalent concept matches; tracking must preserve each cup’s identity.

Paper §4–5; Appendix D.3–D.6, E.1; Tables 24–25

What was annotated?

The image training unit is (image, noun phrase, complete set of matching masks). A positive “mug” pair needs every mug’s mask. A verified “wine glass” negative has an empty mask set. An omitted mug is a missing annotation, not evidence of absence, which makes exhaustivity central to training.

Annotations include instance masks, group masks for inseparable crowds, phrase-level presence or absence, and completeness judgments. Video adds consistent object IDs and masks across frames. Human correction can add, remove or repair masks and tracks. Difficult video collection also permits partially exhaustive clips when some objects cannot be annotated.

SubsetMediaUnique phrasesMasks / maskletsNegative pairs
SA-Co/HQ5.2M images4.0M52.3M88.5%
SA-Co/SYN39.4M images38.0M1.4B74.0%
SA-Co/EXT9.3M images497.4K70.5M71.8%
SA-Co/VIDEO52.5K videos24.8K467.1K26.7%

Tables 24–25. Counts are phrase-associated annotations; one object may match multiple phrases. Negative percentages refer to media-phrase pairs, not images.

HQ uses human or AI verification, rather than exclusively hand-drawn masks. SYN means automated labels on real MetaCLIP images, not generated images. EXT combines external annotations, including box-only labels converted to masks by SAM 2, and is partially exhaustive. VIDEO is human verified. SA-1B and other video segmentation datasets additionally support visual-prompt training.

Original Figure 12 compares image and video training datasets by media and phrase counts, with annotation distribution across ontology categories.
Figure 12, original paper, p. 34. Bubble size represents phrase-mask or phrase-masklet counts; the category chart measures annotations, not ontology nodes. Click the figure to enlarge.

Paper §4; Appendix D.2–D.6; Tables 20–23

The vocabulary list and data engine

The 22.4M-node vocabulary is a Wikidata ontology for collecting data, organized into 17 top-level categories and 72 subcategories. It is distinct from the 4M noun phrases in HQ and from the text tokenizer. SAM 3 accepts a phrase at inference; it does not choose from 22.4M fixed output classes.

The authors select high-level Wikidata nodes and include their descendants. Sentence-BERT retrieves candidate nodes for a phrase, and Llama 3.2 chooses the closest match. This guides image retrieval, coverage balancing, synonyms and hierarchical consistency: an annotated canoe must also count as a boat when both labels are used.

Table 20: all 17 SA-Co ontology categories and 72 subcategories with their Wikidata node counts.
Table 20, original paper, p. 27. The paper’s full category list. Counts describe ontology entities, not training masks; the human branch includes named people. Click the figure to enlarge.

The ontology also proposes hard negatives through related nodes: “Siamese cat” might suggest “tabby cat” or “dog”. Llama 4 proposes visually similar alternatives too. Candidates are useful when SAM 3 mistakenly segments the known positive object. Verification still matters because an alternative, such as a dog, could really appear elsewhere in the image.

Data engine: mine media, propose phrases and masks, verify labels, correct failures with humans and retrain the proposal model.
Figure 5, original paper, p. 5. Human corrections and accepted labels feed successive SAM 3 training rounds. Click the figure to enlarge.
JobModels used
Initial phrase and mask proposalsBLIP-2 + spaCy; FIBER or OWLv2 boxes → SAM 2 masks.
Later phrase proposalsLlama 3.2 captioner + fine-tuned Llama 3.1 parser; Llama 4 also supplies synthetic-data captions.
Later mask proposalsSuccessive SAM 3 checkpoints; SAM 1 / SAM 2 assist human image / video correction.
VerificationTwo fine-tuned Llama 3.2 verifiers: mask quality and exhaustivity.

Mask verification checks phrase relevance and boundary coverage for each candidate. Exhaustivity verification checks whether matching instances remain unmasked. Humans supply discrete quality/completeness ratings and correction examples. More than 200M image-text pairs pretrain a foundational verifier, followed by roughly 10M high-quality human examples to specialize the verifiers.

Those are separate data-production models, not LLMs inside SAM 3. The paper does not specify every Llama helper’s exact parameter-size checkpoint. Table 20 publishes category counts, not every node or training phrase; open vocabulary also does not guarantee reliable recognition of every possible concept.

Appendix C.4.1–C.4.2; Table 18

The four training stages

1. Pretrain the image and text encoders

PE-style contrastive learning on 5.4B image-text pairs aligns matching visual and language representations. This supplies semantic coverage before segmentation. SAM 3 omits PE’s distillation and video fine-tuning in this stage.

2. Pretrain the detector and both encoders

Train jointly on HQ, SYN, external segmentation data and video frames treated as images. PCS learns boxes and masks; visual-prompt data also trains PVS using four extra decoder queries. Phrases are replaced with visual queries with probability 0.2, or augmented with exemplar boxes with probability 0.2. PVS allows four interaction steps.

The run uses AdamW, ~95K iterations and batch size 896, with a reciprocal-square-root schedule. Initial learning rates are 5 × 10⁻⁴ for vision, 1 × 10⁻⁴ for text and 1 × 10⁻³ elsewhere. Box L1/gIoU loss weights are 5/2, Align classification is 100, and mask focal/Dice weights are 200/10. These teach object assignment, box extent and pixel coverage.

3. Fine-tune precision and interactivity

Retain the highest-quality, exhaustivity-verified data and drop SYN. Add the presence token with binary cross-entropy weight 20. Train for ~5K iterations, batch size 512, reducing learning rates to 0.025 times stage 2.

PVS increases to seven interactions. PCS gets five simulated correction rounds: missed objects supply positive boxes; high-confidence false detections supply negative boxes. Prompts accumulate, teaching the model to respond to its own errors.

4. Train video tracking on a frozen backbone

Freeze the visual backbone to preserve grounding while training the tracker for ~190K iterations, batch size 512, with a cosine schedule and peak learning rate 5 × 10⁻⁴. Loss weights are 20:1:1:1 for mask focal, Dice, IoU-prediction MAE and occlusion cross-entropy. Only the best candidate mask is supervised; frames without masks still supervise visibility.

A further 60K iterations use longer 16- and 32-frame contexts with learning rate reduced tenfold. Augmentation includes crops, resizing, random padding, suitable horizontal flips and selected mosaics up to 3 × 3.

Where it fits in robot learning

Unlike π₀.₅, SAM 3 produces perception outputs rather than robot actions. A downstream system could combine its masks with depth or pass tracked objects to a policy. Long reasoning-heavy instructions need an external language model; crowded scenes, occlusion and rare concepts remain difficult. Tracking cost grows with object count, and the confirmation delay matters for live control.

Built by Suveen.

www.suveenellawela.com v.2026.5