Visual Primitives in Multimodal Models: A Technical Breakdown of Unambiguous Object Reference
This article examines why multimodal models often identify image content correctly yet fail at precise localization and counting, tracing the problem to a perception gap and a reference gap. It explains the visual primitive approach, which uses structured geometric markers such as boxes, points, polygons, and references to build unambiguous pointers in continuous visual space. The article covers the marker format, data construction requirements, progressive training and inference practices, a three-layer evaluation design, and practical deployment guidance along with the limits of the technique.
1. Where the Problem Starts: Why Multimodal Models See but Cannot Pin Down
Over the past year, progress in multimodal models has shifted from “can it recognize what is in an image” to “can it precisely locate and count objects in an image.” In real projects, developers often run into an awkward pattern: the model correctly names what is in the scene, but repeatedly fails on dense counting, small-object localization, and region-level attribute judgments. What makes this harder is that the failures are not random noise. They are reproducible logical breakdowns.
Understanding this requires separating two layers of the problem. The first is the perception gap: the features produced by the visual encoder are not sufficient to support fine-grained recognition, which shows up as “not seeing clearly.” The second is the reference gap: during reasoning, the model still refers to objects in natural language, for example “the second one from the left” or “the small block near the edge.” Such expressions are inherently ambiguous in a continuous visual space, so the reasoning chain breaks at the reference step. The widely accepted view in the field is that once perception is adequately addressed, the main constraint on complex visual tasks moves to the reference step.
2. The Technical Route: Representing Objects as Unambiguous Pointers
An experimental multimodal model follows this line of thinking. Its technical core can be summarized as visual primitives: using structured geometric markers to establish a unique pointer for each object in continuous visual space, instead of relying on natural language descriptions.
The public tokenizer configuration shows several special markers that appear in pairs, wrapping polygons, points, bounding boxes, and reference relations. Structurally, they form a closed pattern of “start marker + content + end marker.” This design has three engineering implications:
- The closed structure is easy to parse in a streaming fashion and to validate, so model output can be consumed directly by programs with no natural language post-processing.
- Geometric primitives and text tokens live in the same sequence space, so the attention mechanism can naturally link a reference to its coordinates.
- The markers are registered as indivisible atomic units, which prevents coordinate strings from being broken apart by ordinary subword tokenization and losing semantic integrity.
A schematic representation of the format is shown below (for format illustration only, not a specific product interface):
<box> x1,y1,x2,y2 </box><point> x,y </point><polygon> x1,y1 x2,y2 ... </polygon><ref> target primitive ID </ref>
It is worth stressing that the presence of special markers does not mean the reasoning process must explicitly emit primitives. Whether they are generated explicitly depends on the training data mix and the inference strategy. The markers are better understood as an available capability bit, and the model decides whether to invoke it based on the task at hand.
3. Data Construction: The Real Barrier to Visual Primitive Capability
In engineering practice, the model architecture is rarely the bottleneck. Data is. For a model to use coordinate-based reference reliably, training samples need to satisfy three conditions.
First, reference uniqueness. Every referenced object in the same image must have a stable ID, and IDs must not be reused within a sample, so the model cannot learn the shortcut of “guessing whatever is nearest.”
Second, annotation consistency. Coordinate normalization, origin position, polygon vertex order, and box tightness must be globally consistent. Annotation noise translates directly into jitter in coordinate regression.
Third, task diversity. The data should cover at least region description, attribute question answering, counting, ordering, spatial relation judgment, and cross-image comparison, and should mix natural language answers with primitive answers in the same batch so the model learns when to use which form of expression.
A minimal example of sample organization:
{"image": "sample.png","objects": [{"id": 1, "primitive": "box", "coords": [0.12, 0.30, 0.28, 0.55]},{"id": 2, "primitive": "point", "coords": [0.61, 0.44]}],"conversations": [{"role": "user", "content": "Count the objects in the image and give each position as a primitive"},{"role": "assistant", "content": "There are 2: <ref>1</ref> and <ref>2</ref>"}]}
4. Practical Notes on Training and Inference
On the training side, a progressive strategy is recommended: start with general image-text alignment data to preserve baseline capability, then inject a small amount of high-quality primitive data to activate the markers, and finally reinforce the capability with high-difficulty localization and counting data. Introducing primitive samples at a large ratio from the very beginning tends to degrade general conversational ability.
On the inference side, three things need attention. The first is the robustness of the output parser. It must handle anomalies such as out-of-range coordinates, too few vertices, and unclosed markers, and it should provide a fallback path that retries or degrades to a natural language description. The second is matching coordinate precision to input resolution; too low a resolution makes small-object coordinates meaningless. The third is decoding constraints. Constrained decoding that guarantees valid primitive structures can significantly reduce format error rates.
5. Evaluation Design: Do Not Draw Conclusions from a Single Metric
Evaluation should be split into three layers. The format validity rate measures structural stability. Localization accuracy is measured with metrics such as mean intersection over union and center point distance. Task accuracy covers downstream capabilities such as counting, ordering, and spatial relations. All three layers need to be observed together, otherwise a case where “the format is right but the localization is off” can be mistaken for a capability improvement.
A control group should also be set up, comparing natural language reference against primitive reference under the same data and compute budget. Only then can you verify whether the reference gap hypothesis holds in your specific scenario.
6. Deployment Recommendations and Capability Boundaries
If an organization plans to reuse this route in its own business, it can start with pilots in localization-heavy scenarios such as quality inspection, remote sensing, document layout analysis, and retail shelf analysis. On the engineering side, inference services can run on a general-purpose container platform, sample data and artifacts can be managed in object storage, and log services plus monitoring and alerting can track format error rates and latency fluctuations to form a closed iteration loop.
The boundaries should be viewed objectively. Visual primitives improve the stability of reference and localization, but they cannot supply detail that the visual encoder never captured. In extremely dense scenes, annotation cost and coordinate precision remain the main constraints. The rational conclusion is to treat this as a capability enhancement of the structured output layer, not a replacement for general visual capability.
