C++ reference for our paper Thoughts-as-Planning — a latent state encoder, transition model, reward head, and a planning loop over text edits (toy src/main.cpp).
- C++17 compiler
- Eigen3
Make. Put Eigen under third_party/eigen3-src (see command below) or set EIGEN3_INC to your Eigen include root.
git clone --depth 1 -b 3.4.0 \
https://gitlab.com/libeigen/eigen.git third_party/eigen3-src
makeBinary: bin/tap_run.
CMake (fetches Eigen):
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build./bin/tap_run # if built with make
# or
./build/tap_run # if built with cmake (location may vary)include/tap/— headers (encoder, transition, reward, planner, training)src/— implementations and demo entrypoint
D. Liu, Y. Yu, and Y. N. Wu, Thoughts-as-Planning: Latent World Models for Chain-of-Thoughts Optimization via Reinforcement Planning, 2026.
@article{liu2026thoughtsasplanning,
title = {Thoughts-as-Planning: Latent World Models for Chain-of-Thoughts Optimization via Reinforcement Planning},
author = {Liu, Dong and Yu, Yanxuan and Wu, Ying Nian}
}