HiLoc: A Hierarchical Representation Method for Spatial Localization in Multimodal Large Language Models

Evelyn Zhang, Fufu Yu, Hanjun Li, Aoqi Wu, Ke Yan, Shouhong Ding, Tianhe Ren, Xinting Hu, Xiaojuan Qi, Li Jiang, Jiaya JiaNeurIPS 2026

TL;DR

Teaching Multimodal Large Language Models (MLLMs) to point at objects in an image usually forces a tough trade-off: treat coordinates as plain text (which confuses the model about geometry) or add thousands of dedicated location tokens to the vocabulary (which destabilizes training). HiLoc solves this by mimicking human vision—locating a rough region on a coarse grid first, then zooming into a fine-grained cell, reusing the exact same tiny set of special tokens for both steps. Paired with a new dataset that teaches the model when to say "nothing is there," this simple hierarchical trick dramatically boosts precision, especially for tiny objects.

What Problem Does This Paper Address?

When we want a unified MLLM to both chat and draw bounding boxes around objects, we usually frame object detection as sequence generation—predicting box coordinates one token at a time. Currently, there are two standard ways to do this, and both are flawed:

  1. Plain-text coordinates: Outputting strings like "199" or "200". Because language tokenizers chop numbers into arbitrary symbols, "199" and "200" look completely unrelated to the model. Standard cross-entropy loss treats predicting "200" instead of "199" just as harshly as predicting "999", completely ignoring true spatial distance.
  2. Flat special tokens: Adding 1,000+ learnable tokens (<0> through <999>) to represent normalized grid positions. While this preserves some spatial order, getting finer resolution requires linearly expanding the vocabulary. A massive output space dilutes gradients, slows convergence, and makes training unstable.

Furthermore, MLLMs are notorious "yes-men"—if you ask them to find a "purple giraffe" in a photo of a kitchen, they will often hallucinate a box rather than reject the premise, largely because training datasets lack negative examples.

Figure 1: Overview of HiLoc. Existing MLLMs encode a location as a flat sequence of coordinate tokens (plain-text [1, 6, 47] or special tokens [16]). HiLoc instead predicts a coarse-to-fine hierarchical spatial index with special tokens, yielding small quantization error, more stable training, limited error propagation, and strong rejection ability for absent targets. HiLoc consistently surpassing strong baselines across diverse detection and grounding benchmarks.

Methods

Built on top of Qwen3-VL-4B-Instruct, HiLoc replaces flat coordinates with Hierarchical Spatial Indexing:

  • Coarse-to-Fine Factoring: Instead of slicing an image into a flat $4096 \times 4096$ grid (which would require 4,096 tokens), HiLoc imposes a coarse $M \times M$ grid (e.g., $64 \times 64$), and subdivides each grid square into $N \times N$ fine cells (also $64 \times 64$).
  • Shared Vocabulary: Crucially, both levels share the same 64 special index tokens (<0> to <63>). Every point is predicted as a coarse <grid> pair followed by a fine <cell> pair, wrapped in a clean markup grammar alongside a dedicated <no_box> token to explicitly reject absent targets.
  • Two-Stage Training: After standard Supervised Fine-Tuning (SFT) to learn the syntax and basic localization, the authors apply Group Relative Policy Optimization (GRPO)—a reinforcement learning technique. Candidate predictions are scored using a custom reward that balances syntax compliance, box overlap (IoU), and explicit rewards/penalties for properly handling absent objects.

Datasets

  • Training: Supervised fine-tuning spans ~4.4M samples across general detection (COCO, LVIS, Objects365-v2, OpenImages-v7, V3Det, PACO, etc.), grounding (RefCOCO/+/g, Ref-L4), and aerial imagery (VisDrone, DOTA-v2, FAIR1M), followed by an 80K subset for GRPO.
  • Introducing HiRef-500K: To cure hallucinated boxes and boost complex reasoning, the authors used Qwen3-VL-32B to generate ~500,000 referring expressions on existing detection images. Unlike older benchmarks with simple phrases, HiRef-500K covers five rich categories: attributes, states, spatial relations, set logic, and non-existent objects (negative samples).
  • Evaluation: Tested across COCO, LVIS, RefCOCOg, VisDrone, OmniLabel, and $D^3$ (the last two specifically test complex descriptions and negative-sample rejection).

Key Insights and Ideas

  • Quadratic Resolution Scaling: By reusing $L$ tokens across two levels, effective resolution scales as $L^2$. Just 64 learnable tokens give HiLoc a crisp $4096 \times 4096$ resolution—over $4\times$ finer than a 1,000-token flat vocabulary, with $15\times$ fewer tokens to learn.
  • Graceful Error Degradation: If a flat-text model flubs the first digit of "537" and outputs "637", the box jumps by 10% of the image width, tanking accuracy. In HiLoc, if the model flubs a fine <cell> token, the error is strictly trapped inside a single coarse grid square (a tiny $<1.6\%$ drift).
  • Smoother Optimization: Choosing among 64 options per step instead of 1,024 prevents gradient dilution. In controlled tests at identical $1024 \times 1024$ resolutions, HiLoc's coordinate gradient norms decreased steadily during training while flat tokens plateaued early.

Key Results

HiLoc consistently outperforms strong MLLM baselines (like Rex-Omni and SEED1.5-VL), with gains magnifying as localization requirements get stricter:

Radar chart showing HiLoc outperforming Rex-Omni and Qwen3-VL-4B across seven diverse benchmarks.
  • High-Precision & Small Objects: On COCO, HiLoc edges out Rex-Omni at standard IoU$_{0.5}$ (73.1 vs. 72.0 F1), but crushes it under strict IoU$_{0.95}$ (21.3 vs. 15.9 F1). On VisDrone (dense, tiny aerial targets), HiLoc achieves 2.6$\times$ Rex-Omni's strict F1 score (3.9 vs. 1.5).
  • Complex Grounding: On RefCOCOg (val/test) at strict IoU$_{0.95}$, HiLoc hits 55.6 / 53.9 F1, leaping past Rex-Omni by +20.3 / +17.3 points.
  • Knowing When to Say "None": On $D^3$, which heavily tests absent targets, HiLoc achieves a Full AP of 53.1 (and 46.6 Absence AP), more than doubling Rex-Omni's 21.5 Full AP.

Limitations and Future Work

The main text of the paper does not feature a dedicated limitations or future work section (noting only that additional theoretical assumptions and corrections are housed in Appendix H, which is outside this document). However, one practical trade-off apparent from the method's design is sequence length: while a flat special-token model encodes a point in 2 tokens, HiLoc's markup grammar (<point> <grid> i j </grid> <cell> u v </cell> </point>) requires more tokens per bounding box, trading slightly longer autoregressive generation sequences for vastly superior vocabulary efficiency and spatial precision.

Summary updated

Abstract

Existing multimodal large language models (MLLMs) typically formulate object detection as a conditional sequence generation task. Under this paradigm, spatial locations are commonly represented by either textual coordinates or special quantized learnable tokens. However, textual coordinates are tokenized as unrelated symbols, spatially adjacent points (e.g., $x=199$ vs. $y=200$) yield entirely different tokens, so the cross-entropy loss is misaligned with true spatial distance. Special quantized location tokens, on the other hand, inevitably introduce quantization error. Reducing this error requires linearly more tokens, but a larger vocabulary is harder to train and converges slower. We argue that both limitations stem from the formulation of spatial representation. To address this issue, we propose a simple yet novel localization representation method, HiLoc, which predicts locations in a coarse-to-fine manner with special tokens: first a grid index for coarse localization, then a cell index to refine the position within the grid. Under this paradigm, accuracy can be scaled up by simply adding the hierarchy level. We also build HiRef-500K, a dataset consisting negative and complex referring samples to strengthen rejection and complex referring ability. Experiments show that our method achieves strong performance on both detection and grounding benchmarks, especially on small objects, under high IOU thresholds and complex referring tasks.
BibTeX
@inproceedings{zhang2026hiloc,
  author = {Evelyn Zhang and Fufu Yu and Hanjun Li and Aoqi Wu and Ke Yan and Shouhong Ding and Tianhe Ren and Xinting Hu and Xiaojuan Qi and Li Jiang and Jiaya Jia},
  title = {{HiLoc: A Hierarchical Representation Method for Spatial Localization in Multimodal Large Language Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=V5T2vPmvxO},
}
Figure