arXiv:2510.15653cs.LG2025-10被引 1

用位操作优化逻辑机推理,速度提升超96%。

Fast and Compact Tsetlin Machine Inference on CPUs Using Instruction-Level Optimization

  • 用位运算替代整数计算,压缩模型体积并加速推理
  • 引入提前退出机制,结合字面量重排策略,最高提速96.71%
  • 适合在低功耗CPU上部署的轻量级分类模型

Tsetlin Machine(TM)在资源受限设备如CPU上具备高速推理能力。其基于逻辑的操作天然适合现代CPU架构的并行执行。为此,我们提出一种高效软件实现,通过指令级位操作实现紧凑模型表示和加速处理。为进一步提升推理速度,引入基于AND门结构的提前退出机制,避免冗余计算。在此基础上,提出一种字面量重排策略,在训练后、推理前通过分析所有字面量及其关联的Tsetlin Automata(TA)行为,最大化提前退出概率,运行时开销可忽略。使用gem5模拟器搭载ARM处理器的实验表明,相比传统基于整数的TM实现,优化后方案将推理时间最多降低96.71%,同时保持相近的代码密度。

原文摘要 · Abstract (English)

The Tsetlin Machine (TM) offers high-speed inference on resource-constrained devices such as CPUs. Its logic-driven operations naturally lend themselves to parallel execution on modern CPU architectures. Motivated by this, we propose an efficient software implementation of the TM by leveraging instruction-level bitwise operations for compact model representation and accelerated processing. To further improve inference speed, we introduce an early exit mechanism, which exploits the TM's AND-based clause evaluation to avoid unnecessary computations. Building upon this, we propose a literal Reorder strategy designed to maximize the likelihood of early exits. This strategy is applied during a post-training, pre-inference stage through statistical analysis of all literals and the corresponding actions of their associated Tsetlin Automata (TA), introducing negligible runtime overhead. Experimental results using the gem5 simulator with an ARM processor show that our optimized implementation reduces inference time by up to 96.71% compared to the conventional integer-based TM implementations while maintaining comparable code density.

逻辑机位运算推理加速CPU优化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。