One minor point, which I think I’ll make, because you may encounter earlier discussions and versions of HTM that could mislead you on the topic you are asking about (predictions further in the future than “t+1”). The name of the algorithm was changed from Temporal Pooling ( TP ) to “Temporal Memory” ( TM ) some time back. It was originally called TP because the algorithm performed both the memory function that it currently does of connecting active cells at “t” to active cells at “t-1”, as well as a pooling function whereby the predictions would “smear”, looking further and further into the future, by connecting cells to earlier and earlier timesteps the more frequently a learned sequence was encountered.
These two functions were actually always separated from a theoretical perspective (you can find slides in YouTube videos for some of Jeff’s earliest HTM talks back in like 2009, where the memory and pooling functions were called out separately). But for whatever reason, even though they were always understood to be separate functions in the theory, they were combined in the original implementation of the algorithm and it was called Temporal Pooling.
That latter pooling behavior was later removed from the algorithm, leaving only connection from “t” to “t-1”, and the name of the algorithm later changed to TM. I only point this out, because the term TP still has a place in HTM theory, but it now refers to only pooling behavior. This unfortunately causes a lot of confusion for folks who are new to HTM and don’t know it’s history.
Anyway, back to your question, the TM algorithm alone is only able to make prediction one time step into the future. This is to match how the connections work in biology. But to make HTM useful in practical ML applications, a lot of non-biological components are thrown into the mix. One of these is the ability to predict further into the future that t+1.
There are a few different ways to implement this. One way is to hold a table of running averages on each cell for activity at “t+n” after that cell was active (where “n” is determined ahead of time). Since each cell is part of a high-order context, this works quite well (you are NOT asking “what is most likely to happen 25 timesteps after note G”, but something much more specific like "what is most likely to happen 25 timesteps after the 357th note of Bethoven’s 5th.