Surprise and Disambiguation in L6

Eventually, HTM will need to incorporate surprise. For the purposes of this post, surprising inputs are those which do not fit any possibilities remaining during object or location disambiguation. When surprise occurs, it must add to the list of possibilities.

The surprising input might be from another known object, or the object it has been exploring might be novel. If it is the latter, it should throw out its list of possibilities from before the surprise, but if it is the former, it should put the list away and use it again if it switches back to the first object.


Lower L6 corticothalamic cells could prevent possibility set switching.

  1. From primary cortex, L6b cells project to higher order thalamus and subnuclei of primary thalamus besides the main sensory relay subnucleus [1].
  2. They might only target matrix cells [2], which could broadcast surprise.
  3. Some or all matrix cells [3] and L6 CT cells have facilitating synapses. If that facilitation decays slowly, it could store possibility sets when attention switches and use them again if the facilitated cells fire.
  4. Acetylcholine depolarizes L6 CT cells [4]. This could make it less willing to switch possibility sets, making it pay attention to something.

L6 corticocortical cells could detect new or surprising inputs.

  1. L6 excitatory cells fire more rapidly at the start of current injection, especially CC cells [4].
  2. L6 CT cells probably form synapses distally on L6 CC cells [5], so they could predictively depolarize L6 CC cells to prevent their rapid firing. The same could occur in the thalamus, and L6 CC cells receive stronger inputs from the thalamus than L6 CT cells [6], so L6 CC rapid initial firing could amplify thalamocortical bursts.

L6 corticocortical cells could broadcast surprise signals in the same region and send it to other regions.

  1. When a single sensory patch is surprised, others might also need to be surprised even if their inputs are expected. This signal could be the same one which does voting, and voting is needed anyway to see if it exhausts the list of possibilities.
  2. L6 CC cells have transcolumnar axons in L5/6 [7], so they could vote or at least send surprise signals to other macrocolumns and other regions.


The recent locations paper describes path integrating sets of possible locations, which is an example of possibility set switching. Perhaps this switching uses the same mechanisms for path integration and surprise. One possible shared mechanism is facilitation to temporarily store possibility sets following surprise and do path integration.

Facilitation is also a potential mechanism for disambiguation because it fits evidence accumulation. It could temporarily anchor the location to the feature to help it learn invariance.

Sources and Inferences

[1] (multiple sources and inferences)
Corticothalamic Projections from the Cortical Barrel Field to the Somatosensory Thalamus in Rats: A Single-fibre Study Using Biocytin as an Anterograde Tracer (Jacques Bourassa, Didier Pinault, and Martin Deschênes, 1995) - Lower L6 cells project to POm and an adjacent part of VPM. There are a couple other articles with similar titles and authors on V1 and S2 with reconstructions which don’t contradict this.

A New Thalamic Pathway of Vibrissal Information Modulated by the Motor Cortex (Nadia Urbain and Martin Deschênes, 2007) - The VPM head subnucleus is adjacent to POm.

Septal Neurons in Barrel Cortex Derive Their Receptive Field Input from the Lemniscal Pathway (Takahiro Furuta, Takeshi Kaneko, and Martin Deschênes, 2009) - The VPM head subnucleus drives the septa in L4.

Subset of Cortical Layer 6b Neurons Selectively Innervates Higher Order Thalamic Nuclei in Mice (Anna Hoerder-Suabedissen et al., 2018) - Lower L6 cells or a genetically labeled subset in many regions project to higher order thalamus and subnuclei of primary thalamus.

Specificity in the axonal connections of layer VI neurons in tree shrew striate cortex: evidence for distinct granular and supragranular systems (W. Martin Usrey and David Fitzpatrick, 1996) - Lower L6 cells in tree shrew (a relative of primates) project preferentially to koniocellular-like layers of LGN and to the most ventral part of pulvinar.

The Laminar Organization Of The Lateral Geniculate Body And The Striate Cortex In The Tree Shrew (Tupaia Gus) (Michael Conley, David Fitzpatrick, And Irving T. Diamond, 1983) - The koniocellular-like layers of tree shrew LGN don’t target L4, only receive small terminals from the retina, and receive input from the superior colliculus.

Sublaminar organization within layer VI of the striate cortex in Galago (Michael Conley and Denis Raczkowski, 1990) - Lower L6 of bush baby V1 targets pulvinar.

Other articles found projections from primary cortex L6 to higher order thalamus in other species. Projections from V1 to pulvinar in macaque haven’t been found, I think, but there are few CT cells in that region and they could be in the white matter below it.

[2] Differences in projection patterns between large and small corticothalamic terminals (Susan C. Van Horn and S. Murray Sherman, 2004)

[3] Properties of the thalamic projection from the posterior medial nucleus to primary and secondary somatosensory cortices in the mouse (Angela N. Viaene, Iraklis Petrof, and S. Murray Sherman, 2011)

[4] Cre‐expressing neurons in visual cortex of Ntsr1‐Cre GN220 mice are corticothalamic and are depolarized by acetylcholine (Sofie Charlotte Sundberg, Sarah Helen Lindström, Gonzalo Manuel Sanchez, and Björn Granseth, 2017)

[5] (inference)
Excitatory Connections Made by Presynaptic Cortico-Cortical Pyramidal Cells in Layer 6 of the Neocortex (Audrey Mercer, David C. West, Oliver T. Morris, Sarah Kirchhecker, Jane E. Kerkhoff, and Alex M. Thomson, 2005) - This study found that L6 CC cells produce EPSPs in other pyramidal cells a few times more often than L6 CT cells.
Local Connections of Excitatory Neurons to Corticothalamic Neurons in the Rat Barrel Cortex (Yasuhiro R. Tanaka et al., 2011) - Using a virus, this study found that the most numerous nearby input to L6 CT cells is themselves and the most numerous distant input is L6 CC cells.

[6] Infrabarrels Are Layer 6 Circuit Modules in the Barrel Cortex that Link Long-Range Inputs and Outputs (Shane R. Crandall, Saundra L. Patrick, Scott J. Cruikshank, and Barry W. Connors, 2017)

[7] Intracortical Axonal Projections of Lamina VI Cells of the Primary Somatosensory Cortex in the Rat: A Single-Cell Labeling Study (Zhong-Wei Zhang and Martin Deschênes, 1997)

[8] A Third Parallel Visual Pathway to Primate Area V1 (V. A. Casagrande, 1994)


Isnt anomaly detection what surprise is thought of?

Anomaly detection with HTM is based on prediction error, not surprise. Surprise is a reaction to prediction error. I wouldn’t really call them the same thing.

Some people (including myself) have said that a minicolumn bursting when seeing new data is sort of like surprise… but at a very, very low level. I don’t think that’s the type of surpsie that @Casey is talking about.


I use the term “surprise” in the short-term context of mismatch between the local column prediction and perception. This is a cortex thing.

There is a larger context where an entire action or state does not match up to perception. I can accept that at the wholesale level would be a different orientation mechanism. One possibility is engagement of the sub-cortical orientation or alert system(s).


You’re talking about the thalamus and the “blackboard” idea, right?

I am and there has been considerable traffic on the forum lately on the pulvinar for vision and related structures for other sensory modalities.


1 Like

Surprise was probably the wrong word in retrospect. Maybe “switch” is a better word.

To give some context, this is based on what you described in our pm conversation about the reticular activating system. I thought about your idea of detecting mismatch between the representation and input as running out of possibilities in the SMI output layer. It’s easier for me to think about a specific problem, just as a starting point for thought.

I think the brain treats those mostly the same.

The state, or at least a list of possibilities, is a set of predictions. I think object disambiguation shares a lot of mechanisms with temporal memory. That is more likely to evolve. Sequences and objects are sort of combined in: location disambiguation layer, egocentric pathway remapping object representations each movement, auditory objects, and motor objects.

I think the main difference between object and sequence processing at the cellular level is whether each cell in a minicolumn has the same proximal input.

Minicolumns are present in most or all layers, which HTM theory doesn’t currently incorporate. When all possible objects are ruled out, all cells have deactivated and it needs to activate cells for new possibilities. Minicolumns of cells with different proximal inputs could burst when that happens, or more specifically most but not all of them turn on depending on their proximal inputs. With this system, learning can work similarly to temporal memory. Voting between cortical columns can happen by predicting which cells will remain on in the near future. Temporal memory-like predictions could remap objects in the egocentric pathway.

Some neuroscience facts which may or may not be relevant to your ideas

There are two or three types of L6 corticothalamic cell (feedback, feedback/feedforward, and maybe feedforward). Each has apical dendrites and its axon preferentially in the layer or sublayer to which the CT cell’s thalamic target projects. There’s always one for L4, and there’s one for L5 ST cells or L2/3 depending on the species and maybe region. The type for L2/3 or L5ST projects to non-lemniscal primary thalamus (e.g. cells receiving input from superior colliculus in LGN) and higher order thalamus. The two types project to different depths/tiers of the thalamic reticular nucleus, at least from a couple cortical regions. Based on some quick glances at articles a while ago, it’s possible that one tier is driven by thalamic relay cells and the other is driven by L6 CT cells. TRN cells have burst/tonic firing modes just like TC cells, but modes switch much more slowly so the bursts are much longer, possibly activating GABA(B)Rs, and without much voltage dependence so conducive to oscillations. Like always, I’ll give you sources if anything is interesting and explain inferences based on multiple articles.

I think one L6 CT type is for object and one is for sequence. Feedforward projections from L6 CT cells are kind of ignored, probably because they don’t fit the idea that L6 is modulatory (which feedforward CT projections are, not just feedback). Perhaps they represent possible objects using facilitation levels and thalamic cell firing mode. That is closely tied to attention since sets of possibilities are what is being attended.

I’m guessing that’s related to the blackboard idea.

1 Like

Please is there any way to calculate prediction error in HTM?

See anomaly detection, specifically how the anomaly score is calculated.

A TemporalAnomaly model calculates the anomaly score based on the correctness of the previous prediction. This is calculated as the percentage of active spatial pooler [mini]columns that were incorrectly predicted by the temporal memory.

1 Like