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
@article{liu2026thoughtsasplanninglatentworldmodels,
title={Thoughts-as-Planning: Latent World Models for Chain-of-Thoughts Optimization via Reinforcement Planning},
author={Dong Liu and Yanxuan Yu and Ying Nian Wu},
year={2026},
eprint={2605.28842},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2605.28842},
}