Topo2Seq: Enhanced Topology Reasoning via Topology Sequence Learning

Yiming Yang, Yueru Luo, Bingkun He, Erlong Li, Zhipeng Cao, Chao Zheng, Shuqi Mei, Zhen Li

Introduction

For autonomous vehicles to navigate safely without relying on pre-existing high-definition (HD) maps, they must possess the ability to perceive and interpret the road network in real-time. This involves more than just identifying lane boundaries; it requires understanding the "topology" of the scene—how lanes merge, split, and connect at complex intersections.

Topo2Seq is a novel framework that treats road network topology as a sequence modeling problem. By introducing a topology sequence decoder during the training phase, the model learns the underlying "grammar" of road structures, leading to superior spatial reasoning and precise endpoint alignment without sacrificing real-time inference speeds.

The Limitations of Current Approaches

Most state-of-the-art online mapping models utilize Detection Transformer (DETR) frameworks. While effective at identifying individual objects, these models face two significant hurdles in topology reasoning:

  1. Unordered Nature: DETR-like models treat lane segments as an independent set of queries. This lack of inherent order often results in "endpoint misalignment," where the end of one predicted lane segment fails to connect precisely with the start of the next.
  2. Weak Long-Range Perception: Because these models focus on local queries, they often struggle to capture the global context of complex intersections or long, winding road geometries.

Topo2Seq addresses these issues by arguing that road connectivity is inherently sequential and contextual, much like the relationship between words in a sentence.

Methodology: Bridging Geometry and Sequence

Topo2Seq utilizes a dual-decoder architecture designed to bridge the gap between geometric detection and sequential reasoning.

1. Lane Segment Decoder

This is a standard DETR-style decoder that operates on Bird’s-Eye View (BEV) features. It predicts lane geometries (coordinates) and generates an adjacency matrix to represent local connections.

2. Topology Sequence Decoder

Inspired by Large Language Models (LLMs), this decoder represents the lane graph as a sequence of tokens extracted from a Directed Acyclic Graph (DAG). This component is the "secret sauce" of the framework, forcing the model to understand the logical flow of the road network.

3. Randomized Order Prompt-to-Sequence Learning

During training, the model employs a unique "Prompt-to-Sequence" strategy. It takes the unordered key points predicted by the first decoder and uses them as "prompts." The sequence decoder is then tasked with reconstructing an ordered, complete lane graph from these prompts. This process acts as a powerful regularizer, compelling the network to produce more stable and better-aligned geometric predictions so that the sequence decoder can successfully reconstruct the topology.

4. Asymmetric Learning for Efficiency

Crucially, the topology sequence decoder is only used during training. It acts as a teacher that refines the BEV features and the primary decoder's weights. During inference, the sequence decoder is discarded. This allows the model to benefit from the complex relational reasoning of auto-regressive modeling without the computational overhead, maintaining high frame rates.

Experimental Results

The model was evaluated on OpenLane-V2, the most rigorous benchmark for scene structure and topology reasoning, which incorporates data from Argoverse 2 and nuScenes.

Performance Metrics

Topo2Seq achieved state-of-the-art (SOTA) results across several key metrics on the OpenLane-V2 subset-A:

  • Lane Segment mAP: Reached 37.7%, a 1.3% improvement over previous leaders like LaneSegNet.
  • Topology Score (TOP): Achieved 29.9%, marking a significant 2.6% jump in connectivity logic accuracy.
  • Centerline Perception: Outperformed existing methods like TopoMLP and MapTRv2 on the OpenLane Score (OLS).

Real-Time Viability

Despite the added complexity during training, Topo2Seq maintains an inference speed of 14.7 FPS on an NVIDIA A100. This makes it a viable candidate for integration into real-time autonomous driving stacks.

Conclusion and Future Work

Topo2Seq demonstrates that modeling road networks as a sequence allows for a deeper understanding of road "syntax." By using a sequence decoder as a training-time supervisor, the model achieves cleaner intersections and more accurate lane forks than previous set-prediction methods.

While the current model is limited by a fixed sequence length (802 tokens), which may struggle with extremely dense multi-level interchanges, it opens the door for future research. The authors suggest that this "prompt-to-sequence" approach could eventually be extended to other map elements, such as associating traffic lights with specific lanes or determining the topology of pedestrian crosswalks.

Summary updated

BibTeX
@inproceedings{yang2025topo,
  author = {Yiming Yang and Yueru Luo and Bingkun He and Erlong Li and Zhipeng Cao and Chao Zheng and Shuqi Mei and Zhen Li},
  title = {{Topo2Seq: Enhanced Topology Reasoning via Topology Sequence Learning}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i9.33009},
}
Figure