Advanced video models have recently demonstrated remarkable zero-shot capabilities of visual reasoning, solving tasks like maze, symmetry, and analogy completion through a chain-of-frames (CoF) reasoning process.
This project shows that such CoF capability can be acquired by fine-tuning open-source video models like Wan2.2.
In the maze domain, the fine-tuned models—dubbed MiniVeo3-Reasoner—exhibit surprisingly strong visual reasoning performance, achieving near-perfect accuracy on in-distribution tests and robust out-of-distribution generalization.
Under controlled comparisons, MiniVeo3-Reasoner significantly outperforms baseline approaches that reason in other modalities such as text or images.
We further envision that this visual reasoning capability can be enhanced through reinforcement learning of video models.
method overview
🔥 News
🚩 2025.10: We are thrilled to release MiniVeo3-Reasoner, with mazes as a testbed for visual reasoning!
Exact Match (EM) measures whether the model successfully generates the complete and correct trajectory that aligns with the shortest optimal valid path.
Progress Rate (PR) measures the number of consecutively correct steps (valid forward moves) from the start to the number of steps in the optimal path.
MiniVeo3-Reasoner-Maze-5B
EM (%)
PR (%)
Maze 3x3
100
100
Maze 4x4
100
100
Maze 5x5
100
100
Maze 6x6
98.4
98.7
Maze 6x6 (OOD solution length)
53.6
59.7
Maze 7x7 (OOD size)
86.8
90.1
Maze 8x8 (OOD size)
60.4
67.8
Comparisons
Under the same amount of training data, we include performance metrics reported in Visual Planning for reference and comparison.
Our data generator produces a series of mazes with configurable size, path length and amount, outputting a .mp4 video file and a .png image (the first frame of the video).
We use a customized version of maze-dataset. You can install it as follows:
pip install -e data/maze/maze-dataset
After installation, use the script below to generate mazes with custom configurations:
python data/maze/maze_generator.py
To reproduce the same data distribution used in our experiments, simply run:
bash scripts/generate_maze_dataset.sh
The result will be in dataset/maze_train and dataset/maze_test respectively.
💡 The first run may take additional time to automatically download the base model files.
To perform inference on all test samples, simply run:
bash scripts/inference_maze_testset.sh
Success Evaluation
Our evaluator compares the predicted trajectory with the ground truth, computing the distance between the two paths.
We implement our own versions of Exact Match (EM) and Progress Rate (PR) metrics for video-based evaluation.
If your generated results are stored in dataset/maze_test and named properly, you can evaluate all test samples by running:
bash scripts/evaluate_maze.sh
Training Models
We train Wan2.2-TI2V-5B with LoRA, following the instructions provided in DiffSynth-Studio. You can easily fine-tune your own models using the same framework.
For your convenience, if you follow ours, you can copy the train dataset dataset/maze_train directly into DiffSynth-Studio/data/example_video_dataset.