Manuscript Offprint

arXiv:2610.01905

MapLightning: Online Vectorized HD Map Construction with 1D Map Tokens

Shen Zheng, Anurag Ghosh, Mani Ramanagopal, Srinivasa Narasimhan

ABSTRACT

Online vectorized HD map construction is essential for scaling safe autonomous driving and requires accurate, real-time inference. Prior methods typically rely on dense bird's-eye-view (BEV) grids as the intermediate representation. We propose MapLightning, which replaces the dense BEV grid with a compact set of 1D learnable map tokens. To construct map tokens from image features, we choose self-attention over vanilla cross-attention because it enables joint interactions and contextual aggregation among image and map tokens. Our transformer-based mapper concatenates map and image tokens, applies full self-attention, discards the image tokens, and retains the updated map tokens for decoding. This design offers three advantages. First, our representation is efficient, using fewer tokens, consuming less memory, and running faster. Second, the lightweight design allows the map decoder to use full rather than deformable cross-attention for better global context. Third, unlike BEV-based methods, our network does not use camera projection parameters, making it robust to camera-extrinsic perturbations. MapLightning uses up to 16.7×16.7\times fewer intermediate tokens than dense BEV-based methods and achieves state-of-the-art accuracy and efficiency on nuScenes and Argoverse 2. Its lightweight variant surpasses MapTRv2 by +10.1 mAP on nuScenes and +16.2 mAP on Argoverse 2, while delivering 1.73×1.73\times faster inference (40+ FPS) with 53% less memory. We further show improvements on uncertainty-aware map construction and downstream trajectory prediction. Code and models will be released.

1 INTRODUCTION

High-definition (HD) maps provide centimeter-level vectorized representations of static road elements such as lane dividers, pedestrian crossings, and road boundaries. These elements encode road topology and driving constraints essential for autonomous navigation. Traditionally, HD maps are constructed offline using SLAM- or SfM-based pipelines (Zhang et al., 2014; Shan & Englot, 2018; Zhanabatyrova et al., 2024), requiring expensive annotation and maintenance.

Recently, online vectorized HD map construction (Liao et al., 2022; Yuan et al., 2024; Chen et al., 2024; Liao et al., 2025; Dong et al., 2025; Monninger et al., 2026) has gained popularity by building local maps at runtime from onboard sensors, reducing reliance on costly offline map construction and maintenance. Online vectorized HD map construction methods typically follow a three-stage pipeline: an image encoder extracts features from surround-view images, a bird's-eye-view (BEV) projection module such as LSS (Philion & Fidler, 2020) or BEVFormer (Li et al., 2024b) projects them into a dense BEV grid, and a DETR-style (Carion et al., 2020) decoder with deformable attention (Zhu et al., 2020) predicts map elements as ordered point sets.

The BEV-based design is effective for dense spatial perception tasks like semantic segmentation (Philion & Fidler, 2020; Zhou & Krähenbühl, 2022) and 3D occupancy prediction (Yu et al., 2023; Hou et al., 2024), where dense spatial prediction naturally aligns with the BEV grid. However, it is less suited for vectorized map prediction, where the output is a sparse set of vectorized map elements that occupy only 4.27% of the rasterized perception range on nuScenes (Caesar et al., 2020) and 2.65% on Argoverse 2 (Wilson et al., 2023).

In this paper, we propose to use 1D learnable tokens, which we call map tokens, as the intermediate scene representation. This design offers three key advantages. (i) Our representation uses fewer intermediate tokens, consumes less memory, and runs faster. (ii) The lightweight design allows the

Figure

(a) Dense BEV Projection

Figure

(b) Cross-Attention

Figure

(c) Self-Attention

Figure 1: Aggregating multi-view image tokens into a scene representation. (a) BEV-based methods (Liao et al., 2022; 2025) geometrically project image features onto a dense grid of fixed BEV cells, few of which contain map elements. (b) Vanilla cross-attention compresses image tokens into compact map tokens, but image tokens serve only as fixed keys and values, with no image-to-image or map-to-map interaction. (c) Self-attention (ours, Section 3.3) attends over the concatenated map and image tokens, refining all tokens jointly. Gray and violet edges denote image–map and intra-group attention, respectively. In the masks, rows are queries, columns are keys/values, shaded cells mark allowed attention, and M/I denote map/image tokens. See Table 1 for comparison.

map decoder to use full attention instead of deformable attention, giving each query access to the entire representation for better global context and long-range dependencies. (iii) Unlike BEV-based methods, ours does not use camera projection parameters, making it robust to extrinsic perturbations.

Constructing map tokens requires compressing a large number of multi-view image tokens into a much smaller set, and the choice of compression mechanism is critical. Specifically, we concatenate map and image tokens and apply attention over the joint sequence. As shown in Figure 1, we adopt self-attention instead of vanilla cross-attention, since vanilla cross-attention only lets map tokens read from image tokens, whereas self-attention also allows explicit image-to-image and map-to-map token interactions for richer contextual aggregation. The image-to-image interactions are particularly useful for refining visual context: as illustrated in Figure 3, self-attention progressively concentrates on map-relevant structures across layers. After the final mapper layer, the image tokens are discarded, leaving compact map tokens that retain the aggregated map-relevant information. These map tokens serve as the intermediate representation for the decoder. In the decoder, cross-attention is used because the map queries act as output slots that read from the fixed map-token representation, similar to decoding objects (Carion et al., 2020) or categories (Strudel et al., 2021).

We name our framework MapLightning for its fast inference, token-efficient design, and high accuracy. By replacing the dense BEV grid with a compact set of tokens (up to 16.7×16.7 \times fewer), MapLightning achieves state-of-the-art accuracy and efficiency on nuScenes and Argoverse 2. With a lightweight MobileNetV3-Large backbone, it surpasses MapTRv2 (Liao et al., 2025) by +10.1 and +16.2 mAP on nuScenes and Argoverse 2, running 1.73×1.73 \times faster (40+ FPS) with 53% less memory.

In summary, the main contributions of this paper are:

• We propose MapLightning, the first online vectorized HD map construction framework that replaces dense BEV projection with attention-based mapping into compact 1D map tokens, yielding higher efficiency, better global context, and robustness to extrinsic perturbations.

• We compare cross-attention and self-attention for constructing map tokens from image features, and show that self-attention is more effective for online vectorized HD map construction.

• MapLightning outperforms prior methods on online vectorized HD map construction, uncertainty-aware map construction, downstream trajectory prediction, and 3D object detection.

References (80)

  • a visual language model for few-shot learning
  • Layer Normalization
  • Memory transformer (opens arXiv in a new tab)
  • nuscenes: A multimodal dataset for autonomous driving
  • End-to-end object detection with transformers
  • Maptracker: Tracking with strided memory fusion for consistent vector hd mapping
  • Adapting language models to compress contexts
  • Flashattention: Fast and memory-efficient exact attention with io-awareness
  • Vision transformers need registers
  • Imagenet: A large-scale hierarchical image database
  • Bert: Pre-training of deep bidirectional transformers for language understanding
  • Damap: Distance-aware mapnet for high quality hd map construction
  • An image is worth $16 \times 16$ words: Transformers for image recognition at scale
  • Stur3d: Spatio-temporal unified representation learning for 3d object detection
  • Adaptive token sampling for efficient vision transformers
  • Producing and leveraging online map uncertainty in trajectory prediction
  • Exploring recurrent long-term temporal fusion for multi-view 3d perception
  • Deep residual learning for image recognition
  • Fastocc: Accelerating 3d occupancy prediction by fusing the 2d bird's-eye view and perspective view
  • Perceiver: General perception with iterative attention
  • A general architecture for structured inputs & outputs
  • unlocking the potential of sparse representations for hd map construction
  • Lvsm: A large view synthesis model with minimal 3d inductive bias (opens arXiv in a new tab)
  • Unveiling the hidden: Online vectorized hd map construction with clip-level token interaction and propagation
  • Blip-2: Bootstrapping language-image pre-training with frozen image encoders and large language models
  • Bevdepth: Acquisition of reliable depth for multi-view 3d object detection
  • Bevnext: Reviving dense bev frameworks for 3d object detection
  • Bevformer: learning bird's-eye-view representation from lidar-camera via spatiotemporal transformers
  • Maptr: Structured modeling and learning for online vectorized hd map construction (opens arXiv in a new tab)
  • Maptrv2: An end-to-end framework for online vectorized hd map construction
  • Localization is all you evaluate: Data leakage in online mapping datasets and how to fix it
  • Microsoft coco: Common objects in context
  • Sparse4d v2: Recurrent temporal fusion with sparse model (opens arXiv in a new tab)
  • Sparsebev: High-performance sparse 3d object detection from multi-camera videos
  • Vectormapnet: End-to-end vectorized hd map learning
  • Object-centric learning with slot attention
  • Decoupled Weight Decay Regularization
  • Pseudomap-trainer: Learning online mapping without hd maps
  • Maprf: Weakly supervised online hd map construction via nerf-guided self-training (opens arXiv in a new tab)
  • Augmapnet: Improving spatial latent structure via bev grid augmentation for enhanced vectorized online hd map construction
  • Learning to compress prompts with gist tokens
  • Lift, splat, shoot: Encoding images from arbitrary camera rigs by implicitly unprojecting to 3d
  • Dynamicvit: Efficient vision transformers with dynamic token sparsification
  • On the pitfalls of heteroscedastic uncertainty estimation with probabilistic neural networks (opens arXiv in a new tab)
  • Lego-loam: Lightweight and ground-optimized lidar odometry and mapping on variable terrain
  • Memfusionmap: Working memory fusion for online vectorized hd map construction
  • Segmenter: Transformer for semantic segmentation
  • Freqpde: Rethinking positional depth embedding for multi-view 3d object detection transformers
  • Sparo: Selective attention for robust and compositional transformer encodings for vision
  • Exploring object-centric temporal modeling for efficient multi-view 3d object detection
  • Efficient and robust multi-camera 3d object detection in bird-eye-view
  • Benjamin Wilson, William Qi, Tanmay Agarwal, John Lambert, Jagjeet Singh, Siddhesh Khandelwal, Bowen Pan, Ratnesh Kumar, Andrew Hartnett, Jhony Kaesemodel Pontes, et al. Argoverse 2: Next generation datasets for self-driving perception and forecasting. arXiv preprint arXiv:2301.00493, 2023. 1, 6 (opens arXiv in a new tab)
  • On layer normalization in the transformer architecture
  • Towards efficient and effective multi-camera encoding for end-to-end driving (opens arXiv in a new tab)
  • Mambamap: Online vectorized hd map construction using state space model
  • A-vit: Adaptive tokens for efficient vision transformer
  • Flashocc: Fast and memory-efficient occupancy prediction via channel-to-height plugin (opens arXiv in a new tab)
  • Streammapnet: Streaming mapping network for vectorized online hd map construction
  • Structure from motion-based mapping for autonomous driving: practice and experience
  • Lidar odometry and mapping in real-time
  • Generative relightable radiance for large reconstruction models
  • Cross-view transformers for real-time map-view semantic segmentation
  • Deepvit: Towards deeper vision transformer (opens arXiv in a new tab)
  • Hivt: Hierarchical vector transformer for multi-agent motion prediction
  • Deformable DETR: Deformable Transformers for End-to-End Object Detection
  • Self-attention produces higher-quality and more consistent vectorized map reconstructions, with fewer spurious elements, more complete map geometries, and better-preserved intersection geometry
  • VectorMapNet, MapTracker, and AugMapNet results are taken from their original papers, and MapTR and StreamMapNet results are from Yuan et al
  • As discussed in Section 4.1 in the main paper, substantial train–val geographic overlap allows models to encounter the same static map regions during training and evaluation
  • With a ResNet-18 backbone, ours surpasses MapTRv2 by +7.3 mAP on nuScenes and +11.5 mAP on Argoverse 2, and the cross-attention variant by +6.3 and +7.1 mAP, respectively
  • >Method</td><td colspan=
  • For downstream trajectory prediction, ours with self-attention achieves the best minADE, minFDE, and MR across both backbones
  • Ours with self-attention surpasses both the cross-attention variant and MapTRv2 on both map construction and downstream trajectory prediction across both image backbones
  • Even compared with the recent state-of-the-art STUR3D (Fan et al., 2026), ours improves +0.5 NDS and +1.2 mAP, while achieving lower errors across all five nuScenes metrics: mATE, mASE, mAOE, mAVE, and mAAE
  • We compare MapTRv2 with ours across different backbones, intermediate token counts, and numbers of mapper layers
  • Table 11 examines the effect of token count and mapper depth on accuracy
  • Our final configuration of 1.2k tokens, 4 mapper layers, and 4 timesteps (current frame + 3 past frames) achieves the best accuracy across configurations
  • Following MapTRv2 (Liao et al., 2025), we evaluate robustness to camera extrinsic perturbations by independently adding zero-mean Gaussian noise with varying standard deviations to the rotation and translation components of the camera extrinsics
  • Unlike the single-frame MapTRv2 (Liao et al., 2025) setting, we use T = 4 timesteps and 50 map tokens per camera per timestep, yielding 1.2k map tokens for nuScenes (6 cameras) and 1.4k for Argoverse 2 (7 cameras)
  • Input images are resized by a factor of 0.5 on nuScenes (1600×900 to 800×450) and, after padding to 2048×2048, by a factor of 0.3 on Argoverse 2
  • Unlike BEVFormer v2, which also fuses future frames and uses first-stage perspective proposals as hybrid object queries, we use only past frames (4-frame input, adjacent frames 0.5 s apart) and learned object queries