Entropy Scaling And Intrinsic Memory

2Alex_Altair

2Alexander Gietelink Oldenziel

2Charlie Steiner

0David Hyland

3Alexander Gietelink Oldenziel

New Comment

I like this post for the way it illustrates how the probability distribution over blocks of strings changes as you increase block length.

Otherwise, I think the representation of other ideas and how they related to it is not very accurate, and might mislead reader about the consensus among academics.

As an example, strings where the frequency of substrings converges to a uniform distribution is are called "normal". The idea that this could be the definition of a random string was a big debate through the first half of the 20th century, as people tried to put probability theory on solid foundations. But you can have a fixed, deterministic program that generates normal strings! And so people generally rejected this ideas as the definition of random. Algorithmic information theory uses the definition of Martin-Löf random, which is that an (infinite) string is random if it can't be compressed by any program (with a bunch of subtleties and distinctions in there).

Yes, that's right. For instance, the decimal expansion of pi is thought to be normal (but iirc unproven). The ideas in these post can all be found in academic texts.

Do let us know any specific text in text that you think is misleading or false! Thanks 😊

I'm writing this comment without checking the internet, but I don't quite see the analogy to renormalization. In renormalization you might, for example, have a theory about some scale that can be interpreted as making predictions about the next scale, and these theories at different scales all have the same form but maybe different parameters, so you can solve the whole stack at once.

This post doesn't really have theories. I suppose you could loosely interpret frequentism as a theory here, and say that the future will continue with the same distribution as the past, but this theory is terrible for renormalization, because it means that as you change scales you expect pure randomness to dominate. I'd categorize this post more as about phenomenology - maybe "phenomenological scaling" or "phenomenological coarse-graining."

I like these posts! Could you share any pointers or thoughts on how this framework extends to situations where you're not passively observing a stream of information, but your actions affect the incoming bits?

Relatedly, is there a way to capture the idea of performing maximally informative experiments to extract as much structure from the (anticipated) bit stream as possible?

This is the second post in a series that explores a circle of ideas around entropy and information processing in complex systems. We hope it will form an accessible introduction to James Crutchfield's Computational Mechanics framework.

In the previous post we saw that

In this post we will show that we can characterize both structure and randomness in a systemby looking at how

entropy (irreducible uncertainty) changes over increasing scales. This will lead to ways in which we can understand transformer function in language tasks.## Structure is found in how entropy scales

We want something conceptually in between the randomness of Shannon Entropy and the determinism of Kolmogorov complexity. The way to bridge the gap is by realizing that systems that have deterministic structure at large scales look random from the perspective of entropy at short scales, but look less and less random as we increase the scale. In other words,the way randomness turns into structure at longer scales tells us many computational properties of the a system. Let's see how this works.

if we can't see far or remember a lot, then thingsseemrandom, and as we see farther and remember more, structure is revealed.And what's more is thatImagine we come across some mystery data:

...00110100100100110110110100110100100100110110110100100110110100...

Let's assume that we don't know how it was generated.

Notice that the frequency of 0 and 1's is equal in our string.

So maybe it's just a random string generated by a fair coin? After all, if we compare to the distribution of 0s and 1s of a string generated by a fair coin we get the same results.

That's a good initial guess but let's increase our scale and look at the length 2 blocks as well. By length 2 blocks we mean here the distribution over 00, 01, 10, and 11 in our data.

Notice that the 01 block occurs more often than the 00 block, so the statistics of our data are inconsistent with that of a fair coin at this larger scale;

our data looks less random at this longer scale than it did at the length 1 block scale. Maybe it's some kind of biased coin? Let's look at how our mystery data compares to that of a 75/25 biased coin for block lengths 2.Notice that in the length two blocks the biased coin has an asymmetry - the 00 and 11 blocks are not equal in frequency . This will be true of a string generated from coin flips with any bias, but is not true of our mystery string. Looking at the distribution over block length 3:

In our mystery string, the blocks 111 and 000 never occur! That's impossible for any data generated by coin flips, no matter how biased.

If the data is completely random, then at any block length, all possible blocks will occur.If the data is a completely structured sequence of a certain period, then some blocks will never occur!Technically speaking, when considering the distribution of length k blocks, random data will have nonzero frequency over all 2k possible blocks, whereas for any data string that has a period of N, if we look at the distribution of tokens of length k≥N there will be exactly N tokens of length k that occur with nonzero frequency.The main point here is that

deterministic sequences are associated with a constant distribution as you scale up block length,andrandom sequences are associated with2Noccurring blocks.Recall from the previous post how the mystery data was generated: you output 0, then 1, then you flip a fair coin, and then repeat.Our data was a mix of both a 'random' component and deterministic hidden structure. Recall that

data is a mixture of 'random' components and deterministic hidden structure.^{[3]}Let's look at the block distributions of the mystery data up to block length-9.As block length increases the number of occurring blocks does not stay constant, nor does every possible block occur! It is a mix of both random components and deterministic structure.

There is also fractal-like behavior. If you focus on the columns of the histograms you will notice a pattern that repeats (at a different scale) every time you increase the block length by 3. This has something to do with renormalization and scaling laws and fractals, but for now let's just leave it as a teaser.

## Entropy Rates, Block Entropy Diagrams and Memory

Recall our claim that

if we can't see far or remember a lot, then thingsseemrandom, and as we see farther and remember more, structure is revealed.And what's more is thatthe way randomness turns into structure at longer scales tells us many computational properties of the system.Here is the mystery string again....00110100100100110110110100110100100100110110110100100110110100...

Let's look at how the entropy of these distributions scales as block token length increases.

## Block Entropy Diagrams

Recall the basic intuition about entropy: entropy is a canonical measure of 'negative information'. It measures the 'irreducible uncertainty'. We want to look how this measure varies as we consider longer and longer block lengths (and therefore time-scales!)

Define the fundamental notion of

block entropy:H(L):=−∑sL∈ALP(sL)logP(sL)

Here AL is the set of all length-L blocks sL=siL=si...si+L and P(sL) denotes the frequency of that block sequence in the data. The block entropy measures the irreducible uncertainy when predicting block sequences of length L in the data set. For length L=1 we recover the naive Shannon entropy defined above. We can plot the block entropy as block length increases.

This is called the

block entropy diagram.Again, we see that the

data generated from coin flips are ever increasing straight lines,and the tworepeated deterministic strings flatten out once you hit the sequence length.Next define the block entropy rate at scale L to be

hμ(L):=H(L)−H(L−1)

What does this expression measure? It is often a fruitful tactic to examine the asymptotics of mathematical functions to understand. So let us examine its large L asymptotic limit.

## Entropy rate

The entropy rate hμ=limL→∞hμ(L) can be thought of as

allcorrelations over arbitrarily large blocks of tokens.What does the entropy rate look like for real text data? Researchers have tried to estimate the entropy rate of English text. We hope you now have some inkling the subtlety of this question. For instance: what texts do we look at? In reality we cannot take the large L limits so we have to pick some cutoff, et cetera. From a recent paper on the topic:

## Block Entropy Rate and Intrinsic Memory

Let's get back to the block entropy rate. Recall we defined the block entropy rate at scale L to be

hμ(L):=H(L)−H(L−1)

We can think ofhμ(L)as the

average uncertainty of the next symbol, given that the previousL−1symbols have been observed.Said differently: if you had a memory of size L−1, your estimate of the entropy (inherent uncertainty) of the process would be hμ(L)The block entropy rate at length L−1 can be thought of as the upper limit on how good your predictions can ideally be, with a memory of length L−1. Think of these as estimates of theentropy in the generating process.

trueblock entropy rate (taking L→∞), which is theactualirreducible^{^}Does the block entropy rate at scale L equal the physical memory in the system in some sense? This is fraught. It is better to say that the block entropy rate measures the 'apparent physical memory'. Some of the physical memory may be 'encrypted'.