This release is the Phase 3 endpoint, the version reported in the paper.
⚠️ Important: A naïve model.generate(...) will treat <latent> as
just another token and will not perform the hidden-state recurrence
inside <swi>...</swi> blocks. To run inference exactly as in the paper,
use the SWITCH inference loop in
src/model/coconut_swi_model.py,
which feeds the previous latent step's last-layer hidden state back as the
next input embedding and enforces the K_min minimum-dwell constraint
inside the latent block.
All numbers under matched data, decoding, and Qwen3-8B base-model settings.
See the paper §3 for the full method and §4–§5 for setup / results.
The boundary tokens make latent computation directly inspectable. Three
takeaways from the paper, all reproducible with
scripts/interpret_swi.py:
MIT.