Path planning in complex environments is one of the key problems of artificial intelligence because it requires simultaneous understanding of the geometry of space and the global structure of the problem. In this paper, we explore the potential of using generative models as planning and reasoning mechanisms. We propose GenPlanner, an approach based on diffusion models and flow matching, along with two variants: DiffPlanner and FlowPlanner. We demonstrate the application of generative models to find and generate correct paths in mazes. A multi-channel condition describing the structure of the environment, including an obstacle map and information about the starting and destination points, is used to condition trajectory generation. Unlike standard methods, our models generate trajectories iteratively, starting with random noise and gradually transforming it into a correct solution. Experiments conducted show that the proposed approach significantly outperforms the baseline CNN model. In particular, FlowPlanner demonstrates high performance even with a limited number of generation steps.
Figures & tables
Figure 1: Qualitative comparison of ground-truth paths and FlowPlanner generations on grid mazes of different sizes ( 8×8 , 16×16 , 32×32 , 48×48 ). FlowPlanner generates trajectories consistent with reference paths, maintaining correctness and consistency even for larger mesh sizes.
Figure 2: Failure case of logical and spatial reasoning in a vision–language model. Given a maze image with start and goal locations, the VLM (Qwen) generates a plausible sequence of directional moves, yet the resulting path is invalid. This example highlights the difficulty of current VLMs in performing precise logical reasoning and grid-based path planning.
Figure 3: Overview of FlowPlanner training and inference. FlowPlanner treats path planning as a denoising process. A U-Net conditioned on walls and start-goal locations predicts velocity at each timestep, enabling iterative refinement from random noise to correct the route, where the pixel value > 0 is a path. DiffPlanner has a similar scheme where instead of operating on the velocity vector, the U-Net predicts noise.
Figure 4: Intermediate x^0,t Estimates for Diffusion (top) and Flow Models (bottom). For DiffPlanner, the path structure is formed gradually with subsequent denoising steps, while FlowPlanner produces coherent trajectory structures already at early integration steps, as the predicted velocity field directly guides the sample toward the final solution.
Grid size
Training samples
Evaluation samples
Min. path length
48×48
20,000
1,000
20
32×32
20,000
1,000
10
16×16
10,000
500
5
8×8
5,000
250
1
Table 1: Statistics of the generated datasets for different grid sizes.
Maze Size
Model
Validity (%) ↑
Single-Path (%) ↑
Length Ratio ↓
Branch-Rate (%) ↓
8 × 8
CNN
92.80
89.20
1.00
0.29
FlowPlanner
94.00
92.40
1.00
0.26
DiffPlanner
90.40
77.20
1.02
1.95
16 × 16
CNN
74.00
65.20
1.00
0.82
FlowPlanner
88.60
86.20
1.01
0.19
DiffPlanner
84.60
67.60
1.03
2.15
Table 2: Quantitative comparison of CNN, DiffPlanner, and FlowPlanner across different grid sizes. The best results are achieved by FlowPlanner, which leverages a learned vector field to guide the sample along a continuous trajectory toward the solution.
Figure 5: Qualitative comparison of paths generated by CNN, DiffPlanner, and FlowPlanner on 48×48 mazes.
Figure 6: Qualitative comparison of paths generated by CNN, DiffPlanner, and FlowPlanner on 32×32 mazes.
Config
Conditioning
Metrics
Start,End
Walls
Validity (%) ↑
Single-Path (%) ↑
Length Ratio ↓
Branch-Rate (%) ↓
1
✗
✗
0.00
33.70
N/A
0.18
2
✓
✗
6.40
6.30
1.06
0.03
3
✗
✓
0.10
73.30
1.00
0.22
Ours
✓
✓
88.00
86.10
1.02
0.09
Table 3: Quantitative ablation results for FlowPlanner different conditioning channel combinations on 48×48 mazes. Each condition channel is crucial for accurately generating the trajectory.
Figure 7: Qualitative comparison on FlowPlanner using different conditioning channel combinations on 48×48 mazes. For Start, End model knows where the path begins and ends, but the path is not valid. For Walls , the model doesn’t know where to go but can take obstacles into account. None means without conditioning. For Start, End, Walls , the model achieves the best path.
Model
Steps T
Validity ↑
Single-Path ↑
Length Ratio ↓
Branch-Rate ↓
FlowPlanner
50
88.00
86.10
1.02
0.09
30
87.70
85.50
1.02
0.10
20
86.40
84.60
1.02
0.10
10
85.80
83.00
1.02
0.15
5
79.10
75.90
1.01
0.14
1
23.70
20.40
1.00
0.65
Table 4: Impact of the number of sampling steps on the performance of FlowPlanner and DiffPlanner for 48×48 mazes. FlowPlanner is characterized by high stability regardless of the number of generation steps.
Diffusion-based planning generates diverse action sequences or trajectories by progressively denoising candidates conditioned on goals, scenes, and constraints.
Data Science & Artificial Intelligence Research Institute, China Unicom · Unicom Data Intelligence, China Unicom · School of Computer Science and Software Engineering, Southwest Petroleum University +2