<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>HTMRL: Biologically Plausible Reinforcement Learning with Hierarchical Temporal Memory?</article-title>
      </title-group>
      <contrib-group>
        <aff id="aff0">
          <label>0</label>
          <institution>University of Antwerp - imec IDLab - Department of Mathematics and Computer Science Sint-Pietersvliet 7</institution>
          ,
          <addr-line>2000 Antwerp</addr-line>
          ,
          <country country="BE">Belgium</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Objective Hierarchical Temporal Memory (HTM) has been shown to adapt well to changing input patterns, making it a natural building block for a Reinforcement Learning (RL) agent that adapts to evolving tasks quickly. In this paper, we design, implement and experimentally evaluate HTMRL: the rst such agent, built with nothing but HTM. Background In RL, an agent learns how to behave in an environment [2]. This is usually modelled as a Markov Decision Process (MDP): the 4-tuple Copyright c 2019 for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>(1)
where S is the set of states, A is the set of actions, P models which state will be
reached after taking an action, and R de nes the reward after such a transition.
The main goal of an agent is then to de ne a policy , deciding which action to
take in each state.</p>
      <p>
        HTM is a computational model of the human neocortex, originally proposed
by Je Hawkins [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. One of the core aspects of HTM is its strict biological
plausibility, meaning that any feature that could not plausibly be implemented
in the neocortex will not be allowed in the HTM model. All data within the
model is encoded as Sparse Distributed Representations (SDRs), binary data
structures with only a limited number of enabled bits (i.e., with value 1). One of
the main components of HTM is the spatial pooler, which reorganises incoming
SDRs to produce outputs of always the same size and sparsity, and to ensure
the available capacity is optimally utilised. To achieve this, the spatial pooler
maintains synapses between some pairs of input and output bits. These synapses
can carry a 1 signal from input bit to output bit, with output bits receiving
relatively many signals adopting this 1 value. Synapses carrying such signals to
these activated output bits grow stronger while others grow weaker, eventually
becoming unable to carry a signal, ensuring that similar inputs will lead to
similar outputs.
? Supported by the Research Foundation - Flanders (fwo): PhD Fellowship 1SB0719N.
      </p>
      <p>Environment
0 0 2</p>
      <p>State, reward</p>
      <p>Action</p>
      <p>Agent</p>
      <p>ARM 1
Spatial pooler</p>
      <p>ARM 2
HTMRL Our proposed HTMRL algorithm, summarised in Figure 1, uses only
a spatial pooler, with minimal modi cations. HTMRL converts any input into
an SDR of, by default, 2048 bits. To map this to one of jAj actions, we simply
subdivide the SDR into j j equally sized bins, selecting the bin containing the</p>
      <p>A
most 1 bits as the action to take. Synapse growth is then scaled with the reward
signal. As such, actions leading to poor rewards become less likely to be selected
on future similar inputs, and vice versa. HTMRL can explore rarely selected
actions through the boosting mechanism also present in core HTM theory, which
ampli es incoming signals of rarely activated output bits.</p>
      <p>Experiments and evaluation We evaluate our HTMRL implementation in
an environment with many multi-armed bandits, each giving a positive reward
on only a single arm. One randomly selected bandit is presented to the
algorithm at every step. With 4-armed bandits, the algorithm could learn over
1000 bandits before becoming prohibitively slow in our implementation. With a
xed set of 20 bandits, HTMRL could learn up to 1024 arms per bandit, which
is the maximum number of actions representable in its base con guration. To
evaluate performance in changing environments, we experiment with a bandit
whose arms' rewards are sampled from normal distributions. HTMRL reaches
near-optimal performance in a number of steps similar to an -greedy learner.
The distributions are then randomly reinitialised, after which HTMRL reaches
near-optimal performance just as fast as before, while -greedy learners struggle
to adapt. We also show that by shu ing the arms instead of fully
reinitialising them, HTMRL adapts even faster, meaning it can leverage its knowledge of
previous phases, making it a promising approach for Meta-RL applications.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Hawkins</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ahmad</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Purdy</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lavin</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <source>Biological and machine intelligence</source>
          (
          <year>2016</year>
          ), https://numenta.com/resources/biological-and
          <string-name>
            <surname>-</surname>
          </string-name>
          machine-intelligence/
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Sutton</surname>
            ,
            <given-names>R.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Barto</surname>
            ,
            <given-names>A.G.</given-names>
          </string-name>
          :
          <article-title>Reinforcement Learning: An Introduction</article-title>
          . MIT press,
          <volume>2</volume>
          <fpage>edn</fpage>
          . (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>