TL;DR
This paper introduces a latency-aware training strategy for Tsetlin Machines (TMs) that significantly reduces inference time on edge devices with negligible impact on accuracy. By exploiting a newly discovered decoupling between accuracy and latency in the TM hyperparameter space, the authors use a directed search to achieve up to a 16.34% reduction in clock cycles compared to standard accuracy-optimized models.
What Problem Does This Paper Address?
Edge computing requires machine learning models that are not just accurate, but also extremely fast and energy-efficient. While Deep Neural Networks (DNNs) dominate the field, their reliance on heavy multiply-accumulate (MAC) operations makes them a poor fit for resource-constrained hardware.
Tsetlin Machines (TMs) offer a logic-based alternative. They learn patterns using Boolean "clauses" (AND operations) that can be evaluated using fast bitwise logic. A key feature of TMs is the early exit: since a clause is an AND of several features, the moment a single feature doesn't match, the entire clause evaluates to zero and computation can stop.
However, standard TM training focuses solely on maximizing accuracy. The researchers identified that the two main hyperparameters—$T$ (the voting target/confidence) and $s$ (the feature inclusion tendency)—also dictate how many features are in a clause and how often early exits occur. The challenge was finding a way to optimize for speed without sacrificing the TM's predictive power.
Methods
The authors first mapped the relationship between $T$, $s$, accuracy, and latency. They discovered that while accuracy stays relatively stable along an inversely proportional relationship between $T$ and $s$, inference latency is primarily driven by $s$.
Building on this, they proposed a Latency-Aware Directed Search (Algorithm 1):
- Start at the Peak: Begin with a known accuracy-optimal $(T, s)$ configuration.
- Treat Accuracy as a Constraint: Instead of searching for the highest accuracy, the user sets a minimum acceptable accuracy threshold ($A_{th}$).
- Climb for Speed: The algorithm "climbs" the $s$ value (which reduces latency) while adjusting $T$ to stay within the accuracy budget.
- Early Exit Optimization: The search prioritizes configurations that result in more specific clauses, which are more likely to trigger early exits during inference.
This approach is far more efficient than a "grid search," which exhaustively tests every possible combination of parameters.
Datasets
The strategy was validated across six diverse benchmark datasets:
- Digits & MNIST: Classic handwritten digit recognition.
- Kuzushiji-MNIST (KMNIST): Japanese cursive characters.
- Fashion-MNIST (FMNIST): Clothing items.
- CIFAR2: A binary version of CIFAR-10 (animals vs. vehicles).
- Keyword Spotting (KWS): Audio-based speech command recognition.
Key Insights and Ideas
- The Decoupling Effect: Accuracy and latency are largely decoupled in TMs. You can often trade a tiny sliver of accuracy for a significant boost in speed by moving to a higher $s$ value.
- Why Higher $s$ is Faster:
- Fewer Votes: Larger $s$ values make clauses more specific (fine-grained). These specific clauses are less likely to match unseen data, meaning fewer clauses output a '1' (vote). Fewer votes mean less work for the final summation.
- Earlier Mismatches: Denser clauses (more included features) increase the statistical probability that a mismatch will be found early in the bitwise evaluation, triggering an early exit.
- Visualizing the Trade-off: The paper uses heatmaps to show that while accuracy peaks in a specific "diagonal" band (see Figure 3), latency consistently drops as you move "up" the $s$-axis (see Figure 5).
Key Results
The researchers measured performance using the gem5 simulator to model a timing-accurate ARM processor.
- Latency Reduction: The method reduced inference latency by 0.25% to 16.34% across the datasets.
- Accuracy Preservation: These speedups came at a very low cost. For example, on the Keyword Spotting (KWS) dataset, they achieved a 6.67% latency reduction with an accuracy drop of only 0.06%.
- Search Efficiency: The directed search reached these optimal points in just 9 to 100 evaluations, whereas an exhaustive grid search would require hundreds or thousands of training runs.
Limitations and Future Work
- Budget-Bounded Search: The algorithm is designed to be fast, meaning it might settle for a "good enough" low-latency configuration rather than finding the absolute mathematical global optimum.
- Hardware Specifics: While the logic holds for bitwise software implementations, the authors note that for different architectures (like the compressed REDRESS implementation), the optimization direction for $s$ might actually need to be reversed.
- Future Directions: The authors suggest that this latency-aware logic could be integrated directly into the TM feedback mechanism during training, rather than being a post-training hyperparameter search.
Summary updated