Visual Language Model Technical Breakdown: How Visual Primitives Close the Referential Gap
This article examines how experimental open-source vision-language models use structured spatial references, known as visual primitives, to improve reasoning accuracy. It explains the difference between the perception gap and the referential gap, shows how paired special tokens represent geometric structures in the tokenizer, and clarifies why these primitives usually stay hidden during inference. It also outlines a reproducible evaluation approach, deployment and cost-control practices, and risk controls for production use.
1. Background: From Seeing an Image to Seeing Clearly and Describing Accurately
Over the past two years, most multimodal model engineering has focused on closing the gap in basic image comprehension: stronger visual encoders, higher-resolution tiling strategies, and larger image-text alignment corpora. Once recognition quality crosses the passing threshold, a subtler problem appears. Models still rely on natural language to describe visual content while reasoning, and natural language is highly ambiguous for spatial reference.
Dense counting and complex localization are typical examples. When an image contains dozens of similar objects, passing intermediate conclusions through an internal reasoning chain with phrases such as “the red block on the left” causes references to drift quickly, leading to repeated counts, missed counts, or misaligned coordinates. These failures are not caused by poor visibility. The model sees the content clearly but cannot describe it precisely. Experimental open-source vision-language models therefore begin introducing structured spatial reference mechanisms, shifting part of the intermediate reasoning carrier from natural language to symbol structures that can be located precisely.
2. Core Concepts: The Perception Gap and the Referential Gap
Understanding this technical approach requires splitting the problem into two layers.
The first is the perception gap, which refers to information loss on the input side, such as insufficient resolution, compressed details, or small targets dropped by the tiling strategy. This layer is usually mitigated by improving input fidelity.
The second is the referential gap, which is an expression bottleneck on the generation side. Even with sufficient input fidelity, the model still needs an unambiguous set of pointers to lock onto targets in continuous visual space. Visual primitives are essentially such pointers: geometric structures such as points, boxes, and polygons carry the semantics of “where to point,” instead of a piece of natural language that may be interpreted in multiple ways.
This approach offers three benefits. First, the semantics of geometric structures are closed: a point is a coordinate, with no room for synonymous rewriting. Second, geometric structures are composable: points can form boxes, and boxes can be refined into polygons, supporting coarse-to-fine reasoning. Third, geometric structures can be verified programmatically, so the engineering side can perform validity checks and post-processing on model output rather than relying only on text matching.
3. Tokenizer-Level Implementation: How Special Tokens Are Organized
These models typically register a set of paired special tokens in the tokenizer configuration to wrap the beginning and end of geometric structures, covering categories such as polygons, points, bounding boxes, and reference markers, each with an opening and closing tag. They are marked as special tokens in the vocabulary, excluded from regular subword splitting, and not normalized, so they remain atomic symbols on both the encoding and decoding sides.
The illustrative structure below only expresses the organization, not a specific implementation:
{"added_tokens": [{"id": 129271, "content": "<|/polygon|>"},{"id": 129272, "content": "<|polygon|>"},{"id": 129273, "content": "<|/point|>"},{"id": 129274, "content": "<|point|>"},{"id": 129275, "content": "<|/box|>"},{"id": 129276, "content": "<|box|>"}]}
Several engineering details matter. First, special tokens must be added to the no-split list; otherwise they are split into ordinary fragments and structured output fails immediately. Second, vocabulary expansion changes the output layer dimensions, so the inference framework’s loading and alignment logic for vocabulary increments must be confirmed. Third, paired tags mean the output can be parsed by a state machine: a missing closing tag can be treated as truncation or a format error, which is far more reliable than judging whether natural language output “looks right.”
4. A Commonly Misunderstood Behavior: Primitives Are Not Explicitly Emitted During Inference
In practice, models often do not print large blocks of geometric tags in their answers, as paper examples might suggest. The reason is not mysterious. Introducing primitives during training mainly helps the model learn to “think in coordinates” under supervision, anchoring spatial reasoning to verifiable geometric quantities. After alignment and post-training, the model is usually guided to translate internal spatial conclusions back into natural language conclusions, presenting only the final answer to the user.
In other words, primitives act more like an implicit intermediate representation than an external output protocol. This also explains why looking only at the final text underestimates the approach: the gains appear in counting accuracy, localization stability, and consistency in long-chain spatial reasoning, not in the visual appeal of the output format. If intermediate geometric results are genuinely needed, the common practice is to use structured output constraints, ask the model to provide intermediate quantities step by step, or explicitly request them through an outer layer of prompts and parsing, rather than assuming default behavior exposes internal representations.
5. How to Validate These Capabilities: A Reproducible Evaluation Approach
For experimental models, the safest approach is to build a small, reproducible evaluation set rather than rely on promotional claims. Four dimensions are recommended.
- Counting: construct images with dense targets of the same type, measure absolute and relative error, and observe whether error grows with target count.
- Localization: use intersection over union and center-point distance to measure box or point prediction quality, distinguishing “box offset” from “wrong target entirely.”
- Referential resolution: provide ambiguous descriptions and check whether the model consistently locks onto the same target, evaluating cross-turn consistency.
- Format robustness: measure the structured output parse failure rate, missing tag rate, and out-of-bounds coordinate rate.
The skeleton of an evaluation script can be simple:
def evaluate(samples, model):stats = {"count_mae": [], "iou": [], "parse_fail": 0}for s in samples:out = model.generate(s["prompt"], image=s["image"])parsed = parse_primitives(out) # Parse geometric structuresif parsed is None:stats["parse_fail"] += 1continuestats["count_mae"].append(abs(len(parsed["points"]) - s["gt_count"]))stats["iou"].append(iou(parsed["box"], s["gt_box"]))return {k: (sum(v) / len(v) if isinstance(v, list) else v)for k, v in stats.items()}
The key is to track parse failures separately. The degradation mode of structured approaches is often not a wrong answer but broken formatting. If such samples are not measured separately, overall metrics will be severely overestimated.
6. Engineering Deployment: Infrastructure, Cost, and Risk Control
Bringing experimental multimodal models into production requires budgeting around compute and stability. Common practices include the following: high-resolution visual input significantly increases computation, so tiling granularity should be chosen according to business accuracy needs rather than maximized; result caching and similar-image deduplication can be introduced for high-frequency repeated requests; long-output and short-output scenarios can be routed to inference resources of different specifications; container platforms can support elastic scaling, object storage can hold original images and intermediate artifacts, and logging and monitoring with alerting can track parse failure rates, latency percentiles, and GPU memory usage.
Three risk-control red lines are recommended. First, out-of-bounds coordinates and missing tags must be intercepted and fall back to retry or manual review. Second, structured output must pass schema validation before entering downstream systems to prevent dirty data from spreading. Third, experimental versions have unstable capability boundaries, so a switchable fallback should be retained, with model differences isolated behind a unified abstraction layer to keep replacement costs manageable.
7. Conclusion
The real contribution of the visual primitive approach is separating “reference” in multimodal reasoning from natural language and assigning it to verifiable geometric structures. Paired special tokens in the vocabulary are merely the projection of this design at the encoding layer, and not explicitly printing primitives during inference does not mean the approach has failed. For developers, the practical path is to build a multi-dimensional evaluation set, treat format robustness as a first-class metric, and handle resource tiering and output validation on the deployment side. Running on general capabilities such as the container platform, object storage, and monitoring and alerting offered by Baidu AI Cloud can make it faster to gain elasticity and observability, letting teams focus on evaluation and quality tuning.
