Practical overview
When it fits
Use it when you want a code-level starting point for training and running TRM on your own dataset, rather than a hosted inference endpoint or finished end-user application.
Who it is for
- Developers experimenting with recursive reasoning models in Python.
- Researchers or practitioners who want to train a model on a PyTorch dataset and inspect iterative predictions.
Documented uses
- Construct a TRM model with a configurable example network.
- Train the model using a PyTorch dataset.
- Run prediction with limits on refinement steps and a halting threshold.
- Save the model state dictionary for later reuse.
Requirements & limits
The repository is public and lists an MIT license.
- The repository labels the implementation unofficial and links to a separate official TRM repository.
- The usage example relies on the developer to provide and configure a dataset; its mock data consists of random token sequences.
- The README demonstrates state saving but does not show how to load the saved state.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Train and run a TRM example
Follow the README's example workflow to construct a model, train it on a PyTorch dataset and request an iterative prediction.
Before you start
- Python environment with the tiny-recursive-model package installed.
- PyTorch.
- A dataset that supplies input and output pairs in the format used by the example.
Steps
Install the package with the command below.
pip install tiny-recursive-modelConstruct
TinyRecursiveModelwith anMLPMixer1Dnetwork, setting dimensions, token count, depth and sequence length.Pass a PyTorch dataset to
Trainer, configure epochs, batch size and CPU use, then call the trainer.Call
trm.predictwith an input tensor and setmax_deep_refinement_stepsandhalt_prob_thres.
Expected outcome
The example produces a predicted answer and exit indices after training the model.
Guide limitations
- The README's sample dataset generates random input and output tokens; it is illustrative rather than a task-specific dataset.
- The example does not document evaluation metrics or a production deployment workflow.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 8 October 2026
- Original website title
- lucidrains/tiny-recursive-model · Official homepage title · retained in its source language

