Tiny Recursive Model
Dec 2025 – Jan 2026

Tiny Recursive Model

A recursive language model that can solve complex tasks by breaking them down into simpler subtasks.

PythonPyTorchJupyter Notebook

Overview

Tiny Recursive Model (TRM) is a compact experiment in building a reasoning-first system rather than a brute-force solver. The goal was to create a minimal, interpretable model that can solve Sudoku puzzles using structured logic instead of relying on heavy computation or opaque heuristics. It sits somewhere between a classical algorithm and a learning system, designed to be understandable, hackable, and lightweight.

Problem

Most Sudoku solvers fall into two extremes. They are either:

  • brute-force engines that prioritise speed over explainability, or
  • large ML models that feel excessive for a constrained, rule-based problem

This project addresses a simpler need: a solver that demonstrates how a solution is reached. The intent was educational as much as functional, making the reasoning process visible and reproducible without requiring significant compute or complex infrastructure.

Solution

The TRM is structured around recursive reasoning steps that progressively narrow down valid possibilities in the grid. Instead of guessing early, it prioritises constraint propagation and logical elimination.

Design decisions were guided by three constraints:

  • keep the model small enough to run anywhere
  • ensure each step is interpretable
  • avoid overengineering the pipeline

Customisation is straightforward. The dataset can be swapped, reasoning depth can be tuned, and the solving behaviour can be extended with additional heuristics. The architecture intentionally avoids tight coupling, so components like data handling, training, and inference remain easy to modify.

From a usability standpoint, the interface was kept simple. Input is a plain text grid, output is a solved grid. No UI complexity, just a clean pipeline from puzzle to solution.

Developer Notes

This project was built iteratively, with most time spent refining the balance between “smart enough” and “simple enough.” Early versions leaned too heavily on recursion and became inefficient. Later revisions focused on pruning the search space earlier using basic logical rules, which significantly improved performance without adding complexity.

Running the project is intentionally low friction:

  • clone the repository
  • install dependencies
  • run the notebook to train and test
  • use the CLI script for inference

Testing was done on standard Sudoku datasets, but also with edge cases like nearly empty grids to stress the reasoning logic. One practical lesson was that even small inefficiencies in recursive systems compound quickly, so optimisation at the logic level mattered more than hardware.

Extending the project is straightforward. Possible directions include:

  • adding more advanced solving heuristics
  • visualising intermediate reasoning steps
  • adapting the approach to other constraint-based puzzles

Overall, this project was less about building the “best” solver and more about exploring how far a small, structured model can go when reasoning is treated as a first-class feature rather than an afterthought.