Multimodal Model Design: Visual Primitives, Reference Gap, and Token Budgets
This article analyzes the technical design of an experimental open-source multimodal model through its tokenizer and output behavior. It explains the perception gap and reference gap that cause real-world failures, the four visual primitives (point, box, polygon, and reference span), why explicit primitive tags often disappear in chain-of-thought output, and what the image placeholder numbering reveals about visual token budgets. It also covers practical guidance for parsing coordinate output, evaluation metrics, integration, and cost control.
1. Background: Two Gaps in Multimodal Models
Over the past year, most capability gains in multimodal large models have happened at the “seeing” layer. Yet real-world failures are usually not about seeing poorly, but about referring inaccurately. The industry commonly splits this into two layers:
- Perception Gap: The input image is compressed into a limited number of visual tokens. Details such as resolution, small objects, and dense layouts are lost during encoding, so the model physically lacks the information needed to answer.
- Reference Gap: Even when the information is sufficient, the model still describes targets in natural language within its chain of thought (“the cup on the left”, “the third person from the top right”). The ambiguity of natural language makes references drift across multi-step reasoning, which breaks logic in dense counting, complex spatial localization, and multi-object attribute binding.
A reusable way to diagnose this: if the model’s description is inconsistent when it answers incorrectly, the problem leans toward reference; if the description is consistent but the value or position is stably wrong, the problem leans toward perception. This distinction directly determines whether the next optimization step is to change the encoder and tiling strategy, or to change the prompt and output protocol.
2. Reading the Design from the Vocabulary: Three Classes of Special Tokens
One interesting signal in the experimental open-source multimodal model is hidden in the tokenizer configuration: the vocabulary contains paired open and close markers that semantically correspond to polygons, points, bounding boxes, and reference spans. Abstracted out, these are three classes of “visual primitives”:
- Point: A pair of coordinates used to refer to a “position”, suitable for keypoints, anchors, and counting marks.
- Box: A rectangular region formed by two coordinate pairs, used to refer to a “range”, suitable for detection and region attribute question answering.
- Polygon: A contour enclosed by a sequence of points, used to refer to a “shape”, suitable for segmentation and irregular region statistics.
- Reference span (ref): Binds a piece of natural language to a set of coordinates, acting as an explicit “natural language to visual coordinate” mapping table.
The engineering value of this design is that coordinates are unambiguous pointers. They move “which object is being referred to” from language space into geometry space, so the reasoning chain can do arithmetic on coordinates (deduplication, sorting, filtering by area) instead of repeatedly re-describing the same target with adjectives. A schematic output protocol is shown below (structure only, not any specific product interface):
<ref>cup A</ref> <box>[x1,y1,x2,y2]</box><ref>cup B</ref> <point>[x,y]</point>count = dedup(all <point> markers)
Two engineering details also matter: the coordinate normalization convention (absolute pixels, or a quantized range of 0 to 1 or 0 to 1000), and offset compensation caused by image resize and padding. If these conventions are unclear, they are the most common source of errors in secondary development.
3. A Phenomenon Worth Digging Into: Explicit Primitives “Disappear”
In practice, explicit primitive wrapper markers often do not appear in the chain of thought. Instead, coordinates are embedded in natural language, for example “there is another one near (0.42, 0.61)”. This looks more like representation collapse and re-convergence in the later training stage: the model learned the semantics the primitives were meant to express (referring by coordinates) but no longer depends on the syntactic sugar of wrappers.
For users, this has three implications:
- Do not judge capability by whether markers exist in the vocabulary. Markers in the vocabulary do not mean the model will output them during reasoning.
- Parsers must be backward compatible. It is recommended to support three forms at once: “with markers”, “bare coordinates”, and “tabulated coordinates”, with both regex and structured fallbacks.
- Promptability is limited. Whether primitives are output explicitly is heavily influenced by the training recipe. Enforcing it with prompts is usually unstable; a more reliable approach is structured post-processing and validation after decoding.
A minimal working skeleton for coordinate extraction and validation:
import rePOINT = re.compile(r"[\(\[]?\s*(-?\d+\.?\d*)\s*,\s*(-?\d+\.?\d*)\s*[\)\]]?")def extract_points(text, norm=1000.0):pts = []for a, b in POINT.findall(text):x, y = float(a), float(b)if 0 <= x <= norm and 0 <= y <= norm:pts.append((x / norm, y / norm))return ptsdef dedup(pts, eps=0.01):out = []for p in pts:if all(abs(p[0]-q[0]) > eps or abs(p[1]-q[1]) > eps for q in out):out.append(p)return out
4. Interleaved Image-Text Placeholders: What Numbering from 0001 to 0442 Means
Another class of special markers is a sequence shaped like “placeholder_mm_span_number”, with consecutive numbering covering hundreds of slots. Intuitively, it is an “image anchor” inserted into the text stream during interleaved image-text layout. But the number of slots does not match the officially claimed multi-image limit. This is usually not a contradiction, but two mechanisms at different granularities:
- The document-level limit constrains “how many images a single request can carry”.
- The slot/span mechanism constrains “how many addressable fragments a single image is split into”. After a high-resolution image is tiled, each tile needs its own anchor, so slot demand scales with resolution and tiling strategy.
This leads to a practical conclusion: in multi-image long-document scenarios, the real bottleneck is often not the number of images but the visual token budget. Feasible control measures include cropping by layout saliency, increasing tiling density for tables and formula regions, downsampling purely decorative images, and maintaining an “image ID to fragment to coordinate” mapping table at the application layer for traceability and reference.
5. Implementation Guidance: Evaluation, Integration, and Cost Control
Evaluation: Split benchmarks into a perception group (counting, OCR, fine-grained attributes) and a reference group (multi-object localization, coreference resolution, cross-region comparison), and report them separately. For the reference group, report both “coordinate hit rate” and “duplicate count rate”; these two metrics locate problems better than overall accuracy.
Integration: Call the model service through a unified inference interface. On the input side, fix image preprocessing and coordinate conventions; on the output side, do structured parsing and retry on failure. For batch offline tasks, use an asynchronous queue, store intermediate images and results in object storage, and track timeout rate, parse failure rate, and token consumption with logging and monitoring alerts.
Cost: Visual tokens are the main source of expense. Compressing resolution, limiting the maximum number of images, and caching features of repeated images are the three most effective measures. Containerized deployment makes it easier to scale elastically with peak load.
6. Conclusion
The most noteworthy aspect of experimental multimodal models is not the syntax of any particular marker, but the idea of treating “reference” as a first-class citizen: replacing vague descriptions with coordinates gives the reasoning chain a computable, verifiable structure. For developers, focusing on three things, coordinate conventions, parsing compatibility, and token budget, is enough to build stable, usable applications on top of experimental models that iterate quickly.
