HTM Mini-Columns into Hexagonal Grids!

This hex-grid thing is a single mechanism that delivers:

  • Spatial pooling with ~3% sparsity enforcement
  • Temporal pooling via reverberation
  • A natural lateral voting mechanism À la TBT.
  • This lateral voting extends seamlessly over the range of the grid formation.
  • Self-organizing both in learning the grid connections AND adding new features to the recognition.
  • Self-organizing in adding new members to the periphery of the hex-grid formation.

All in one neat biologically plausible package.


You talked a bit about the scale of things in the hackers’ hangout. One confusing thing is that “long-range” connections aren’t always very long, at least in rodents. They’re just axons which travel out of the cortical region to another region or elsewhere. I don’t have a good sense of scale in primates, but in rodents a millimeter is big. Mouse and rat brains are ~15 to 25 mm long. The dendritic arbors are something like .3 mm in diameter (roughly the size of a cortical column), and regions are a few millimeters across.

I think figure 8b in the article above shows the scale of regions well. Ignore the axons, they’re from the thalamus. They grey blob shaped things are the parts of cortical columns in layer 4.

I think this one shows the scale of dendritic and axonal arbors well in its drawings of neurons. Fig. 8-11 probably have more typical sizes of axon arbors. The axons of cells in the other figures are more restricted to a cortical column, ~.2 to .3 mm in the region this article is about.
Figure 2 shows a thick tufted cell in L5. They have pretty large basal dendritic arbors. In that figure, the dendrites have yellow dots and the axon does not.

Drawings of axons and dendrites in other layers.

In some of these figures you can sort of see the axon branch which descends out of the cortex. Not all cells have that.

In those figures, the axon arbors don’t seem to form any hex grid-like pattern, but maybe that doesn’t matter. I think hex grids would have to be pretty messy, but maybe a little bias towards some sort of preferred hex grid-ish pattern is enough.

Maybe layers 5 and 6 don’t form hex grids and L2/3 is different, in that it has more regularly spaced densities of axon length. I haven’t seen that in L2/3 but I haven’t seen as many examples of those cells.

You’d also have to consider the dendrites and how they’re positioned unless you’re talking about small enough dendritic segments which basically receive input from axons located around a single point. The hex grid might be too messy if you are talking about proximal dendrites since those occupy ~.1 mm diameter (and summate all their inputs together unlike the more spatially confined summation in distal dendrites).


My guess is this reduces cross talk between networks. They’re all hex-like grids rather than overlapping spaghetti.


They wouldn’t. Show such a pattern, in a calvin thing.
Specific hex grids (dynamic activation patterns) would represent something, right ? We all expect each cortical map to be able to (statically, from all connection schemes) encode more than one. Thing. Don’t we ? Far, far more. So the connectivity pattern around one given cell is compatible with all of them, where that cell is involved. More like your red ring in the figure below.

And yes, L2/3 is distinct from other layers in that regard, since most of its local axonal projections are to itself. This is where you’d expect such resonance to kick in.

1 Like

I will add that the cells learn the grid pattern the same way they learn input patterns.
The topology offers input on the distal dendrites on the cell body at the same time as input patterns are arriving on the apical dendrites.
The learning that happens when the cell fires an action potential can happen in all dendrite synapses at the same time.


Ok - biological justification for a proposed learning rule:

We have a stream of spikes coming at us from senses or a lower level.

  • We try to fire but we are suppressed in the grid competition - no firing spikes to learn, so no learning at all.
  • We are the winner of the grid competition so we are not suppressed- our firing is in response to the input triggers spike timing learning as we freely respond to the input
  • Stimulation from successful grid formation increases the firing rate. We now fire even faster in response to the incoming spike train.
  • At some point we are firing at the same rate and in phase with the inputs, perhaps even faster with the grid drive - and if the hex-grid rate exceeds the rate of the input there can be negative learning. A very local form of negative feedback - cool your jets hotshot!

Note that even though we have described L5 input bounced through thalamus relays as axonal projections, lateral axonal projections, and apical projections, we assumed that those apical projections are from lower levels. In fact, we know that L2/3 has reciprocal projections with related maps in the hierarchy. This implies that as we go into grid resonance this will provide a significant spike train for the related area in the next map to become activated, and it will respond by projecting a similar spike train back to our general vicinity. Since we know that map-2-map fiber bundles maintain topology this should work to cement the bond between the hex pattern in this map and whatever related pattern is forming in the next map. This is what I was getting at when I mentioned hierarchy in the main hex-grid post.

Since we are not excited about embracing a full-on spike based system (at least I am not) we will use an activation value to stand for the spike rate. Likewise, the synapse values could be a scaler. 8 bit values should be more than sufficient to capture real neuron behavior. (Actually- 4 bit values should be sufficient!)

So a simplified learning rule that can be used to write code:

Note: I envision this pooling algorithm running at gamma rate so 4 rounds of this competition for every alpha rate cycle.

Tally activation inputs and drive lateral axonal output that activate local inhibitor field. If you are running map-2map connections update these at the same time. Tally resulting cell inputs including inhibition. Repeat 3x.

On the final round …
If suppressed to silence, learn nothing.
If our activation is above some threshold, also do nothing as we clearly don’t need to learn anything else.
Otherwise, strengthen all active inputs.
This will boost anyone that is a winner of local competition, whether part of a grid or not. The outputs from these winners will learn to hook up grid connections later when they get strong enough.

Variation #1: tally inputs and if not suppressed, apply learning based on this formula:
Some Max learning minus activation tally. A slightly trained cell will learn fast, an iffy cell will get a boost, and a well trained cell learns nothing.


I forget that people here may not be familiar with neural wiring. An important detail for both L2/3 and L5 is that both layers have chandelier inhibitory cells reading the axon hillocks and there is a local competition for both the temporal winner in L5 and the competition to be a grid-hub in L2/3. In both cases, from a mini-column point of view, there can be only one active cell in that layer.
If L5 has no winner with a strong input it bursts. In L2/3 it either enters the neighborhood competition or gets suppressed by stronger mini-columns - I don’t see bursting as something that L2/3 does.

1 Like

This is a bit beyond my imagination, how did this hexagon shape suddenly come out? @Bitking

Hexagons are not the goal, but a side effect.
Start with the most efficient packing of circles in a plane; the hexagon is the polygon that best fits this with short line segments. The reach of dendrites and lateral projection axons describe this natural circle around the cell.

See beehive honeycomb for another example.


Agreed. I just pointed that out because it looked like that in some figures in the paper shown in the recent hackers’ hangout.

Most layers receive most of their input from themselves. There could be resonance in any layer. Hex grids are a replacement for spatial pooling, which determines minicolumn states. Minicolumns exist in most layers*, so why assume hex grids are only formed in one layer?
*There’s decent evidence for minicolumns in L4, L5 TT, L5 ST, and L6a CT.

I’m not sure L2/3 is suited for resonance since its firing is sparse compared to other layers, meaning a small fraction of cells have much higher firing rates than the other cells at a given point in time (during a whisker deflection). L5 TT cells might be more suited for resonance because they have generally high firing rates. I imagine that’s more suited for network activity settling from one state into a more hex grid -like state. I don’t know though.

I’m not saying that L2/3 can’t be where hex grids form, just that I don’t see why it has to be L2/3. For example, L5 slender tufted cells are similar to L2/3 in several ways*, and they are more directly related to the thalamus** and so are more suited for utilizing cortex-thalamus resonance. They also have higher firing rates which might make them more suited for resonance. They don’t have a place in HTM theory unlike L2/3, so assigning the role of hex grids to L5 ST cells is more compatible with HTM theory.

*They are suited for voting, e.g. long lateral connections and projections to other regions.


They receive input from higher order matrix thalamus, and they receive input from one group of L6 corticothalamic cells just like L4 receives input from another group of L6 CT cells. Each of those groups of L6 CT cells forms their apical tufts mainly in the corresponding layer, either L4 or L5st (L5a in this region). L2 and L3 project to L5a (slender tufted cells in this case) way more than to L5b, and L5a projects to L2 a lot.
(Barrel cortex.)

I hadn’t thought about learning. That seems like it could clean up the messiness caused by messy axon arbors and whatnot into something more neatly gridy.

I’m not sure maintaining topology is enough to convey a hex grid pattern. For example, if the topological axons spread out too much but still maintain a blurred topology, that might not be spatially precise enough for hex grids. It seems like it would be really hard to find strong evidence for this.

I don’t understand what you think L5 does in hex grids. Are you talking about L5 slender tufted cells or thick tufted cells?

That is not what I usually come across. If you have more info about this, I’ll take it.

I aint too much concerned about minicolumns when envisionning L2/3 or calvin, to be honnest.

On the other side,

I was looking for some support about those. Please share if you know of something, in the HTM acception of them sharing proximal input. (Since from a developmental (and structural) perspective, I believe they are a thing indeed, spanning across all layers).

Another specificity of L2/3 is proximity with L1, giving L2 cells the ability to tap into L1 without an apical trunk. Maybe there’s something to that


I fully accept that predictive cell thing as it solves several important holes in the theory of operation that I have been trying to piece together since I was exposed to Calvin many years ago.

How to combine predictive cells and grid forming cells so they work together?

In most of the cortex wiring diagrams that I have seen there is no direct path from L5 (predictive cells) to L2/3 (grid forming cells). I can’t help but notice that there is a projection from L5 to the thalamus, and there are projections from the thalamus to L2/3 that could serve link in the output of the predictive layer. I don’t have a firm wiring diagram on how that could happen but it is a strong candidate and sussing out this possible connection is in the rather largish stack of things to look into in depth.

So little time, so many papers.

That is exactly why I favor L2/3, that, and the map-2-map connections originating in L2/3.

1 Like

I agree in principle - lateral connections are present all over the cortex.There are also inhibitory inter-neurons all over the cortical layers. My first take would be to establish a bias point where the cells operate efficiently.

A little further down the road is considering that there are possible large scale voting structures being formed on all layers but only L2/3 communicates between maps. I am unable to wrap my head around what kind of computing structures could emerge from this configuration. It seems like they would be constantly fighting each other and I am unable to establish how training might progress.Then again, considering the huge difference in axonal projection scale in different layers - it could offer some sort of connection between scales of representation. If someone could explain how such a thing might work I would be open to listening.

I really should have read about that a bit before I wrote it. I’m not sure it’s true. Here’s the only study I know of. It’s about inputs to L6 CT cells.

Photostimulation studies wouldn’t show distal inputs very well.

I assume lateral inputs are a large source of input in most layers because most layers form long lateral axons in themselves.

I can’t say for certain whether they share proximal input, but these sources are related to that i.e. not just anatomical.

L5st and L5tt

L6, and cited info about L4

If you haven’t, it might be worth making sure they don’t have apical trunks. One the other side of the sheet, in lower L6, apical dendrites often turn to the side and pretty much any direction. In L6 they’re called things like inverted, modified, horizontal, and tangential.


Are you referring to the idea that L5 fires predictively? I think there are a lot of different types of prediction, like temporal memory and possible objects (predictions of things on an object you haven’t fully sensed.) Maybe there’s some form of prediction that fits hex grids well. Maybe that’s temporal memory.

L5 slender tufted cells project to L2/3 a lot. L5 thick tufted cells do not project there much at all, and they project to the thalamus.
You could read about the core-matrix theory of thalamus if you haven’t. The projections from thalamus to L2/3/other layers others are different from the ones to L4/others. For example, they don’t respect hierarchy I believe. Dunno if that’s relevant.

In barrel cortex, L5tt -> thalamus -> L2/3 and L5st. L5 slender tufted cells are similar to L2/3 like that and other ways. I think thalamus-> L5st might not exist elsewhere though, and barrel cortex is two levels of hierarchy interdigitated as far as I can tell, so maybe that’s not a loop with thalamus.


Thanks for those papers, I’ll have a look at them.
In the meantime, wanted to address this. I’m oblivious to most electrochemical explanations, but I’ve formed the impression that most of those signalling specificities (NMDA spiking on distal parts, apical trunk “channel” etc) are first and foremost structural. For example, L4 spiny stellates are thought to be developmentally PCs with shrinked apical parts, and now each of their dendrites (even those “at the top”) behave kinda the same… it is with that understanding that I see L2 as not much more complex than stellates.

Yeah, there’s a lot of jargon that could be simplified into HTM-like concepts. The different parts of the dendrite do play different parts in integrating synaptic inputs though.

This article is relevant. L2 neurons at the top of L2 can have apical dendrites turned to the side, and some don’t appear to have an apical dendrite.

Sometimes L4 cells keep their apical dendrites, especially in cat V1 I recall. I don’t know if they do anything. In other layers, sometimes they don’t bother getting rid of their apical dendrite. They just lose most of their apical tuft.
I hate developmental remnants. L6b might be one, so I have no idea whether it does anything useful or is just there to waste time.


Yes still, of course. NMDA towards the tip and all. But no complex Ca2+ gating or whatever it is that makes apical trunks a pain to model. That at least was my take.

Yup not all L4 are stellates.

About L6 “degenerate” apicals : in a recent message to bitking, I hypothetised that this would ideally place them to apically sense a single L5 minicolumn “bursting” in the HTM sense, ready to send such novelty/surprise signal to Thalamus (for attention related mechanisms to kick in, hopefully)