Parsing and Validating Visual Primitives in Open-Source Multimodal Models
Visual primitives such as points, bounding boxes, polygons, and references can connect natural-language descriptions with specific image regions. This article explains what special tokens can and cannot prove, why structured outputs may remain invisible during normal interaction, how to design reproducible validation tests, and how to integrate model-generated locations into a safe, auditable engineering workflow.
1. From “What Is in the Vocabulary?” to “How Is the Capability Validated?”
When evaluating open-source multimodal models, developers typically focus on image understanding, optical character recognition, chart analysis, and reasoning. However, the ability to associate a natural-language description with a specific location in an image is equally important for real-world applications.
For example, answering “There is a damaged area in the image” demonstrates semantic recognition. Identifying where the damage is located and returning coordinates that software can process requires spatial localization as well. This distinction matters in document review, industrial inspection, and interactive annotation.
The source material offers an interesting clue: the tokenizer configuration of an experimental multimodal model contains special markers for points, boxes, polygons, and reference boundaries. These markers may not appear during ordinary use.
This observation should be divided into three separate questions:
- Can the tokenizer represent these structures?
- Was the model trained on the corresponding tasks?
- Does the current inference interface allow the model to output these structures reliably?
The presence of a category of tokens in the vocabulary directly proves only that the representation layer can encode them. It does not, by itself, prove localization ability, the training approach, or task accuracy. Keeping these distinctions clear leads to a more reliable assessment than drawing conclusions from a small amount of configuration data.
2. What Are Visual Primitives?
Visual primitives are basic geometric units used to describe spatial information in an image. They are not complete visual-understanding results. Instead, they provide a representation layer that connects semantic descriptions with image locations.
2.1 Points: Representing Locations and Key Nodes
A point generally consists of two coordinate values and can describe an object center, a contour node, or another specific location.
In an interactive task, for example, a user might ask the system to “point to the center of the button,” and the system could return a point. In structural analysis, multiple points can represent a set of key locations.
A single point does not contain complete semantics by itself. Whether it represents a center, a corner, or a user-specified location must be defined by the task. Without such a semantic constraint, valid coordinates may still fail to meet the business requirement.
2.2 Bounding Boxes: Representing an Approximate Extent
A bounding box represents the approximate location of an object as a rectangle. Common formats include the top-left and bottom-right coordinates, or a center point combined with width and height.
Bounding boxes are simple and computationally convenient. They also integrate easily with cropping, manual review, and region retrieval workflows. However, a box is not an accurate contour. For tilted text, curved objects, or irregular defects, a large portion of the box may contain background.
Bounding boxes are therefore suitable for coarse localization, but they cannot automatically replace precise region descriptions.
2.3 Polygons: Representing More Complex Boundaries
A polygon describes a region through an ordered list of vertices and can follow some irregular targets more closely than a rectangle.
It also introduces stricter structural requirements. The number of vertices must be reasonable, coordinates must be valid, and vertex ordering must be consistent. Self-intersections that violate the task definition should be avoided. For targets with holes or multiple disconnected components, a simple polygon may not be sufficient.
Therefore, “the model supports polygon markers” and “the model can reliably perform fine-grained segmentation” are conclusions at different levels and should not be treated as equivalent.
2.4 References: Linking Semantic Objects to Spatial Results
Reference markers generally identify the object or text span being localized, linking semantic content with a geometric result. For example, “the device on the left” and its bounding box should belong to the same result rather than appearing as unrelated text fragments.
However, start and end markers alone do not reveal the exact reference protocol. Their meaning must be verified through training documentation, examples, or actual model outputs.
3. What Special Tokens Can and Cannot Prove
In a tokenizer configuration, point, box, and polygon types may each have separate start and end markers. This gives the model an opportunity to organize structured sequences with explicit boundaries instead of relying entirely on natural-language descriptions.
Potential benefits include:
- Clearer structural boundaries: Parsers can identify the object type and its extent.
- More consistent output formats: The same geometric object can be represented with less ambiguity.
- Easier semantic-spatial association: Applications can build traceable region results.
These are potential advantages of the representation mechanism, not verified performance conclusions.
A model may retain such markers to support compatibility with a particular training format or a shared vocabulary without having fully learned the associated capability in the current version. The capability may exist while the current service exposes only natural-language output. Alternatively, structured output may require a specific task template that ordinary conversation does not trigger.
A rigorous analysis should therefore distinguish among three levels of evidence:
| Evidence level | What it can support | What it cannot directly support |
|---|---|---|
| Tokenizer configuration | The representation space contains the relevant markers | The model has reliable localization ability |
| Training or task documentation | A structure may have been used in training or evaluation | The current deployment interface exposes the capability |
| Reproducible practical tests | The model can output and use the structure under specific conditions | Equivalent performance in every scenario |
Token IDs are implementation details. They can help identify markers in a specific configuration, but they should not be interpreted as a cross-version protocol. Nor can they serve as evidence of accuracy, speed, or training scale.
4. Why Visual Primitives May Not Appear in Normal Interaction
The absence of structured markers in an ordinary response does not necessarily mean that the model lacks the underlying capability. The entire output path should be examined.
4.1 Special Tokens May Be Removed During Decoding
Some decoding pipelines omit special tokens to present more natural text to users. If the relevant markers are classified as special tokens, they may not appear in the final visible string.
During troubleshooting, compare the generated token sequence, the decoded output with special tokens preserved, and the final displayed content. However, removing boundary markers does not necessarily remove internal coordinates. Therefore, the absence of a complete structure is not enough to conclude that all region information was filtered out.
4.2 Intermediate Processing May Rewrite the Result
Inference results may pass through interface wrappers, format converters, or presentation layers. These components may extract, hide, or transform parts of the structure.
Developers should inspect the raw response and the conversion rules rather than relying only on the chat window. If the raw response differs from the displayed result, the issue may be in the processing pipeline rather than in model generation.
4.3 Ordinary Questions May Not Trigger Localization
“What is in the image?” and “Return the coordinates of the specified object” are different tasks. A model may understand regions but provide only a textual explanation for the first prompt.
Test prompts should explicitly define the target object, coordinate convention, and output structure. Still, forcing the model to produce a marker sequence and receiving a syntactically valid string is not proof of localization ability. The model may simply be following the requested format.
4.4 The Model May Not Have Learned the Structure Reliably
Experimental capabilities may produce incomplete outputs, incorrect object associations, or inaccurate coordinates. Retaining the relevant tokens does not mean that the model can consistently perform every associated task.
All of these explanations are hypotheses that require validation. Without raw outputs or configuration evidence, it is not appropriate to assert that any one explanation is the definitive cause.
5. Designing a Reproducible Validation Workflow
Step 1: Define the Task and Coordinate Protocol
Before testing, clarify the meaning of the coordinates:
- Are they pixel coordinates in the original image or normalized coordinates?
- Where is the origin?
- What are the directions of the two axes?
- Was the input resized, cropped, or padded?
- Do the outputs refer to the original image or the processed image?
- What do the four values in a bounding box represent?
Inconsistent coordinate protocols can create the false impression that the model localized an object incorrectly. For example, if the model returns coordinates for a resized image while the business system draws them directly on the original image, the result will be offset.
If preprocessing consists only of resizing and padding, coordinate recovery can be summarized as:
original coordinate = (processed coordinate - padding offset) / scale factor
Cropping, non-uniform scaling, and other transformations require separate records and cannot be handled by this simplified relationship.
Step 2: Start with Simple Images
Begin with images that have a clean background and clearly defined targets. For example, place geometric objects with different colors and shapes on an otherwise empty canvas. Ask the model to locate their centers, return bounding boxes, and describe polygon boundaries.
This reduces semantic ambiguity and makes it easier to distinguish among object-recognition failures, coordinate-generation errors, structural-format problems, and output-parsing issues.
After the basic tasks succeed, introduce similar objects, occlusion, small targets, and complex backgrounds.
Step 3: Validate Both Format and Location
A consistent application-level data structure can be used to receive the result. The following is illustrative only and does not represent any specific model’s native protocol:
{"object_description": "region to be localized","geometry_type": "bounding_box","coordinate_convention": "original_image_pixels","coordinates": [left, top, right, bottom]}
Validation should cover at least two dimensions:
- Structural validity: Required fields are present, the number of coordinates is correct, and values are within the allowed range.
- Spatial correctness: The returned region corresponds to the target, does not include excessive background, and does not omit important parts of the target.
Format constraints can reduce unparseable outputs, but they cannot guarantee spatial accuracy. Producing a valid rectangle is not the same as accurately locating the target.
Step 4: Include Samples Where the Target Is Absent
Testing only images where the target exists leaves out a critical risk: the model may return a location under every condition.
The test set should include missing targets, ambiguous descriptions, and multiple candidate objects. Observe whether the model can reasonably refuse to localize, request clarification, or return an empty result permitted by the task.
For inspection and review workflows, incorrectly localizing a nonexistent object may be more dangerous than returning an invalid format.
Step 5: Establish Task-Level Metrics
Bounding boxes can be evaluated with intersection over union, which measures the overlap between the prediction and the ground truth. Point localization can be evaluated using distance error, normalized according to image dimensions. Polygon results can be assessed through region overlap and boundary deviation.
Also record:
- Output parseability rate;
- The proportion of out-of-range coordinates;
- False positives when the target is absent;
- Missed targets in multi-object scenarios;
- Consistency across repeated tests;
- Inference latency and resource consumption.
These metrics must be interpreted in the context of the business task. A few visually convincing examples are not enough to establish overall capability.
6. Engineering Integration: Treat Model Output as a Candidate Result
In production systems, visual primitives should enter a clearly defined validation pipeline:
Image input→ preprocessing record→ model inference→ structure parsing→ coordinate validation→ coordinate recovery→ business-rule checks→ display or human review
The key principle is to avoid treating generated output as an unquestionable business fact.
The parsing stage identifies missing fields, invalid values, and incorrect geometry types. Coordinate validation checks ranges and geometric relationships. Business rules determine whether the result meets the requirements of the current task. For example, text-region localization may require sufficient coverage, while inspection workflows may prioritize missed detections and false positives.
Logs should retain the task configuration, preprocessing information, raw output, and error classifications needed for reproduction. At the same time, access to sensitive images and extracted content should be limited by appropriate retention periods and permissions.
High-risk workflows should also include human review or an independent verification mechanism. A visually neat bounding box is not, by itself, a sufficient basis for automatically executing an irreversible business action.
7. Conclusion: The Real Value Is a Verifiable Semantic-Spatial Link
The technical importance of visual primitives lies in their potential to move multimodal output beyond “explaining an image” toward “locating an object and generating a machine-processable structure.” Points, boxes, polygons, and reference boundaries provide the representation layer for this connection.
Evaluation must nevertheless respect the evidence boundary:
- The tokenizer shows what can be represented.
- Task documentation provides clues about training or intended use.
- Reproducible tests demonstrate capability under specific conditions.
- Engineering acceptance confirms whether the capability meets business requirements.
The key question is not whether special markers exist. It is whether the model can reliably associate objects with regions under a clearly defined coordinate protocol, handle missing targets correctly, and produce results that fit into a reproducible, verifiable, and auditable workflow.
Only after this loop is complete do visual primitives become a usable multimodal capability rather than merely an interesting clue in a model configuration.
