Improving Vision-Language Model Grounding: Coordinate Representations and Decoding Mechanisms

    Vision-language models can understand images yet often struggle to output precise locations. This article examines why grounding is unstable, compares absolute coordinates, normalized relative coordinates, and dedicated coordinate tokens, reviews end-to-end and hybrid decoding paths, and outlines prompt design, output schemas, training data, and evaluation practices for more reliable spatial outputs.

    1. Why Grounding in Vision-Language Models Is Prone to Variation

    Vision-language models (VLMs) typically support image understanding, text-based question answering, object description, and visual reasoning. However, “understanding an image” does not mean “precisely pointing to an object’s location.” When a task requires the model to output bounding boxes, point coordinates, or the locations of multiple objects, it must do three things at once:

    1. Identify the target in the image.
    2. Align the natural-language description of the target with an image region.
    3. Convert the visual region into a numeric sequence that follows the required format.

    The first two steps are closer to semantic understanding, while the third is closer to structured prediction and geometric regression. A language model generates discrete symbols according to sequence probabilities, whereas bounding-box coordinates are continuous values. The gap between these representation spaces is significant, so the model may produce failures such as “the right object is found, but the coordinates are inaccurate” or “the coordinate format is correct, but the coordinates refer to the wrong object.”

    In addition, the visual encoder outputs image features, while the language decoder outputs text tokens. The model must use cross-modal attention to map region features to numeric expressions. This process is highly sensitive to training data quality, coordinate format, token design, and loss functions.

    2. Two Main Approaches to Object Grounding

    Traditional object detection models usually perform classification and bounding-box regression directly on image features. Their output process is relatively explicit, and they commonly use continuous-value regression or predefined grid prediction. These approaches are stable for fixed categories and fixed tasks.

    VLMs are better suited to open-vocabulary scenarios. For example, a user can ask, “Find all people wearing safety helmets in the image,” without restricting the target to a predefined set of categories. The model can use natural language for target filtering, semantic disambiguation, and multi-turn interaction, but the tradeoff is that localization results are easily affected by the language generation process.

    Therefore, the two approaches are not simple replacements for each other:

    • Detection models are better at stable, efficient geometric prediction.
    • VLMs are better at open categories, complex descriptions, and contextual reasoning.
    • Hybrid approaches can often balance accuracy and flexibility.
    • If end-to-end capability is the priority, the coordinate expression and generation mechanisms inside the VLM need focused optimization.

    3. Core Differences in Coordinate Representations

    3.1 Absolute Coordinates

    Absolute coordinates directly use pixel positions in the original image to represent a bounding box, for example:

    1. [x_min, y_min, x_max, y_max]

    This representation is intuitive, and the coordinates have clear physical meaning. However, it has several problems.

    First, images may have different resolutions. The same object corresponds to different coordinate ranges in images of different sizes, so the model must learn the relationship between object position and image size at the same time. Second, coordinate values may contain multiple digits, and a language model often needs to split them into multiple tokens during generation, which lengthens the output sequence. The longer the sequence, the more obvious the accumulated error becomes, and an error in an earlier digit may affect the subsequent structure.

    Absolute coordinates also increase the complexity of the training distribution. When image size, cropping, and scaling change, the coordinate distribution changes accordingly. The model needs stronger normalization capability to remain stable.

    3.2 Normalized Relative Coordinates

    Relative coordinates usually map horizontal and vertical coordinates to a fixed interval, for example by mapping the image range to a unified discrete numeric space. The conversion can be expressed as:

    1. x' = x / image_width × M
    2. y' = y / image_height × M

    Here, M is a pre-agreed discrete range. The model only needs to learn spatial positions under a unified scale and does not need to directly handle numeric changes caused by different resolutions.

    This representation has three advantages:

    • Images of different sizes can share the same coordinate space.
    • The output value range is fixed, making the training distribution easier to converge.
    • It is convenient to design unified coordinate tokens in the text sequence.

    During inference, an inverse transformation restores the original-image coordinates:

    1. x = x' / M × image_width
    2. y = y' / M × image_height

    Note that normalization does not automatically solve all problems. If the discrete range is too small, coordinate quantization error becomes noticeable. If the range is too large, output complexity may increase. Therefore, coordinate precision and sequence length need to be balanced.

    3.3 Dedicated Coordinate Tokens

    A common approach is to design dedicated tokens for coordinate values, mapping discretized numbers directly to special symbols in the vocabulary. In this way, a bounding box can be represented by four tokens:

    1. <box> <x1> <y1> <x2> <y2>

    Compared with having the language model generate digits character by character, dedicated tokens can significantly shorten the sequence and reduce numeric format errors. For example, the model does not need to generate decimal points, negative signs, or multi-digit combinations. Instead, it directly predicts discrete tokens that represent spatial positions.

    The key to this design is not the token names, but the stable mapping relationship:

    1. coordinate value → discrete index → special token

    During decoding, the reverse process is performed:

    1. special token → discrete index → normalized coordinate → original-image coordinate

    If the token design is reasonable, the model can treat coordinate prediction as a constrained classification task rather than relying entirely on natural-language generation of numbers.

    4. Comparing Three Coordinate Output Paths

    4.1 Direct Generation by the Language Model

    This is the most complete end-to-end approach. The image, question, target description, and coordinate output are all handled by the same model, without an additional detector or independent regression module.

    Advantages include:

    • Simple system architecture.
    • Target filtering based on contextual semantics.
    • Support for open vocabulary and complex referring expressions.
    • Output format can be unified with explanations and classification results.

    The downside is that coordinates are easily affected by generation bias. This is especially true when multiple targets are output at the same time, targets overlap, or image details are small. In such cases, the model may produce missed detections, duplicates, or incorrect ordering.

    4.2 Assistance from an External Expert Module

    Another approach is to first use a visual detection or region proposal module to generate candidate boxes, and then let the language model perform target matching and filtering. This approach can leverage the geometric capability of specialized models to improve bounding-box stability.

    However, it introduces additional modules and brings problems related to candidate recall, module interfaces, and error propagation. If the target is not discovered by the candidate module, the subsequent language model cannot recover the region even if it understands the user’s intent.

    4.3 Adding a Dedicated Coordinate Prediction Head

    A dedicated coordinate head can regress bounding boxes directly from visual features or cross-modal features. It is usually better suited to continuous-value prediction than language generation, but it weakens the consistency of pure text generation and requires additional training objectives and inference procedures.

    In engineering practice, the approach can be selected according to the task:

    • If end-to-end behavior and open semantics are important, prioritize direct generation by the language model.
    • If high precision and real-time performance are important, consider adding a dedicated coordinate branch.
    • If both complex semantics and stable detection are needed, use a hybrid architecture that combines candidate regions with language matching.

    5. How to Design Input Prompts

    Grounding tasks can generally be divided into two types.

    5.1 Direct Grounding

    The user directly describes the target and asks the model to return its location in the image. For example:

    1. Find all red boxes in the image and return the bounding box for each object.

    The key to this type of task is to specify the target category, quantity requirements, and output format. The prompt should ideally state:

    • Whether to return all targets.
    • The ordering of multiple targets.
    • That bounding boxes use top-left and bottom-right corners.
    • What to return when no target is found.
    • Whether additional explanatory text is allowed.

    5.2 Referring Grounding

    The user first provides an example target and then asks the model to find other identical or similar targets in the image. For example:

    1. Using the appearance of the example region as a reference, find other objects of the same type in the image and return their positions.

    This type of task requires not only category recognition but also visual similarity matching. The model needs to consider color, shape, texture, pose, and local structure, rather than relying only on the text category.

    To reduce ambiguity, the input can explicitly distinguish:

    • The example region.
    • The search region.
    • The matching criteria.
    • Whether to exclude the example itself.
    • The number and format of returned results.

    6. Output Format Must Be Strictly Constrained

    The most easily overlooked issue in grounding tasks is the output protocol. If the model outputs both explanatory text and coordinates, the post-processing program must additionally parse natural language, which can easily cause failures.

    A structured format is recommended, for example:

    1. {
    2. "objects": [
    3. {
    4. "label": "target category",
    5. "box": [x1, y1, x2, y2]
    6. }
    7. ]
    8. }

    If dedicated tokens are used, a fixed order should also be defined:

    1. target category <box> x1 y1 x2 y2

    Coordinate constraints should also be explicit:

    1. 0 ≤ x1 < x2 ≤ M
    2. 0 ≤ y1 < y2 ≤ M

    When no target is detected, an empty list should be used consistently instead of allowing the model to respond freely. This reduces server-side parsing complexity and makes automated evaluation easier.

    7. Training Data and Optimization Priorities

    A small amount of question-answer data is usually insufficient to train stable grounding capability. The training set should cover at least the following scenarios:

    • Single-target and multi-target cases.
    • Large and small targets.
    • Occlusion and overlapping targets.
    • Different image sizes and aspect ratios.
    • Objects of the same category with different appearances.
    • Complex natural-language instructions.
    • Positive samples and no-target samples.
    • Referring tasks that require excluding the example target.

    Annotations should ensure consistent bounding-box definitions. In particular, it is important to unify whether boundary pixels are included, the ordering rules for multiple targets, and the handling of abnormal boxes.

    A staged strategy can also be used during training:

    1. First train the model to understand the coordinate format.
    2. Then train single-target grounding.
    3. Next add multi-target cases and complex referring expressions.
    4. Finally introduce occlusion, small targets, and cross-region matching.

    This approach helps reduce learning difficulty in the early stages of training.

    8. How to Evaluate Grounding Capability

    Evaluation should not only check whether text is generated successfully. It should assess multiple dimensions:

    • Format accuracy: whether the output follows the agreed structure.
    • Coordinate validity: whether coordinates fall within the legal range.
    • Target recognition accuracy: whether the localized object matches the instruction.
    • Intersection over union (IoU): the overlap between predicted and annotated boxes.
    • Recall: whether all targets that should be found are discovered.
    • Duplication rate: whether the same target is output repeatedly.
    • Scale robustness: whether results remain stable after image scaling.
    • Complex instruction accuracy: whether the model remains effective when color, relationships, and reference objects are involved.

    The final evaluation should consider both semantic correctness and geometric precision. Checking only “whether coordinates were output” would hide many practical problems.

    9. Conclusion

    Improving the grounding capability of vision-language models is not only a matter of scaling up the model. The core challenge is to establish a sound connection among the “visual region—coordinate representation—language output” chain. Relative coordinates can reduce the impact of resolution changes, dedicated coordinate tokens can shorten output sequences, and structured prompts and strict protocols can reduce parsing ambiguity.

    When choosing an approach, direct coordinate generation by the language model offers strong end-to-end characteristics, but its stability needs to be improved through coordinate discretization, data coverage, and format constraints. For scenarios with extremely high precision requirements, a dedicated coordinate branch or candidate-region module can be introduced.

    From an engineering perspective, a reliable grounding system should focus on four aspects at the same time: a unified coordinate space, clear task prompts, strict output formats, and a comprehensive evaluation system. Only by incorporating both semantic understanding and geometric prediction into the design can vision-language models truly evolve from “seeing the image” to “accurately pointing out the target.”