TRANSMISSION // 2611.28195v1
A faster route for rule-based machine learning in PyTorch
Source published
Torchtsetlin brings rule-based Tsetlin machines into PyTorch. Its GPU tests report faster training on most benchmarks, but accuracy and speed depend on task and batch size.

Tsetlin machines learn readable logical rules rather than adjusting neural-network weights through gradients. A new library, torchtsetlin, aims to make them easier to use alongside familiar PyTorch tools—and reports GPU speedups on established benchmarks. The results are promising, but they depend on hardware, task size and how learning is batched.
Tsetlin machines take a different route to machine learning. Instead of tuning numerical weights with gradients, they build rules from conditions such as “feature A is present and feature B is absent.” Small decision-making units, called Tsetlin automata, learn which conditions to include through rewards and penalties. The resulting clauses can be inspected as logical rules, and prediction relies on matching rules and counting their votes.
The question behind torchtsetlin, a new software library, is practical: can this kind of model be made easier to use in PyTorch, and can it run faster on GPUs while retaining performance comparable to existing Tsetlin-machine software? Vajira Thambawita, Pål Halvorsen and Ole-Christoffer Granmo describe the library and its tests in an arXiv preprint.
Bringing rule learners into PyTorch
Existing Tsetlin-machine packages often rely on C or CUDA code accessed through interfaces outside the usual PyTorch workflow. Torchtsetlin stores automata states as tensors within ordinary PyTorch modules. Users can move a model between devices with familiar tools, save its state, and update it using a mini-batch of examples.
The library includes standard, weighted, coalesced and regression machines; convolutional models for sequences, images and volumes; dense models for per-pixel segmentation; and a graph model. The authors describe the package as pure Python, MIT-licensed and available through PyPI. Its GPU-specific fast paths use Triton kernels.
The central engineering idea is to batch learning. In the traditional online approach, each example can change the model before the next one is processed. Torchtsetlin instead counts the feedback transitions across a mini-batch and applies them together. The authors use binomial draws to sample the accumulated transitions. This is a batched update method, not an exact reproduction of sequential learning: every example in a batch sees the model as it was at the batch’s start. A sequential mode is also available.
What the benchmarks show
The paper reports ten benchmarks drawn from existing Tsetlin-machine libraries or papers. They do not all form one directly comparable accuracy test: B6, for example, is a separate cross-library timing protocol. In the main comparisons, implementations used the same Booleanised data and published hyperparameters, without additional tuning; accuracy was measured at the final training epoch. GPU timings were collected on one machine with an NVIDIA RTX 3090.
The authors report that torchtsetlin’s accuracy was within the range of other libraries on most of the main benchmark tasks, but this is not a blanket match across every mode and result. In batch mode on B4, MNIST, accuracy was 97.90%, compared with 97.97–98.21% for the other listed libraries. On B2, a small convolutional task, a batch size of 100 produced 92.47% accuracy, while sequential training reached 99.60%. Smaller batches in a separate sweep performed much closer to sequential training. B6’s accuracy figures are explicitly not like-for-like: the number of clauses allocated per class differs for some models, and model configurations also differ.
For GPU training, the paper reports torchtsetlin was faster than PyTsetlinMachineCUDA and tmu on all but the two smallest benchmarks. Across the reported comparisons, speedups were 2.4–10.9 times over PyTsetlinMachineCUDA and 10.3–81.2 times over tmu on the same GPU. These figures describe particular implementations, workloads and configurations; they do not guarantee the same gains elsewhere. In additional image-task experiments, very large batches could reduce accuracy or take longer to reach the best result. The authors recommend batch sizes of 16–64 for the settings they studied.
What remains uncertain
These tests provide evidence about the compared implementations under stated conditions, not a general verdict on all Tsetlin machines or machine-learning methods. The comparisons used one computer, and CPU performance differed from GPU performance. On MNIST, torchtsetlin’s CPU training took 69.6 seconds per epoch on 16 threads, compared with 9.32 seconds for single-threaded pyTM; the paper attributes this weakness to dense tensor operations that do not exploit the bit-level techniques used by C libraries. Other hardware or settings could change the comparison.
Readable rules are a feature of the model design, but readability alone does not establish that a system is suitable for high-stakes decisions. This study benchmarks software performance and accuracy; it does not demonstrate benefits in a real-world deployment.
The work is an arXiv preprint, so its claims should not be treated as peer-reviewed validation. The authors provide a script intended to reproduce the reported results, making the work more checkable, but independent replication would add confidence. Its immediate contribution is a PyTorch implementation and a documented set of comparisons—not proof that it will outperform alternatives in every setting.
- Tsetlin machines
- PyTorch
- interpretable machine learning
- GPU computing
- machine-learning software
- benchmarking
Related reading
Automatically matched by shared topic keywords. These links do not imply that the sources agree or establish a consensus.
Simpler building blocks for inspectable predictions
Source published
Shared keywords: interpretable machine learning
What can skin-lesion descriptions tell an AI about diagnosis?
Source published
Shared keywords: interpretable machine learning
Random Symbolic Boosting builds predictive formulas without evolutionary search
Source published
Shared keywords: interpretable machine learning
A medical-language AI that explains predictions through concepts
Source published
Shared keywords: interpretable machine learning
Readable AI estimates simulated jet-engine life—and exposes diagnostic blind spots
Source published
Shared keywords: interpretable machine learning