Saying where, not only what
Show a vision-language model a bank statement and ask: “How much did I pay for electricity in March?” It answers “$84.20”. The answer may well be right. But you cannot tell which number on the page it read. It might have read the March row or the February row. It might have read the amount or the running balance. To check, you have to find the number yourself, and then the model has saved you nothing.
Now ask the model to show its evidence. A useful model highlights the one cell that holds $84.20. You glance at the highlight and see that it sits in the March row, under the Amount column. Checking now takes one second instead of one minute.
That second ability is called grounding. Grounding links a piece of language to a place in the image. The place can be a point, a box, an outline or an exact set of pixels. The language can be a noun (“the mug”), a referring expression (“the mug to the left of the laptop”), an answer, or one step of a longer argument.
This post is about one question. A vision-language model can say what it sees. How does it communicate where it sees it?
The question sounds narrow, but it is not. A language model produces a sequence of tokens. A location is geometry. Every grounding system therefore has to decide how geometry becomes tokens, or how tokens become geometry. That one decision reaches into the tokenizer, the loss, the decoder, the training data, the metrics and the reward. It also limits what kind of evidence the model can show at all. A rectangle cannot follow a curved line of text. A single point cannot cover a table row.
Earlier posts built the pieces we need. One Transformer, Two Modalities showed how an image becomes a sequence of tokens. Inside a Modern Vision Encoder showed how resolution and patch size decide what the model can see. How Models Know Where They Are showed how two-dimensional positions are encoded inside the model, for example with M-RoPE. Those posts move location into the model. Grounding is the other direction. It gets location back out, in a form a person or a program can check.
We will build the topic in order. First we place grounding on a ladder of vision tasks and list the task family. Then we compare four shapes an answer can take: point, box, polygon and mask. Next we look at how coordinates are written as tokens and what that costs. After that comes the main alternative, where the language model hands the location to a dedicated decoder such as SAM. Then come granularity, grounded reasoning, the uses of grounding, and how to measure it. A comparison of models and a short guide to choosing an interface close the post.
From recognising to localising
Vision tasks form a ladder. Each rung asks the model to commit to more about location. It helps to walk up the ladder with one picture and watch what the output gains at each step.
- Classification gives one label for the whole image, such as “office desk”. It says nothing about where anything is.
- Captioning writes a sentence. Objects now have names, but they still have no positions.
- Visual question answering (VQA) answers a question about the image. To answer “What colour is the mug on the left?” the model must find that mug inside its own computation. But the output is still only text, so nobody can see where it looked.
- Referring expression comprehension takes a phrase and returns the region it describes. For the first time the location is the output.
- Pointing and box grounding return that region as one point or one rectangle.
- Segmentation returns the exact pixels of the region.
The localisation ladder
The step from VQA to referring is the one that matters most. Below it, a location exists only as an internal state. Above it, the location is an output that a person, a program or a reward function can check. Everything in this post lives above that line.
Higher rungs do not replace lower ones. To draw a mask on “the mug left of the laptop” the model must still recognise mugs, laptops and the relation “left of”. Grounding adds a commitment. It does not add a new kind of understanding. That is why grounding is a basic multimodal ability and not a niche detection task. It is the part of perception that can be checked.
The family of grounding tasks
“Grounding” covers a family of tasks. They differ in three ways. The language can be the input or the output. There can be one target, many targets or none. The target can be a region in space, a span in time, or both. Here is the family, one task at a time.
Phrase grounding. The input is an image and a sentence. The output is a region for each noun phrase in the sentence. Flickr30k Entities is the standard dataset. It links phrases in Flickr30k captions to boxes in the images.
Referring expression comprehension (REC). The input is one expression that picks out one object, such as “the man in the red shirt on the right”. The output is that object’s box. ReferItGame started this line. RefCOCO, RefCOCO+ and RefCOCOg moved it onto COCO images. RefCOCO+ forbids location words, so the expression must use appearance. RefCOCOg has longer expressions.
Referring expression segmentation (RES). This is the same task with a mask as the output. Classic RES assumes that every expression matches exactly one object. GRES and its dataset gRefCOCO drop that assumption. Their expressions can match several objects, or no object at all.
Referring expression generation (REG). This is the inverse of REC. The input is a region and the output is text that describes it well enough to pick it out. Shikra and Ferret accept regions as input, so a user can point at something and ask about it. Ferret accepts free-form regions such as points, boxes and scribbles.
Grounded VQA and grounded captioning. The model writes an answer or a caption and attaches a region to the phrases it mentions. GLaMM calls the caption version grounded conversation generation. In it, every phrase in a multi-sentence reply gets its own mask.
Reasoning segmentation. The query names no object directly. LISA introduced this task with its ReasonSeg benchmark. A query might be “the part of the kitchen you would use to boil water”. The model has to reason its way to the kettle and then segment it.
Open-vocabulary detection. The input is one or more category names in free text. The output is a box for every instance of each category. MDETR, GLIP, OWL-ViT and Grounding DINO are the specialist models here. Unlike REC, the number of outputs is not known in advance.
Text grounding. Here the regions are pieces of text: characters, words or lines. Text spotting finds and reads text with its location. Region-specific OCR inverts it: “read what is written inside this box”. Kosmos-2.5 writes each text line of a page together with its box.
Document grounding. A question about a page is answered together with the regions that support the answer. The evidence is often a cell, a row, a paragraph, or several scattered places. BoundingDocs, DOGR-Bench and MMDocBench measure this. The next post, How VLMs Read Documents, covers document models in depth.
Chart-element grounding. The targets are parts of a chart: a bar, a pie wedge, a legend entry, an axis label. These shapes are often not rectangles, and they are tied to each other. A legend colour, for example, tells you which wedge to read.
GUI grounding. The input is a screenshot and an instruction such as “open the settings”. The output is a point to click. SeeClick introduced the ScreenSpot benchmark for this task. VLMs That Act covers it further.
Temporal and spatio-temporal grounding. In video, the target can be a time interval (“when does the person open the fridge?”). Charades-STA, built in the TALL paper, is a standard benchmark for this. The target can also be a mask that follows an object across frames, as in Sa2VA. Seeing in Time covers video.
| Task | Input language | Output | Targets | Typical benchmark |
|---|---|---|---|---|
| Phrase grounding | caption | box per phrase | one per phrase | Flickr30k Entities |
| REC | referring expression | box | exactly one | RefCOCO, RefCOCO+, RefCOCOg |
| RES / GRES | referring expression | mask | one (RES); zero or more (GRES) | RefCOCO family, gRefCOCO |
| REG | none (region is the input) | text | one | RefCOCO family |
| Grounded captioning | none or instruction | text with a mask per phrase | many | GranDf (GLaMM) |
| Reasoning segmentation | implicit query | mask | usually one | ReasonSeg |
| Open-vocabulary detection | category names | boxes | all instances | COCO, LVIS-style sets |
| Document grounding | question | answer with evidence regions | one or many | BoundingDocs, DOGR-Bench, MMDocBench |
| GUI grounding | instruction | click point | one | ScreenSpot |
| Temporal grounding | query about events | time interval | one | Charades-STA |
How to read this table. Read down the “Targets” column. The older benchmarks assume exactly one target. Most real uses have many targets or none. That gap explains several failure modes later in the post.
Point, box, polygon, mask
Before we ask how a model writes a location, we need to decide what kind of location it writes. There are four common shapes. Each one trades precision against cost.
A point is two numbers, (x, y). It is the cheapest answer to annotate: one click. It says “here” but not “how big”. That is enough for clicking a button, counting objects, or telling a robot where to grasp. It is checked with an inside test: does the point fall inside the target?
A box is four numbers, (x1, y1, x2, y2). It adds extent. It is the default of object detection, cheap to draw, and easy to compare with intersection over union. Its weakness is shape. A box always includes the background between the object and the box edges.
A polygon is a list of k vertices, so it costs 2k numbers. It can follow an outline as closely as you like, if you are willing to pay for more vertices. Florence-2 writes polygons as sequences of quantised vertices. PolyFormer predicts them one vertex at a time.
A mask marks every pixel as in or out. It can represent anything: holes, thin curves, and several disconnected parts at once. Masks used to be the most expensive annotation by far. The Segment Anything Model (SAM) changed that. An annotator clicks once or twice and SAM fills in the mask. That is how SAM’s own SA-1B dataset reached over a billion masks on 11 million images.
The cleanest way to compare boxes and masks is to ask a simple question. Suppose a model predicts the best possible box. How good is that box as a description of the region? Let S be the true region and B* its tightest enclosing box. Because S lies inside B*, their intersection is S itself and their union is B*. So:
Here f(S) is the fraction of the box that the region fills. For a full rectangle, f = 1. For an ellipse, f = π/4 ≈ 0.79, because an ellipse fills that share of its bounding box. For a curved line of text, like the one in Figure 2, the figure is about 0.34. For a thin text line at 45 degrees it can fall below 0.1. Even a perfect box can therefore mostly describe background.
Four ways to say where, on one curved line of text
Figure 2 also shows a trap with points. The obvious point to emit is the centre of mass of the region. For a convex object such as a ball, the centroid lies inside the object. For a curved band, a crescent or a ring, it lies outside. A model that learns to point at centroids will point at background for exactly these shapes. Pointing datasets therefore ask annotators to click on the object, not at its centre.
| Representation | Precision | Annotation cost | Token cost as text | Many regions | Irregular shapes | How it is checked |
|---|---|---|---|---|---|---|
| Point | location only, no extent | lowest: one click | 2 numbers | easy: a list of points | poor: says nothing about shape | inside test, hit or miss |
| Box | extent, plus background | low: two corners | 4 numbers | a list of boxes; order must be chosen | poor: IoU capped by fill ratio | IoU against a box |
| Polygon | grows with vertex count | medium to high: many clicks | 2k numbers for k vertices | long sequences | good, at a cost in length | IoU after rasterising |
| Mask | pixel-exact | high by hand; low with SAM-assisted clicks | very long as raw text; one token with a decoder | natural: one mask per region, or one mask covering several parts | exact: holes, curves, disconnected parts | mask IoU, boundary IoU |
How to read this table. Precision rises from top to bottom. As text, cost rises with it. The last row breaks the pattern only because a decoder can turn a single token into a mask. That exception is what the decoder section of this post is about.
Writing coordinates as tokens
Suppose the model must output a box. A language model can only emit tokens, so the box has to become tokens somehow. Here is the same box around a dog, written the way eight different systems write it. The box spans 26.8% to 58.4% of the image width and 37.2% to 81.1% of its height.
| System | What the model writes | Convention |
|---|---|---|
| Shikra | [0.268,0.372,0.584,0.811] | plain-text decimals in [0, 1], three decimal places |
| Qwen-VL | <ref>the dog</ref><box>(268,372),(584,811)</box> | plain-text integers on a 0–1000 grid, special tags |
| CogVLM | [[268,372,584,811]] | three-digit integers 000–999 |
| MiniGPT-v2 | {<27><37><58><81>} | integers on a 0–100 grid |
| Florence-2 | <loc_268><loc_372><loc_584><loc_811> | 1,000 dedicated location tokens |
| PaliGemma | <loc0380><loc0274><loc0830><loc0598> dog | 1,024 location tokens, y before x |
| Qwen2.5-VL | {"bbox_2d": [233, 240, 507, 522], "label": "dog"} | absolute pixels of the resized input (here 868 × 644) |
| Molmo (point) | <point x="42.6" y="59.2" alt="dog">dog</point> | a point, plain-text decimals on a 0–100 scale |
How to read this table. The rows look different, but they make only four choices. The choices are text numbers or new tokens, normalised or absolute, how many bins, and which axis comes first. The rest of this section takes the four choices one at a time.
Text numbers or new location tokens
The first choice is whether a coordinate is ordinary text or a new token. Shikra, Qwen-VL, CogVLM, MiniGPT-v2, Ferret and Molmo all write coordinates as ordinary text. Nothing is added to the vocabulary. The model reuses whatever it already knows about numbers, and the output stays readable by a person and parseable by a regular expression.
The cost is length. Many tokenizers split numbers into single digits. LLaMA’s tokenizer does this, for example. Then “584” is three tokens, and a box with brackets and commas runs to roughly twenty. Each digit is also a separate prediction, which matters for the error analysis in the next section.
The alternative is to add location tokens to the vocabulary. Pix2Seq did this first for detection. It cut each coordinate into a fixed number of bins and gave each bin a token. Those tokens share one vocabulary and one embedding matrix with the class labels. OFA carried the idea into a general vision-language model. Its official training scripts use 1,000 bins. Kosmos-2 split a 224-pixel input into a 32 × 32 grid of cells. That gives 1,024 location tokens, one per cell. A box is two of them: the top-left cell and the bottom-right cell. Florence-2 uses 1,000 bins per coordinate. PaliGemma uses 1,024 tokens named <loc0000> to <loc1023>.
Location tokens make a box short: two tokens in Kosmos-2 and four in PaliGemma. Each coordinate becomes one decision instead of three. But the embeddings of these new tokens start from nothing. The model has to learn from grounding data alone that <loc0500> lies between <loc0499> and <loc0501>. Text digits come with some of that order already learned during language pretraining.
Streaming a box, token by token
Normalised or absolute coordinates
The second choice is the frame of reference. Most systems normalise coordinates by the image size. Shikra uses [0, 1]. Qwen-VL and Qwen2-VL use [0, 1000). MiniGPT-v2 uses 0–100, and so does Molmo for points. Gemini’s documented detection format is also normalised to 0–1000. A normalised box means the same thing at any resolution, so data from many image sizes can be mixed freely.
Qwen2.5-VL broke with this. Its report says it uses coordinates based on the actual size of the input image, for both boxes and points. The argument is that a model which sees images at their native resolution should also learn real scale. The catch is the word “actual”. These are pixels of the resized input that the model receives, not of the original file. The official cookbook rescales outputs using the resized width and height. One model generation later, Qwen3-VL went back. Its report states that, unlike Qwen2.5-VL, it uses a normalised system scaled to [0, 1000].
How many bins: the cost of a coordinate grid
The third choice is the number of bins, N. It sets how finely a coordinate can be stated. The arithmetic is short, and it is worth deriving. Take an image that is W pixels wide. Cut each axis into N bins, so each bin is Δ = W / N pixels wide. If a coordinate is rounded to the nearest bin centre, each edge of a box can be off by at most Δ/2.
What does that do to IoU in the worst case? Take a square object of side s. The worst case is when all four edges move inward by Δ/2. Then the predicted box is a square of side s − Δ that sits inside the true box. Its IoU is the ratio of the two areas. (A brute-force check over every combination of edge errors confirms that this is the minimum.)
Two facts follow. First, the error is set by the original image width, not by the resolution the model sees. A 0–1000 grid on a 448-pixel image has bins narrower than a pixel. The same grid on a 3840-pixel screenshot has bins almost four pixels wide. Second, small objects suffer most, because Δ is compared with s. Kosmos-2’s 32-cell grid is fine for a dog that fills half the photo. On a full-page scan 2,000 pixels wide, each cell is 62 pixels, wider than most words on the page. Try it in Figure 4.
Interactive · quantisation error
Which axis first, and other conventions
The fourth choice looks trivial: the order of the numbers. Pix2Seq writes [ymin, xmin, ymax, xmax]. PaliGemma and Gemini keep that order. Qwen-VL, Shikra, Ferret and Florence-2 put x first. Kosmos-2 needs only two tokens, because each token already names a cell. A model trained on mixed conventions has to learn the convention from context. A pipeline that mixes conventions will fail silently, as the nuance above warned.
Points need one more convention: which point. A point for a button is its centre. A point for a curved object must be a point on the object, as Figure 2 showed. Molmo writes several points in a fixed order, top to bottom and then left to right. We return to ordering in the next section.
Grounding as next-token prediction
Once a box is a string of tokens, grounding becomes ordinary language modelling. The model reads the image and the question. Then it writes something like <box> 123 084 622 531 </box>, one token at a time. Training is the same cross-entropy loss used for every other token. This idea runs from Pix2Seq through OFA, Kosmos-2, Shikra, Qwen-VL, Florence-2 and PaliGemma to most open models today.
What this buys
- One interface for every task. Detection, referring, grounded captioning and VQA all become “write the right tokens”. A single model can be trained on all of them with one loss.
- No extra decoder. The architecture is the plain vision-language model described in The VLM Architecture Gallery. Nothing new has to be served.
- Text and location mix freely. A box can sit in the middle of a sentence, a list or a JSON object.
- The output is easy to check. A regular expression extracts the box, so a program can compute IoU. That is what makes grounding usable as a reward for reinforcement learning.
What it costs
The costs are less obvious. Each one comes from treating a quantity in space as a sequence of symbols.
The loss is blind to distance. Cross-entropy for one coordinate token is −log p(true bin). It depends only on the probability given to the correct bin. It does not care where the rest of the probability went. Missing by one bin and missing by three hundred bins cost exactly the same. Figure 5 shows this with two predictions that have identical loss and very different boxes.
Cross-entropy cannot tell a near miss from a far miss
Errors compound digit by digit. With text digits, one coordinate is several predictions in a row. The hundreds digit comes first, and every later digit is conditioned on it. An early mistake is large, and the following digits cannot repair it. Location tokens remove the chain, because each coordinate becomes one decision. They do not remove the blindness to distance.
Many objects need an order. A set of boxes has no natural order, but a token sequence does. Pix2Seq shuffles the object order during training, so the model learns that any order is acceptable. Molmo goes the other way and writes points in a fixed reading order, top to bottom and then left to right. A fixed order is easier to learn. But one skipped object then shifts the position of everything after it. Evaluation has to match predicted and true regions as sets, not as sequences.
Shapes beyond boxes get long. A polygon with 30 vertices is 60 numbers, which can mean more than 200 tokens as text. PolyFormer avoids quantisation altogether by predicting vertex coordinates as continuous values with a regression head. Masks are worse still as raw text. PaliGemma compresses a mask into 16 tokens drawn from a learned codebook of 128 entries, which a small decoder expands back into pixels. Text4Seg labels each cell of a 16 × 16 patch grid with a word and then compresses each row with run-length coding. That compression shortens the text by 74%.
Nothing anchors the numbers to the pixels. A coordinate token is predicted like any other word. The model can write a fluent, well-formed box for an object that is not there, just as it can write a fluent sentence that is false. Aligning Vision-Language Models covers hallucination in general. In grounding it takes the form of a confident box on empty background.
Handing the location to a decoder
Typing coordinates asks a language model to do geometry in text. There is another option. The language model can decide what to localise and leave where to a module built for it. Three interfaces follow from this. The model can type the location, select it from candidates, or emit an embedding that a decoder turns into a location.
Type, select or decode
Type. This is the approach of the previous section. The model writes coordinates as tokens. It is simple and portable, and it carries all the costs listed above.
Select. A separate detector proposes candidate regions. Each candidate becomes a token that the language model can refer to. Groma works this way. A class-agnostic proposer based on Deformable DETR finds candidate regions. A region encoder turns each one into a region token, registered as <r1> to <rn>. The language model grounds a phrase by writing <p>A dog</p> <roi><r4></roi>. Localisation becomes a choice among candidates. The model never writes a coordinate. The ceiling is the proposer: a region that was never proposed can never be selected.
Ferret uses region features in the other direction, for input. Its hybrid region representation pairs a region’s discrete coordinates with a continuous feature. A spatial-aware visual sampler extracts that feature from inside the region, whatever its shape. That lets a user refer to a scribble or a free-form outline. Ferret’s outputs are still coordinates written as text, on a 0–999 grid.
Decode. The model emits a special token, and that token’s hidden state, not its text, carries the location. LISA introduced this as “embedding as mask”. The recipe has four steps:
- Add a token
<SEG>to the vocabulary. The language model writes it where a mask is needed: “It is the kettle <SEG>.” - Take that token’s last-layer hidden state, hSEG.
- Project it with a small MLP into the prompt space of SAM’s mask decoder.
- SAM’s decoder combines this prompt with SAM’s own image features and outputs a mask.
The mask losses compare the predicted mask M with the true mask M* pixel by pixel. Because every step is differentiable, the mask loss flows back through the decoder and the MLP into the language model. The language model therefore learns to put into hSEG exactly what the decoder needs. No coordinate is ever typed.
Three ways to hand over a location
The VLM + SAM family
LISA showed that this design gives reasoning segmentation almost for free. The reasoning comes from the language model and the mask comes from SAM. Trained only on data without reasoning queries, LISA still handles reasoning segmentation zero-shot. Its authors report that fine-tuning on just 239 reasoning-segmentation samples improves it further. Many follow-ups change one part of the recipe each.
- GLaMM adds a region encoder for region inputs and a SAM-based grounding encoder and pixel decoder for outputs. It writes multi-sentence replies in which every phrase carries its own
<SEG>mask. Its GranD dataset was built by an automatic annotation pipeline. It holds 810M regions with masks on 11M images, along with 84M referring expressions and 33M grounded captions. - PixelLM drops SAM. It uses a lightweight pixel decoder and a learned segmentation codebook, which keeps the cost down and handles several targets in one reply. It was trained with MUSE, a set of 246K question-answer pairs covering 0.9M instances.
- OMG-LLaVA uses a frozen universal segmenter, OMG-Seg, as both the visual encoder and the mask decoder. One encoder, one decoder and one language model handle image-level, object-level and pixel-level tasks.
- Sa2VA joins SAM 2 to an InternVL-style model. A
[SEG]token prompts SAM 2, and SAM 2’s memory carries the mask across video frames. The same model grounds images and videos. - NExT-Chat calls the idea pix2emb. Location embeddings are decoded into boxes by one decoder and into masks by another. VisionLLM v2 generalises it into a “super link” that routes embeddings to many task decoders. LLaVA-Grounding attaches a grounding model to a LLaVA-style chat model and introduces Grounding-Bench.
One hybrid sits between typing and decoding. Seg-Zero lets Qwen2.5-VL-3B write a box and points as text. A frozen SAM 2 then uses them as prompts and draws the mask. The language model is trained with reinforcement learning, with rewards on the box and the points. The output stays parseable text, and the mask still comes from a segmenter.
Grounding documents with masks
My own research applies the decode interface to documents. The framing behind it is simple. A person shows you where something is by pointing, underlining or highlighting. Nobody reads out coordinates. A single point works well in natural images, where the evidence is usually one object. Evidence in a document rarely looks like that. It is a paragraph, a table row, a line of text curving around a seal, a pie wedge, or several cells scattered across a page. For regions like these people reach for a highlighter. A mask is a smart highlighter. It covers exactly the evidence, at any shape and size, and nothing else.
Three models from this line of work share one recipe. A vision-language model writes text and grounding tokens, and SAM turns each token into a mask, trained end to end. M3Grounder (CVPR 2026) answers document questions and attaches masks to every cited span. Each grounding token yields three nested masks: the phrase, its line and its block. DoCoG (ECCV 2026) grounds every reading step of a chain of thought. DocLayout-VL (ECCV 2026) emits a layout token for every node of a page’s layout tree. The full story, with the data engines behind them, is in Building Grounded Document Intelligence.
What counts as one region
So far each query has had one obvious target. Real queries often do not. Look at a single bank statement and three requests about it. “Cite the amount” wants one number. “Redact the transaction” wants the whole row. “Chunk the table for retrieval” wants the whole table. The page is the same in all three. Only the question changed, and with it the right size of region.
This is granularity: the level at which a region is defined. On a document the levels form a ladder of their own:
- character and word,
- span (a phrase or a number with its unit),
- line and paragraph (also called a block),
- table cell, row, column and whole table,
- chart element: a bar, a wedge, a legend entry, an axis label,
- figure, section and page region.
Natural images have their own ladder: part, object, group of objects, and amorphous regions such as sky or road. A question about the handle of a mug wants a part. A question about “all the mugs” wants a group. That group may be several disconnected regions, which is the multi-target case of gRefCOCO.
One page, many granularities
Several systems build granularity into the output. Kosmos-2.5 reads a page as a list of text lines, each with its own box, so its unit is the line. M3Grounder makes granularity explicit. Each grounding token has three small heads, which produce three SAM prompts. Those prompts become three nested masks for the phrase, the line and the block. A hierarchy loss keeps the phrase mask inside the line mask, and the line mask inside the block mask. DocLayout-VL goes further and outputs a whole tree of regions. Its attention module lets each region token look only at its parent, its children and its siblings. A headline therefore stays with its own article.
Multi-region answers need a separate mention. A query such as “which months were over budget?” can point at three cells in three rows. A point list handles this naturally, and so does a list of masks. One box around all three cells would cover most of the table. This is the plainest case where the answer is a set of regions, not one region.
Grounding each reasoning step
Some questions cannot be answered by pointing at one place. Take a pie chart of revenue by region and ask: “By how many points does Asia’s share exceed Europe’s?” The answer, 24 points, is printed nowhere. The model must find Asia in the legend, then find the wedge with that colour, then read its label, and then do the same for Europe. Only then can it subtract. Grounding only the final answer gives nothing to point at. Chain-of-thought alone says “Asia is 42%” without showing which label it read.
The fix is to ground the steps. Step 1 points at region A. Step 2 points at region B. Each later reading step points at its own region, up to the answer. Steps that only do arithmetic point at nothing. Thinking in Tokens explains why written reasoning steps help a language model. Grounded steps add one thing: each reading step becomes checkable against the image.
A grounded chain of thought
Three lines of work show the range of designs.
Visual CoT builds a dataset of 438K question-answer pairs, each with a box around the key region. About 98K of them also have detailed reasoning steps. The model first predicts the box, then looks again at that region, and then answers. Here grounding is a step that decides where to look, which is the theme of Thinking With Images.
GRIT (Fan and colleagues, 2025) trains a model to interleave boxes inside its reasoning text. It uses reinforcement learning with only two rewards: a correct final answer and a well-formed grounded reasoning format. The paper reports that as few as 20 training samples are enough to learn the behaviour. (This GRIT is a method. Ferret’s dataset is also called GRIT, and Kosmos-2’s dataset is called GrIT. They are three different things.)
DoCoG, from my own work, grounds every reading step of a document chain with masks across text, tables, charts and flowcharts. It adds a module that sees all grounding tokens of one chain together before they reach SAM. That lets related pointers agree, such as a legend entry and its wedge, or a value and its column. The language model is causal: when it writes the first pointer, it cannot yet see the second, so it cannot make them agree itself. Training starts with supervised fine-tuning on step-wise data and continues with preference training over whole chains.
Why grounding matters beyond explanation
Grounding is often presented as explainability: the model shows its work. That is true, but it undersells it. A location is also an input to the next step, whether that step is taken by a program, a robot or a training loop. Here are the main uses, each with what it needs from the representation.
Verifiable perception. A grounded claim can be checked in seconds, and an ungrounded one cannot. This is the bank-statement example from the start. It needs regions at the right granularity. A box around a whole table does not verify a number.
Region-specific reading. “Read the text inside this box” turns grounding into a tool for OCR. Kosmos-2.5 reads a page as text lines paired with their boxes. The location tells you where each piece of text came from. It also lets later steps read one region again at higher resolution.
Crop and zoom. A box is an action as well as an answer. A model that can name a small region can crop it, zoom in, and look again with more visual tokens. Visual CoT trains exactly this. Thinking With Images covers how reasoning models use it at test time.
Clicking in interfaces. A GUI agent acts by clicking points. SeeClick showed that GUI grounding is the bottleneck for visual GUI agents and built ScreenSpot to measure it. ScreenSpot has over 600 screenshots and about 1,200 instructions across mobile, desktop and web. UGround scaled the training data to 10M GUI elements on 1.3M screenshots. Here precision is measured in pixels of a large screen, so the grid arithmetic of Figure 4 applies directly. See VLMs That Act.
Robotics. A robot needs a target in the image: where to grasp, where to place, where to go. RoboPoint predicts sets of image points as spatial affordances. The Molmo authors expect pointing to let models act by pointing at waypoints, objects and buttons. From VLMs to VLAs picks this up.
Rewards for reinforcement learning. A box or a mask can be scored against a reference with IoU, without a learned judge. That makes perception a verifiable reward, much like a math answer checked by a program. VLM-R1, Visual-RFT and Seg-Zero all use this. Rewarding What the Model Sees covers the method.
Visual citations. A document assistant that cites the cell it read can be audited by its users. This is the strongest argument for mask-level, multi-region grounding on documents. How VLMs Read Documents and Searching With Pixels cover documents and visual retrieval.
Less hallucination. A model that must place every object it mentions has a harder time mentioning objects that are not there. Ferret’s authors report that training with GRIT, including its hard negatives, reduces object hallucination. The mechanism matters more than the size of the effect. Grounding turns “is there a dog?” into “where is the dog?”, and “nowhere” must be a valid answer.
Measuring grounding
Each output shape comes with its own metric, and each metric rewards something slightly different. Measuring What a VLM Can Do covers VLM benchmarks in general. This section goes deeper on grounding.
Points
A point is scored with an inside test. The pointing game, introduced to evaluate attention maps, counts a hit when the maximum of the map falls on an annotated instance, allowing a tolerance of 15 pixels. GUI grounding uses the same idea as click accuracy: a click counts if it lands inside the target element’s box. Point metrics say nothing about extent, and they are lenient for large targets.
Boxes
Boxes are scored with intersection over union, IoU = |A ∩ B| / |A ∪ B|. Referring expression comprehension on the RefCOCO family reports Acc@0.5: the share of expressions whose predicted box has IoU of at least 0.5 with the true box. Phrase grounding on Flickr30k Entities reports a similar recall at the same threshold. Detection reports average precision. In the COCO style, AP is averaged over IoU thresholds from 0.5 to 0.95, which rewards tight boxes more than Acc@0.5 does.
Masks
Masks are also scored with IoU, but at the pixel level, and there are two ways to average it. Referring segmentation papers such as LISA report both.
Here Pi is the predicted mask and Gi the true mask for example i. gIoU is the mean of per-example IoUs, so every example counts equally. cIoU adds up all intersections and all unions before dividing. Large objects contribute many pixels, so they dominate cIoU. LISA prefers gIoU for exactly this reason. IoU over a whole mask is also forgiving at the edges, because a large interior hides a ragged boundary. Boundary IoU computes IoU only in a thin band around the contours, so it rewards sharp edges.
Many regions, no region, and phrases
When an answer has several regions, a single IoU no longer works. The usual approach is to match predicted regions to true regions first, typically one-to-one at an IoU threshold. Then precision, recall and F1 are computed over the matches. M3Grounder and DoCoG report grounding scores of this matched kind. When a query may have no target, as in gRefCOCO, the metric must also reward the model for correctly answering “nothing”. Grounded captioning has to score two things together: the text and whether each phrase got the right mask. GLaMM therefore evaluates grounded conversation generation with caption metrics and mask metrics side by side.
Time
Temporal grounding uses the same idea in one dimension. Temporal IoU compares the predicted interval with the true interval. Charades-STA results are usually reported as recall at temporal IoU thresholds such as 0.5 and 0.7.
Interactive · box IoU versus mask IoU
Benchmarks
| Benchmark | Task | Output | Main metric | What it does not test |
|---|---|---|---|---|
| ReferItGame | REC on natural photos | box | Acc@0.5 | multiple or absent targets |
| RefCOCO / + / g | REC and RES on COCO | box or mask | Acc@0.5; mask IoU | multiple or absent targets; RefCOCO+ removes location words |
| Flickr30k Entities | phrase grounding | box per phrase | recall at IoU 0.5 | masks |
| gRefCOCO | generalised RES | mask, possibly empty | mask IoU; no-target accuracy | reasoning queries |
| ReasonSeg | reasoning segmentation | mask | gIoU, cIoU | scale: 1,218 samples in total |
| GranDf | grounded conversation | text with masks | caption and mask metrics | documents |
| ScreenSpot | GUI grounding | click point | click accuracy | extent of elements |
| Charades-STA | temporal grounding | time interval | recall at tIoU 0.5 / 0.7 | spatial location |
| BoundingDocs | document QA with locations | answer and box | answer and location scores | non-rectangular evidence |
| DOGR-Bench | document grounding and referring | boxes and text | task-specific | masks; 3.6K samples over charts, posters, PDFs |
| MMDocBench | fine-grained document understanding | answer and supporting regions | answer and region scores | masks; 4,338 QA pairs, 11,353 regions |
| GDQA-Bench, DoCoG-Bench | mask-grounded document QA; grounded chains | masks, many per answer or step | grounding F1; answer and grounding scores | natural images |
How to read this table. The last column matters most. Most benchmarks fix one output shape and one target count. A model that is good at the benchmark’s shape can still be weak at the shape your application needs. The shaded row is from the author’s own work.
Comparing grounding models
We can now compare the main grounding models along the aspects this post introduced: output shape, coordinate encoding, decoder, granularity, multi-region ability and training data. Per-family details such as model sizes, encoders and training stages are in How the Open VLM Families Were Built. Entries say “not reported” where the primary source does not state them.
| Model | Output type | Coordinate encoding | Decoder | Granularity | Multi-region | Grounding training data |
|---|---|---|---|---|---|---|
| Pix2Seq (2021) | boxes | location tokens; 2,000 bins (COCO from scratch) or 1,000; y before x; shared vocabulary with classes | none | object | yes; order shuffled in training | COCO; Objects365 for pretraining |
| OFA (2022) | boxes | location tokens in a unified vocabulary; 1,000 bins in official scripts | none | object | one per query | public data, including the RefCOCO family |
| Kosmos-2 (2023) | boxes | 1,024 location tokens (32 × 32 grid); two tokens per box | none | phrase to object | yes, joined by a delimiter token | GrIT: about 91M images, 115M phrases, 137M boxes |
| Shikra (2023) | boxes, points | decimals in [0, 1] as text, three places | none | object | yes, inline in dialogue | public REC and phrase-grounding sets; GPT-4-generated referential dialogue (Shikra-RD) |
| MiniGPT-v2 (2023) | boxes | integers on a 0–100 grid as text | none | object | yes | public multi-task mix |
| Ferret (2023) | boxes (in and out) | integers on a 0–999 grid as text; region inputs add a sampled feature | visual sampler for region inputs | object, free-form regions as input | yes | GRIT: about 1.1M samples including 95K hard negatives |
| CogVLM (2023) | boxes | three-digit integers 000–999 as text | none | object | yes | REC data in stage-2 pretraining |
| Qwen-VL / Qwen2-VL | boxes | integers on a 0–1000 grid as text, inside box and ref tags | none | phrase to object | yes | GrIT, Visual Genome, RefCOCO family (Qwen-VL); later versions not itemised |
| Qwen2.5-VL (2025) | boxes, points | absolute pixels of the resized input; JSON output | none | object | yes | not itemised |
| Qwen3-VL (2025) | boxes, points | back to a normalised 0–1000 grid; JSON output | none | object | yes | not itemised |
| Florence-2 (2023) | boxes, quad boxes, polygons | 1,000 location tokens; polygons as vertex sequences | none | object, region, text line | yes | FLD-5B: 5.4B annotations on 126M images |
| PaliGemma (2024) | boxes, masks | 1,024 location tokens, y before x; masks as 16 codebook tokens (128-entry VQ-VAE) | small VQ-VAE mask decoder | object | yes | multitask pretraining mix including detection and referring segmentation |
| Molmo (2024) | points | decimals on a 0–100 scale as text, in XML-like tags | none | object, part | yes, in reading order | PixMo-Points: about 2.3M question-point pairs on 223K images |
| Groma (2024) | boxes (selected) | none typed; region tokens <r1>… | Deformable-DETR region proposer | object | yes | not reported here |
| LISA (2023) | masks | none; <SEG> hidden state | SAM (ViT-H) | object, reasoning targets | one per <SEG> | semantic and referring segmentation, VQA; 239 ReasonSeg samples |
| GLaMM (2023) | masks, region inputs | none; <SEG> per phrase | SAM-based pixel decoder | phrase to object | yes, many per reply | GranD: 810M masked regions on 11M images; GranDf |
| PixelLM (2023) | masks | none; codebook tokens | lightweight pixel decoder, no SAM | object | yes | MUSE: 246K QA pairs, 0.9M instances |
| Sa2VA (2025) | masks in images and video | none; [SEG] token | SAM 2 with memory | object across frames | yes | image and video referring segmentation; Ref-SAV |
| Text4Seg (2024) | masks as text | a word per patch on a 16 × 16 grid, row-wise run-length coding | optional SAM refiner | object | yes | not reported here |
| M3Grounder, DoCoG, DocLayout-VL | masks | none; grounding tokens | SAM, with an interaction module (DoCoG, DocLayout-VL) | phrase, line, block; reasoning steps; layout tree | yes, many per answer, step or page | about 2M grounded QA; 1.5M step-wise QA plus 20K preference pairs; 80M masks on 2.5M pages |
How to read this table. Read the “Decoder” column first. It splits the table into two groups. Models with no decoder type their locations and almost all output boxes or points. Models with a decoder output masks and type no coordinates at all. Then read the “Coordinate encoding” column within the first group. The bin count and the order of the axes change from model to model, and even across versions of one family. The shaded row is the author’s own work.
Choosing a grounding interface
There is no single best interface. The right choice follows from the shape of the evidence, the number of regions, and what consumes the output.
- The target is a small, compact object, and the consumer clicks, counts or grasps. Use points as text. They are cheap to label and cheap to emit, and they are checked by an inside test. Make sure the points are trained to land on the object, not at its centroid.
- The consumer crops, zooms or computes a reward. Use boxes as text on a normalised grid. Check that the grid is fine enough for the smallest target at the largest resolution you serve. If the boxes will be scored, consider RL with an IoU reward after supervised training.
- The evidence is irregular, nested or spread over several places. Use masks from a decoder. Typed polygons and masks get long and lossy. A grounding token that prompts a segmenter keeps the language model’s job to deciding what and at which granularity.
- The answer needs several reading steps. Ground each reading step, and leave arithmetic steps ungrounded. Measure the regions directly, because a correct answer says little about whether they are right.
- The input is video. Use a segmenter with memory across frames, such as SAM 2 in Sa2VA, or interval outputs for purely temporal questions.
- The model is behind an API that only returns text. Typed coordinates are the only option. Pin the version and test the coordinate convention, as the nuance on coordinate frames advised.
The thread through all of this is a division of labour. Language models are good at deciding what a question refers to and at what granularity. Geometry is better handled by something that works in pixels, whether that is a fine coordinate grid, a proposer, or a promptable segmenter. The next posts build on this. How VLMs Read Documents applies grounding to pages. Rewarding What the Model Sees turns IoU into a training signal.
Key insights and nuances
- InsightGrounding can be a means as well as an output. Molmo’s point-then-count beats counting directly, and the points make the count checkable. From recognising to localising
- NuanceData in which every query has exactly one target teaches the model to always draw a box. Training needs queries whose answer is “no such region”. The family of grounding tasks
- InsightThe best possible box has IoU equal to the shape’s fill ratio. That is about 0.34 for a curved text line and below 0.1 for a thin diagonal one. Point, box, polygon, mask
- InsightQuantisation error is set by the original image width divided by the bin count. A 0–100 grid cannot localise a 24-pixel icon on a 4K screen. Writing coordinates as tokens
- NuanceCoordinate conventions change across models and even across versions of one family. Qwen2.5-VL uses absolute pixels, while Qwen3-VL returned to a 0–1000 grid. Wrong parsers fail silently. Writing coordinates as tokens
- InsightCross-entropy cannot tell a near miss from a far miss. IoU rewards can, which is why RL helps grounding. Grounding as next-token prediction
- InsightFor irregular, multi-region evidence, changing the interface from typed boxes to a segmentation decoder helps more than more data on the same backbone. Handing the location to a decoder
- InsightGranularity belongs to the question. The same pixels are right for “cite” and wrong for “redact”. What counts as one region
- NuanceBoxes inside reasoning chains are not evidence unless something checks them. Answer accuracy and grounding accuracy can differ by 70 points. Grounding each reasoning step
- Nuance“gIoU” means a per-example mean in segmentation and generalised IoU in detection. cIoU favours large objects. Measuring grounding
References
Grouped by topic. Every entry links to its primary source.
Coordinates as tokens
- Pix2seq: A Language Modeling Framework for Object Detection · Chen et al., ICLR 2022
- OFA: Unifying Architectures, Tasks, and Modalities Through a Simple Sequence-to-Sequence Learning Framework · Wang et al., ICML 2022
- Kosmos-2: Grounding Multimodal Large Language Models to the World · Peng et al., 2023
- Shikra: Unleashing Multimodal LLM’s Referential Dialogue Magic · Chen et al., 2023
- MiniGPT-v2: Large Language Model as a Unified Interface for Vision-Language Multi-task Learning · Chen et al., 2023
- Ferret: Refer and Ground Anything Anywhere at Any Granularity · You et al., ICLR 2024
- CogVLM: Visual Expert for Pretrained Language Models · Wang et al., 2023
- Qwen-VL: A Versatile Vision-Language Model for Understanding, Localization, Text Reading, and Beyond · Bai et al., 2023
- Qwen2-VL: Enhancing Vision-Language Model’s Perception of the World at Any Resolution · Wang et al., 2024
- Qwen2.5-VL Technical Report · Bai et al., 2025
- Qwen3-VL Technical Report · Bai et al., 2025
- Florence-2: Advancing a Unified Representation for a Variety of Vision Tasks · Xiao et al., 2023
- PaliGemma: A Versatile 3B VLM for Transfer · Beyer et al., 2024
- Molmo and PixMo: Open Weights and Open Data for State-of-the-Art Vision-Language Models · Deitke et al., 2024
- Gemini API: image understanding, object detection · Google, official documentation
Region tokens and segmentation decoders
- Segment Anything · Kirillov et al., 2023
- SAM 2: Segment Anything in Images and Videos · Ravi et al., 2024
- LISA: Reasoning Segmentation via Large Language Model · Lai et al., CVPR 2024
- GLaMM: Pixel Grounding Large Multimodal Model · Rasheed et al., CVPR 2024
- PixelLM: Pixel Reasoning with Large Multimodal Model · Ren et al., CVPR 2024
- OMG-LLaVA: Bridging Image-level, Object-level, Pixel-level Reasoning and Understanding · Zhang et al., NeurIPS 2024
- Sa2VA: Marrying SAM2 with MLLM for Dense Grounded Understanding of Images and Videos · Yuan et al., 2025
- Groma: Localized Visual Tokenization for Grounding Multimodal Large Language Models · Ma et al., 2024
- NExT-Chat: An LMM for Chat, Detection and Segmentation · Zhang et al., 2023
- VisionLLM v2: An End-to-End Generalist Multimodal Large Language Model for Hundreds of Vision-Language Tasks · Wu et al., 2024
- LLaVA-Grounding: Grounded Visual Chat with Large Multimodal Models · Zhang et al., 2023
- PolyFormer: Referring Image Segmentation as Sequential Polygon Generation · Liu et al., CVPR 2023
- Text4Seg: Reimagining Image Segmentation as Text Generation · Lan et al., ICLR 2025
Specialist grounding and open-vocabulary detection
- MDETR: Modulated Detection for End-to-End Multi-Modal Understanding · Kamath et al., 2021
- Grounded Language-Image Pre-training · Li et al., CVPR 2022
- Simple Open-Vocabulary Object Detection with Vision Transformers · Minderer et al., ECCV 2022
- Grounding DINO: Marrying DINO with Grounded Pre-Training for Open-Set Object Detection · Liu et al., 2023
Documents and grounded reasoning
- M3Grounder: Mask-Based Multi-Span and Multi-Granular Grounding for Document QA · Venna et al., CVPR 2026
- DoCoG: Mask-based Multi-Type Grounded Chain-of-Thought for Document QA · Gunda et al., ECCV 2026
- DocLayout-VL: A Foundational Model for Hierarchical, Open-set, and Promptable Document Layout Segmentation · Srinivasan et al., ECCV 2026
- Kosmos-2.5: A Multimodal Literate Model · Lv et al., 2023
- Visual CoT: Advancing Multi-Modal Language Models with a Comprehensive Dataset and Benchmark for Chain-of-Thought Reasoning · Shao et al., 2024
- GRIT: Teaching MLLMs to Think with Images · Fan et al., 2025
Acting and rewarding with locations
- SeeClick: Harnessing GUI Grounding for Advanced Visual GUI Agents · Cheng et al., 2024
- Navigating the Digital World as Humans Do: Universal Visual Grounding for GUI Agents · Gou et al., ICLR 2025
- RoboPoint: A Vision-Language Model for Spatial Affordance Prediction for Robotics · Yuan et al., 2024
- Visual-RFT: Visual Reinforcement Fine-Tuning · Liu et al., 2025
- VLM-R1: A Stable and Generalizable R1-style Large Vision-Language Model · Shen et al., 2025
- Seg-Zero: Reasoning-Chain Guided Segmentation via Cognitive Reinforcement · Liu et al., 2025
Benchmarks and datasets
- ReferItGame: Referring to Objects in Photographs of Natural Scenes · Kazemzadeh et al., EMNLP 2014
- Modeling Context in Referring Expressions (RefCOCO, RefCOCO+) · Yu et al., ECCV 2016
- Generation and Comprehension of Unambiguous Object Descriptions (RefCOCOg) · Mao et al., 2016
- Flickr30k Entities: Collecting Region-to-Phrase Correspondences for Richer Image-to-Sentence Models · Plummer et al., 2015
- GRES: Generalized Referring Expression Segmentation (gRefCOCO) · Liu et al., CVPR 2023
- Visual Genome: Connecting Language and Vision Using Crowdsourced Dense Image Annotations · Krishna et al., IJCV 2017
- TALL: Temporal Activity Localization via Language Query (Charades-STA) · Gao et al., ICCV 2017
- TimeChat: A Time-sensitive Multimodal Large Language Model for Long Video Understanding · Ren et al., CVPR 2024
- BoundingDocs: A Unified Dataset for Document Question Answering with Spatial Annotations · Giovannini et al., 2025
- DOGR: Towards Versatile Visual Document Grounding and Referring · Zhou et al., 2024
- MMDocBench: Benchmarking Large Vision-Language Models for Fine-Grained Visual Document Understanding · Zhu et al., 2024
Metrics
- Boundary IoU: Improving Object-Centric Image Segmentation Evaluation · Cheng et al., CVPR 2021
- Generalized Intersection over Union: A Metric and A Loss for Bounding Box Regression · Rezatofighi et al., CVPR 2019
- Top-down Neural Attention by Excitation Backprop (the pointing game) · Zhang et al., ECCV 2016