Tsetlin machine

A simple block diagram of the Tsetlin machine

A Tsetlin machine is an artificial intelligence algorithm based on propositional logic.

Background

A Tsetlin machine is a form of learning automaton collective for learning patterns using propositional logic. Ole-Christoffer Granmo created and gave the method its name after Michael Lvovitch Tsetlin, who invented the Tsetlin automaton and worked on Tsetlin automata collectives and games. Collectives of Tsetlin automata were originally constructed, implemented, and studied theoretically by Vadim Stefanuk in 1962.

The Tsetlin machine uses computationally simpler and more efficient primitives compared to more ordinary artificial neural networks.

As of April 2018 it has shown promising results on a number of test sets.

Types

Applications

Original Tsetlin machine

A detailed block diagram of the original Tsetlin Machine
A detailed block diagram of the original Tsetlin machine
List of hyperparameters
Description Symbol
Number of binary inputs NInputs
Number of classes NClasses
Number of clauses per class NClauses
Number of automaton states 2n
Automaton decision boundary n
Automaton initialization state ∅Init
Feedback threshold T
Learning sensitivity s

Tsetlin automaton

The Tsetlin automaton is the fundamental learning unit of the Tsetlin machine. It tackles the multi-armed bandit problem, learning the optimal action in an environment from penalties and rewards. Computationally, it can be seen as a finite-state machine (FSM) that changes its states based on the inputs. The FSM will generate its outputs based on the current states.

  • A quintuple describes a two-action Tsetlin automaton:

{Φ_,α_,β_,F(⋅,⋅),G(⋅)}.

  • A Tsetlin automaton has 2n states, here 6:

Φ_={ϕ1,ϕ2,ϕ3,ϕ4,ϕ5,ϕ6}

  • The FSM can be triggered by two input events

β_={βPenalty,βReward}

  • The rules of state migration of the FSM are stated as

F(ϕu,βv)={ϕu+1,if 1≤u≤3 and v=Penaltyϕu−1,if 4≤u≤6 and v=Penaltyϕu−1,if 1<u≤3 and v=Rewardϕu+1,if 4≤u<6 and v=Rewardϕu,otherwise.

  • It includes two output actions

α_={α1,α2}

  • Which can be generated by the algorithm

G(ϕu)={α1,if 1≤u≤3α2,if 4≤u≤6.

Boolean input

A basic Tsetlin machine takes a vector X=[x1,…,xo] of o Boolean features as input, to be classified into one of two classes, y=0 or y=1. Together with their negated counterparts, x¯k=¬xk=1−xk, the features form a literal set L={x1,…,xo,x¯1,…,x¯o}.

Clause computing module

A Tsetlin machine pattern is formulated as a conjunctive clause Cj, formed by ANDing a subset Lj⊆L of the literal set:

     Cj(X)=⋀l∈Ljl=∏l∈Ljl.

For example, the clause Cj(X)=x1∧¬x2=x1x¯2 consists of the literals Lj={x1,x¯2} and outputs 1 iff x1=1 and x2=0.

Summation and thresholding module

The number of clauses employed is a user-configurable parameter n. Half of the clauses are assigned positive polarity. The other half is assigned negative polarity. The clause outputs, in turn, are combined into a classification decision through summation and thresholding using the unit step function u(v)=1 if v≥0 else 0:

ŷ=u(∑j=1n/2Cj+(X)−∑j=1n/2Cj−(X)). In other words, classification is based on a majority vote, with the positive clauses voting for y=1 and the negative for y=0. The classifier

     ŷ=u(x1x¯2+x¯1x2−x1x2−x¯1x¯2),

for instance, captures the XOR-relation.

Feedback module

Type I feedback

Type I Feedback
Action Clause 1 0
Literal 1 0 1 0
Include literal P(reward) s−1s N/a 0 0
P(inaction) 1s N/a s−1s s−1s
P(penalty) 0 N/a 1s 1s
Exclude literal P(reward) 0 1s 1s 1s
P(inaction) 1s s−1s s−1s s−1s
P(penalty) s−1s 0 0 0

Type II feedback

Type II Feedback
Action Clause 1 0
Literal 1 0 1 0
Include literal P(reward) 0 N/a 0 0
P(inaction) 1.0 N/a 1.0 1.0
P(penalty) 0 N/a 0 0
Exclude literal P(reward) 0 0 0 0
P(inaction) 1.0 0 1.0 1.0
P(penalty) 0 1.0 0 0

Resource allocation

Resource allocation dynamics ensure that clauses distribute themselves across the frequent patterns, rather than missing some and overconcentrating on others. That is, for any input X, the probability of reinforcing a clause gradually drops to zero as the clause output sum

v=∑j=1n/2Cj+(X)−∑j=1n/2Cj−(X) approaches a user-set target T for y=1 (−T for y=0).

If a clause is not reinforced, it does not give feedback to its Tsetlin automata, and these are thus left unchanged. In the extreme, when the voting sum v equals or exceeds the target T (the Tsetlin Machine has successfully recognized the input X), no clauses are reinforced. Accordingly, they are free to learn new patterns, naturally balancing the pattern representation resources.

Implementations

Software

Hardware

  • One of the first FPGA-based hardware implementation of the Tsetlin Machine on the Iris flower data set was developed by the μSystems (microSystems) Research Group at Newcastle University.
  • They also presented the first ASIC implementation of the Tsetlin Machine focusing on energy frugality, claiming it could deliver 10 trillion operation per Joule. The ASIC design had demoed on DATA2020.