---
title: 'MambaMap: Online Vectorized HD Mapping'
url: https://www.emergentmind.com/topics/mambamap
type: topic
---

# MambaMap: Online Vectorized HD Mapping

Searching arXiv for the MambaMap paper and closely related Mamba-based spatial mapping work.
MambaMap is an online vectorized HD map construction framework for autonomous driving that uses state space modeling to fuse long-range temporal information from surround-view camera streams while maintaining online operation [2507.20224]. Its stated goal is to infer vectorized map elements directly from onboard images in real time, rather than relying on expensive offline SLAM pipelines. The framework operates in bird’s-eye-view (BEV) space, maintains a restricted memory bank of historical BEV features and instance queries, and performs temporal fusion at both the dense spatial level and the instance-query level. In the reported formulation, the evaluated map classes are lane dividers, pedestrian crossings, and road boundaries, and the framework is motivated by the need to improve robustness against occlusion, noisy observations, and extended perception range [2507.20224].

## 1. Problem formulation and scope

MambaMap addresses **online vectorized HD map construction** from multi-view camera imagery for autonomous driving [2507.20224]. The target representation is explicitly vectorized rather than rasterized, and the outputs correspond to map instances with class labels and regressed polyline point coordinates. The reported classes are **lane dividers**, **pedestrian crossings**, and **road boundaries** [2507.20224].

The paper situates the method in a standard camera-only mapping pipeline: multi-view images are processed by an image backbone and feature pyramid network, transformed into a **bird’s-eye-view (BEV)** representation, and then decoded using **DETR-style map queries** [2507.20224]. The central claim is that single-frame map construction is limited by **occlusions**, **long-range perception challenges**, and **noisy observations**, whereas temporal integration can recover structures that are weakly visible or fully occluded in the current frame [2507.20224].

The method is explicitly designed to avoid two limitations attributed to prior temporal HD mapping systems. First, some earlier methods propagate only a **single recurrent hidden feature**, which the paper argues is too limited for rich long-range temporal dependencies. Second, more direct history processing can create substantial memory and computation cost, reducing suitability for real-time deployment [2507.20224]. This motivates the use of a **state space model (SSM)** together with a **restricted memory bank**, with the intended effect of capturing long-range temporal structure more efficiently than transformer-style temporal attention.

A plausible implication is that MambaMap belongs to a broader class of Mamba-inspired dense spatial prediction systems in which efficient long-range dependency modeling is introduced at intermediate representation levels rather than by replacing the entire perception stack. Related Mamba-based work in dense spatial reconstruction and segmentation adopts a similar logic in radio map construction and high-resolution remote sensing segmentation [2508.09140], [2408.11545].

## 2. Architectural organization

MambaMap separates temporal fusion into two coupled stages: **BEV Mamba Fusion (BMF)** for dense spatial features and **Instance Mamba Fusion (IMF)** for decoded map queries [2507.20224]. At time step \(t\), the pipeline is described as follows:

1. input surround-view images;
2. extract image features with a backbone and FPN;
3. lift them into an initial BEV representation \(\mathbf{F}_t\);
4. fuse current and historical BEV features through BMF to obtain refined BEV \(\mathbf{F}'_t\);
5. decode map instances using a Deformable-DETR-style map decoder to obtain \(\mathbf{Q}_t\);
6. fuse current and historical instance queries through IMF to obtain refined queries \(\mathbf{Q}'_t\);
7. apply classification and regression heads to predict categories and polyline point coordinates;
8. update the memory bank with \(\mathbf{F}'_t\) and \(\mathbf{Q}'_t\) [2507.20224].

The implementation details reported in the paper instantiate this pipeline with **ResNet-50** as backbone, **FPN** as image neck, **BEVFormer** as BEV encoder, and a **Deformable DETR-based decoder** as map decoder [2507.20224]. The query feature dimension is given as \(D=512\), the BEV spatial dimensions as \(H=50\), \(W=100\), and the number of queries appears intended as \(N_q=100\) [2507.20224].

Although the title uses “MambaMap,” the paper later states that the state-space operator used inside the gated temporal block is actually **DSS (Diagonal State Spaces)**, selected because it performed best in ablation [2507.20224]. This is important for terminology: the framework is Mamba-inspired in its use of efficient state-space temporal fusion, gating, and scan-based sequence construction, but its best-performing reported instantiation is DSS-based rather than vanilla Mamba or Mamba-2.

## 3. Memory bank and BEV-level temporal fusion

The memory bank has two components,
\[
\mathbf{M}_t = \{\mathbf{M}_t^{BEV}, \mathbf{M}_t^{Ins}\},
\]
with
\[
\mathbf{M}_t^{BEV} = \{\mathbf{F}'_{t-N}, \mathbf{F}'_{t-N+1}, \dots, \mathbf{F}'_{t-1}\},
\]
and
\[
\mathbf{M}_t^{Ins} = \{\mathbf{Q}'_{t-N}, \mathbf{Q}'_{t-N+1}, \dots, \mathbf{Q}'_{t-1}\},
\]
where \(N\) is the memory size [2507.20224]. The bank is explicitly **size-restricted**, and the reported best value is \(N=4\) [2507.20224]. The paper argues that overly long history introduces redundancy and noise, whereas a short window retains the most relevant recent context.

For BEV fusion, historical BEV features are first aligned to the current ego frame:
\[
\mathbf{\widetilde{M}_t^{BEV} = \left\{ \text{Warp}(\mathbf{F}'_{t-k}, \mathbf{T}_{t-k \to t}) \mid k \in \{1,2,\dots,N\} \right\},
\]
where \(\mathbf{T}_{t-k \to t}\) is the \(4\times4\) ego-motion transformation [2507.20224]. These aligned features are concatenated with the current BEV feature,
\[
\mathbf{F}_c = \text{Concat}(\mathbf{\widetilde{M}_t^{BEV}, \mathbf{F}_t),
\]
then projected by a convolution and normalized:
\[
\mathbf{F}_f = \text{LayerNorm}(\text{Conv}(\mathbf{F}_c)).
\]
This fused BEV tensor is then converted into sequences by four directional scans,
\[
\mathbf{S} = \left\{ \mathbf{S}_i \mid i \in \{\text{left}, \text{right}, \text{up}, \text{down}\} \right\}, \qquad
\mathbf{S}_i \in \mathbb{R}^{S_L \times C}, \quad S_L = H\cdot W,
\]
so that the state-space block can process directional road geometry and elongated structures in BEV space [2507.20224].

Each directional sequence is passed through a gated state-space block. The gate branch is
\[
\mathbf{V}_i = \text{GELU}(\mathbf{W}_v(\mathbf{S}_i)),
\]
and the SSM branch is
\[
\mathbf{U}_i = \text{GELU}(\mathbf{W}_u(\mathbf{S}_i)), \qquad
\mathbf{Y}_i = \text{DSS}(\mathbf{U}_i).
\]
After projection,
\[
\mathbf{U}_i' = \mathbf{W}_y(\mathbf{Y}_i),
\]
the final directional output is
\[
\mathbf{O}_i = \mathbf{W}_o(\mathbf{U}_i' \odot \mathbf{V}_i) + \mathbf{S}_i.
\]
The paper interprets this gating mechanism as a way to suppress less relevant context and emphasize useful long-range dependencies while remaining computationally lighter than attention [2507.20224]. The outputs from the four directions are reshaped back into BEV feature maps and averaged to obtain the refined BEV representation \(\mathbf{F}'_t\).

## 4. Instance-query temporal fusion

Instance Mamba Fusion operates after the map decoder and is intended to stabilize vectorized map instances over time [2507.20224]. The current decoder outputs
\[
\mathbf{Q}_t \in \mathbb{R}^{N_q \times D},
\]
while the memory bank stores past refined query sets \(\mathbf{Q}'_{t-k}\) [2507.20224].

Because query identities are not inherently aligned across frames, MambaMap first matches historical and current queries using squared \(L_2\) distance,
\[
d(\mathbf{q}_n^{(t-k)}, \mathbf{q}_m) = \|\mathbf{q}_n^{(t-k)} - \mathbf{q}_m\|_2^2,
\]
and uses the Hungarian algorithm to find a permutation
\[
\pi_{t-k \to t} = \arg\min_{\pi \in \Pi_{N_q} \sum d(\mathbf{q}_n^{(t-k)}, \mathbf{q}_m).
\]
Historical queries are then reordered:
\[
\mathbf{\widetilde{M}_t^{Ins} = \left\{ \text{Permute}(\mathbf{Q}'_{t-k}, \mathbf{\pi}_{t-k \to t}) \mid k \in \{1,2,\dots,N\} \right\}.
\]
The paper emphasizes that this is done **without additional temporal supervision** [2507.20224].

Two complementary sequence organizations are then constructed. The **Instance-First Sequence** is
\[
\mathbf{H}_s \in \mathbb{R}^{I_L \times D}, \qquad I_L = (N+1)\cdot N_q,
\]
and the **Temporal-First Sequence** is
\[
\mathbf{H}_t \in \mathbb{R}^{T_L \times D}, \qquad T_L = N_q \cdot (N+1).
\]
The first ordering emphasizes within-frame spatial interactions among instances, whereas the second emphasizes temporal continuity of query slots across frames [2507.20224]. Both are processed by the same style of gated state-space block used in BMF, and the features corresponding to the current frame are split and aggregated into refined instance queries \(\mathbf{Q}'_t\). The exact aggregation operator between the two streams is not explicitly specified in the paper [2507.20224].

This dual-order design is one of the method’s characteristic features. It encodes the view that temporal consistency in vectorized HD mapping is not reducible to either pure BEV feature recurrence or pure instance-slot tracking; instead, it depends on both scene-level completion and query-level stabilization.

## 5. Training, inference, and empirical results

The overall map loss is
\[
L_{\text{map} = \lambda_1 L_{\text{pts} + \lambda_2 L_{\text{cls},
\]
where \(L_{\text{pts}}\) is a polyline-wise matching cost using **Smooth \(L_1\)** loss and \(L_{\text{cls}}\) is a classification cost using **Focal loss**. The weights are
\[
\lambda_1 = 5.0, \qquad \lambda_2 = 50.0.
\]
The paper further states that both the original decoder queries and the fused queries are supervised by these losses, following Hungarian matching in the style of StreamMapNet [2507.20224].

Training uses **2 NVIDIA A30 GPUs**, **batch size 8**, **AdamW**, and learning rate \(2.5\times10^{-4}\) [2507.20224]. The optimization is staged: single-frame training is performed first, followed by temporal training on consecutive sequences. Memory-bank features are **detached**, so gradients do not backpropagate into historical frames [2507.20224]. Online inference proceeds with fixed recent history only, updating the memory bank frame by frame.

The method is evaluated on **nuScenes** and **Argoverse2**, with three classes—pedestrian crossing, lane divider, and road boundary—under two perception ranges: **\(60\times30\) m** and **\(100\times50\) m** [2507.20224]. The metric is **Average Precision (AP)** per class and **mAP** over classes, using distance thresholds \(\{0.5,1.0,1.5\}\) m for the small range and \(\{1.0,1.5,2.0\}\) m for the large range [2507.20224].

On the **nuScenes original split**, MambaMap reports:
- **small range \(60\times30\) m**: AP\(_{ped}\) **66.6**, AP\(_{div}\) **68.0**, AP\(_{bou}\) **67.2**, mAP **67.3**, FPS **12.7**;
- **large range \(100\times50\) m**: AP\(_{ped}\) **68.7**, AP\(_{div}\) **67.8**, AP\(_{bou}\) **62.9**, mAP **66.5** [2507.20224].

On the **Argoverse2 original split**, it reports:
- **small range \(60\times30\) m**: AP\(_{ped}\) **65.4**, AP\(_{div}\) **61.1**, AP\(_{bou}\) **68.3**, mAP **64.9**, FPS **13.6**;
- **large range \(100\times50\) m**: AP\(_{ped}\) **68.6**, AP\(_{div}\) **56.1**, AP\(_{bou}\) **57.5**, mAP **60.7** [2507.20224].

The paper also reports geographically disjoint splits. On the **nuScenes new split**, MambaMap achieves AP\(_{ped}\) **40.2**, AP\(_{div}\) **33.4**, AP\(_{bou}\) **46.6**, mAP **40.1**; on the **Argoverse2 new split**, it achieves AP\(_{ped}\) **59.4**, AP\(_{div}\) **58.4**, AP\(_{bou}\) **65.2**, mAP **61.0** [2507.20224]. These results are presented as evidence of improved generalization to unseen geography.

## 6. Ablations, interpretation, and broader context

The ablations show that both temporal fusion stages matter. Starting from a baseline without streaming strategy at **61.5 mAP**, adding **BMF only** yields **65.2 mAP**, adding **IMF only** yields **63.7 mAP**, and using **BMF + IMF** yields **67.3 mAP** [2507.20224]. The BEV scan ablation reports **64.9** for single direction, **66.1** for horizontal bidirectional, **66.3** for vertical bidirectional, and **67.3** for the reported four-direction multi-directional scan [2507.20224]. At the instance level, **spatial only** gives **66.4**, **temporal only** gives **66.6**, and **spatial-temporal** gives **67.3** [2507.20224]. These results support the paper’s claim that dense spatial completion and instance-level temporal consistency are complementary.

The SSM comparison is especially notable: **S4** gives **64.6**, **DSS** gives **67.3**, **Mamba** gives **65.3**, and **Mamba-2** gives **65.2** [2507.20224]. This indicates that the framework’s gains derive less from adherence to a specific branded SSM and more from the overall design of **gated state-space temporal fusion**, **restricted memory**, and **task-specific scan strategies**. The memory-bank ablation likewise favors moderate history: \(N=1\) gives **66.6**, \(N=2\) gives **67.1**, \(N=4\) gives **67.3**, and \(N=6\) drops to **66.5** [2507.20224].

The paper presents MambaMap as an efficient alternative to transformer temporal fusion, but the reported runtime numbers show a more specific picture. On one A30 GPU, **MambaMap** reaches **12.7 FPS** on nuScenes and **13.6 FPS** on Argoverse2 at \(60\times30\) m, compared with **14.9/15.9 FPS** for StreamMapNet and **14.4/15.4 FPS** for SQD-MapNet [2507.20224]. Thus, the method remains in a practical real-time range, but it is not the fastest among the compared streaming baselines. A plausible implication is that its primary advantage lies in improved temporal fusion quality rather than raw throughput.

Within the broader Mamba literature, MambaMap is a concrete example of using scan-based state-space modeling for structured spatial prediction under temporal constraints. Related Mamba-based work has applied comparable global-local design logic to radio map construction, where a hybrid Mamba-UNet captures long-range spatial propagation with linear complexity [2508.09140], and to remote sensing semantic segmentation, where a UNet-like decoder uses Mamba selective scan to handle high-resolution scenes efficiently [2408.11545]. This suggests that MambaMap belongs to a wider methodological family in which Mamba-style sequence operators are used not as generic replacements for convolution or attention, but as targeted mechanisms for efficient long-range dependency modeling in spatially structured outputs.

The main limitation that can be stated directly from the paper is that some design details remain under-specified: the exact aggregation of the two IMF streams is not given in equation form, exact temporal consistency metrics are not separately quantified, and the best-performing operator is DSS rather than Mamba or Mamba-2 [2507.20224]. Nevertheless, the reported evidence supports a stable characterization of MambaMap as a two-level temporal fusion framework for online vectorized HD map construction, built around a restricted memory bank, gated state-space processing, and specialized BEV and instance scanning strategies.

Source: https://www.emergentmind.com/topics/mambamap