Manuscript Offprint

arXiv:2610.35304

Inference Latency-Aware Tsetlin Machine Training

Yefan Zeng, Shengyu Duan, Rishad Shafik, Alex Yakovlev

Yefan Zeng, Shengyu Duan, Rishad Shafik, Alex Yakovlev

Microsystems Research Group, Newcastle University

Newcastle upon Tyne, United Kingdom

{y.zeng15, shengyu.duan, rishad.shafik, alex.yakovlev}@newcastle.ac.uk

Abstract—The Tsetlin Machine (TM) is a logic-based machine learning model well suited to low-latency inference on resource-constrained edge devices. Because each clause is an AND over Boolean literals, both the literals and their associated Tsetlin Automaton (TA) actions can be represented at the bit level, enabling bitwise evaluation and an early exit that is triggered as soon as any included literal evaluates to zero, forcing the clause output to zero. In this work, we study how the two TM training hyperparameters, T and s, govern both classification accuracy and inference latency. Building on the inversely proportional T-s relationship along which accuracy is nearly constant, we find that inference latency is reduced primarily by increasing s; rather than exhaustively searching the (T,s)(T, s) grid at high training cost, we propose a directed search strategy that treats accuracy as a constraint and advances toward larger s to reduce inference latency within a fixed evaluation budget. Experimental results on the gem5 simulator with an ARM processor show that, for certain datasets, the search is able to increase s while preserving the baseline accuracy, thereby reducing inference latency at negligible accuracy cost: across six datasets, the method reduces inference latency by up to 16.34%, while some datasets exhibit an accuracy reduction of only 0.06%. The proposed strategy requires far fewer configuration evaluations than an exhaustive grid search.

Index Terms—Tsetlin Machine, Hyperparameter Optimization, Accuracy-Latency Trade-off, Early Exit, Edge Inference.

I. INTRODUCTION

Edge devices impose tight latency, memory and power budgets on machine learning (ML) inference, which deep neural networks (DNNs) meet poorly because their predictions rest on large numbers of multiply-accumulate operations [1]. Logic-based ML algorithms avoid this arithmetic bottleneck by encoding learned patterns in Boolean form and evaluating them with bitwise logic. The Tsetlin Machine (TM) is a logic-based ML algorithm that employs Tsetlin Automata (TAs) as its fundamental learning units to construct multiple logical pattern recognizers, referred to as clauses. A clause can be represented as a propositional conjunction (AND formula), making the TM inherently interpretable by construction rather than relying on post-hoc explanations. In addition, the TM eliminates the need for floating-point arithmetic during both training and inference, making it computationally efficient and cost-effective.

Fig. 1 illustrates the TM classification architecture and provides an overview of its training mechanism. Specifically, a TM operates exclusively on Boolean data. Therefore, raw features must first be transformed into Boolean features, typically through thresholding. For classification, a TM model consists of one TM for each class, with each TM learning the Boolean patterns of its corresponding class. Within a TM, a clause is activated (output=1) only when every feature in its learned pattern matches the input; a single mismatched feature is sufficient to deactivate the clause (output=0). Activated positive and negative clauses cast votes of +1 and -1, respectively, which are accumulated into a class score. The predicted class is the one with the highest score.

Booleanized feature vector: [0 ... 1]

Figure

Fig. 1: TM classification architecture and training. Type I/II feedback combats false negatives (FNs)/false positives (FPs).

As can be seen from Fig. 1, not all features are included in a clause. Feature inclusion and exclusion are determined by TAs through a reinforcement feedback mechanism that compares the clause outputs with the ground-truth labels. A hyperparameter, T, serves as the classification confidence (voting target) by encouraging the class sum to approach ±T\pm T; the farther the class sum deviates from these targets, the more likely feedback is to be triggered. Two types of feedback, Type I and Type II, are employed to reduce false negatives (FNs) and false positives (FPs), respectively. Another hyperparameter, s, controls the specificity of the learned clauses by regulating the tendency to include features, in Type I feedback. Larger values of s encourage the inclusion of more features in each clause. A more detailed description of the training mechanism can be found in previous publications [2], [3].

The conventional approach to selecting the optimal values of T and s is to perform an exhaustive grid search over candidate parameter combinations and retain the combination that achieves the highest classification accuracy [4]–[6]. Every candidate demands a full training run, so the cost grows with the resolution of the grid and the workflow becomes time-consuming. A more directed alternative has been made possible by an existing characterization of the (T,s)(T, s) space: the generally inversely proportional relationship between T and s for the optimal accuracy has been reported in a previous paper, which derives a mathematical model of the two hyperparameters and evaluates it on MNIST [7]. What both the exhaustive search and this mathematical model share, however, is that they treat (T,s)(T, s) selection as a question of accuracy alone.

Our observation is that T and s also govern inference latency. As established above, they fix the clause expression, and in particular the number of literals each clause includes. This determines how many clauses evaluate to zero on a given input, and the position at which a mismatch is encountered during clause evaluation directly determines how frequently inference can terminate clause evaluation early [8]. An accuracy-optimal (T,s)(T, s) therefore carries no guarantee of being a latency-efficient one, and to the best of our knowledge, the relationship between the hyperparameters T and s and the resulting trade-off between accuracy and inference latency remains largely unexplored.

This paper studies accuracy-latency trade-off of TM, based on different values of T and s. We first evaluate the impact of T and s on accuracy and inference latency and find these two objectives are largely decoupled. Specifically, inference latency is largely insensitive to movement along the inversely proportional relationship that preserves accuracy, and falls instead with increasing s. Based on this observation, we propose an inference latency-aware training strategy. Rather than sampling the design space indiscriminately, it advances towards larger s to reduce latency, compensates with T to hold accuracy, and admits a configuration only if a user-specified accuracy constraint is still met. A fixed budget on training evaluations bounds the search process, ensuring a linear number of evaluations with respect to the explored (T,s)(T, s) configurations.

We validate the strategy on six well-established benchmark datasets with inference latency measured on an ARM processor modeled in gem5 [9]. The results demonstrate that the proposed strategy reduces inference latency by 0.25%–16.34% while incurring only a 0.06%–1.97% reduction in accuracy. Furthermore, when searching for a model that satisfies specific accuracy and latency requirements, the proposed strategy ensures that the number of evaluations over different (T,s)(T, s) combinations increases linearly from an initial accuracy–latency configuration.

Our contributions are as follows:

• A systematic exploration of the (T,s)(T, s) design space reveals that accuracy and inference latency are largely decoupled, enabling latency optimization with minimal impact on accuracy.

• An efficient training strategy that substantially lowers the evaluation cost of (T,s)(T, s) design space exploration, compared with exhaustive search.

• Comprehensive end-to-end validation of Booleanization, TM training, hyperparameter tuning and deployment on well-established benchmark datasets, demonstrating practical applicability across diverse tasks.

References (18)