The evolution of lossy compression

In complex environments, there are costs to both ignorance and perception. An organism needs to track fitness-relevant information about its world, but the more information it tracks, the more resources it must devote to memory and processing. Rate-distortion theory shows that, when errors are allowed, remarkably efficient internal representations can be found by biologically-plausible hill-climbing mechanisms. We identify two regimes: a high-fidelity regime where perceptual costs scale logarithmically with environmental complexity, and a low-fidelity regime where perceptual costs are, remarkably, independent of the environment. When environmental complexity is rising, Darwinian evolution should drive organisms to the threshold between the high- and low-fidelity regimes. Organisms that code efficiently will find themselves able to make, just barely, the most subtle distinctions in their environment.

To survive, organisms must extract useful information from the environment.This is true over an individual's lifetime, when neural spikes [1], signaling molecules [2,3], or epigenetic markers [4] encode transient features, as well as at the population level and over generational timescales, where the genome can be understood as hard-wiring facts about the environments under which it evolved [5].Processing infrastructure may be built dynamically in response to environmental complexity [6][7][8][9], but organisms cannot retain all potentially useful information because the real world is too complicated.Instead, they can reduce resource demands by tracking a smaller number of features [10][11][12][13][14].
When they do this, evolved organisms are expected to structure their perceptual systems to avoid dangerous confusions (not mistaking tigers for bushes) while strategically containing processing costs by allowing for ambiguity (using a single representation for both tigers and lions)-a form of lossy compression that avoids storing unnecessary and less-useful information.
We use the informal language of mammalian perception for our examples here, but similar concerns apply to, for example, a cellular signaling system which might need to distinguish temperature signals from signs of low pH, while tolerating confusion of high temperature with low oxygenation.We include memory of both low-level percepts and the higher-level concepts they create and that play a role in decision-making [15][16][17].Memory costs include error-correction and circuit redundancy necessary to process and transmit in noisy systems [18].
In order to quantify this tradeoff, we must first characterize the costs of confusion.We do so using a distortion measure, d(x, x), that represents the cost to the organism of mistaking one environmental state, x, for a different state, x.When d(x, x) is large, mistaking state x for state x is costly.This distortion measure need not be symmetric (it is more costly to mistake a tiger for a bush than to mistake a bush for a tiger) and not all off-diagonal elements need be large (it is not necessarily more costly to mistake a tiger for a lion).We assume that d(x, x) is zero for every state x-that with a well-chosen action policy, we can do no better perceptually than to faithfully record our environment.
A great deal of effort has gone into choosing good distortion measures [14,[19][20][21].It turns out that we can make surprisingly specific predictions about how the organism's memory scales with environmental complexity under mild assumptions about the substrate for memory storage, the distortion function and (implicitly) the organism's action policy, and the structure of the environment's pasts.
For any environment, there is a the minimal cost to misperceiving an environmental signal, d min , equal to min x =x d(x, x); pairs x and x that satisfy this bound are called "minimal confounds".When an organism attempts to achieve average distortion below this minimal level, we shall see that a critical transition occurs in how processing costs scale with complexity.This happens when d min is independent of the size of the environment.The d min threshold separates out a low-and high-fidelity regime.
In a low-fidelity regime, when an organism's average distortion is larger than d min , increasing environmental complexity does not increase perceptual load.As the number of environmental states increases, innocuous synonyms accumulate.They do so sufficiently fast that an organism can continue to represent the fitness-relevant features within constant memory.
It is only in a high-fidelity regime, when an organism attempts to achieve average distortions below d min , that memory load becomes sensitive to complexity.Highfidelity representations of the world do not scale; an organism that attempts to break this threshold will find that, when the number of environmental states increases, its own perceptual apparatus must also increase in size.
As we shall see, the existence of this threshold has important implications for the evolution of perception.

I. RATE DISTORTION THEORY
We quantify the tradeoff between memory storage and perceptual distortion using rate-distortion theory [22,Ch. 8].Rate-distortion allows us to determine the extent to which the representations needed to completely describe a source (here, the organism's environment) can be compressed by selectively discarding information.This is lossy compression, in the sense that once the signal is encoded it becomes impossible to completely reconstruct the original.The process is represented by a codebook, p(r|x), which describes the probability that an environmental state x (drawn from the set X) is represented by a symbol r (drawn from the set R).
Careful choice of p(r|x) allows for the organism to conserve resources that would otherwise be committed to the retention of information.Information theory provides a mechanism-independent lower bound on these costs.In particular, the (effective) number of states stored by an organism's codebook, per input from the environment, is lower-bounded by 2 I[R;X] .Here, mutual information quantifies the drop in uncertainty about the environment given the perceptual state, where H[X] is the entropy (uncertainty) of the environment, and H[X|R] is the conditional entropy, given knowledge of the perceptual state r.I[R; X] quantifies the cost of memory for this lossy representation.It provides a strict lower bound to the costs of retention and storage, independent of mechanism.
While biological systems are unlikely to precisely saturate this bound, evidence from a variety of sources shows that the pressure to store information as efficiently as possible, given fitness constraints, strongly influences evolved design, including the genetic code for amino acids [23] and neural representations of visual scenes [24].Simple arguments show that, for neural codes, I[R; X] is an achievable lower bound on the number of neurons required to encode the environment at (an action-policy dependent) average distortion D (see Supplementary Information).
To quantify over a variety of possible environments, we consider cases where the off-diagonal entries of d(x, x) are drawn from a distribution.Doing so allows us to study complicated environments with many degrees of freedom, and in which some mistakes are more costly than others.We begin with the case where d(x, x) entries are drawn independently; however, as we shall show, our bounds generalize beyond this and include environments with correlated penalties.
Our problem is then that of finding an optimal codebook given an upper bound on average costs.We wish to build the most efficient perceptual system possible as long as, on average, the cost to the organism of errors induced by that codebook does not exceed some critical value, D. We can combine these two demands into a single minimization problem, where we find the minimal storage cost, R(D), given the fitness constraint, where E[d] is the average value of d(x, r) given p(x) (distribution over environmental states, taken to be uniform) and the codebook (to be found), p(r|x).
The rate, R(D), in bits, quantifies processing cost; 2 R(D) is the average cardinality of the organism's partition of the environment, which can be considered the effective number of internal representations, N eff , that the organism can use.The rate R(D) is the best measure of processing cost when an organism's mechanisms include the ability to efficiently compress incoming sensory information.In our account of how perceptual costs scale with environmental complexity, we plot R(D) as a function of the number of environmental states N .
Eq. 2 is related to the information bottleneck method introduced by Ref. [19].In that program, the distortion measure is itself an information theoretic quantity-a particularly useful choice for engineering and machinelearning applications [25].Here, by contrast, we have introduced environmental structure; it is this external structure, in the form of d(x, x), that dictates the nature of the representations that the system uses.
Once we allow the average error rate, D, to become non-zero-i.e., once organisms can trade off perceptual and memory costs with accuracy-solutions of Eq. 2 provide a guide to how this tradeoff happens in practice.As we shall see, depending on accuracy demands, an individual will find itself in either a low-or high-fidelity regime, with qualitatively different properties.

II. THE LOW-FIDELITY REGIME
Once accuracy costs can be greater than d min , we can achieve dramatically reduced bounds on storage.When organisms are tolerant to failure, they need only attend to a fraction of the environment.Furthermore, memory demands on a fault-tolerant organism increase far more slowly than the complexity of the environment.
We study this first through simulations; Fig. 1 shows results for optimal codebooks when error costs are exponentially and log-normally distributed; in both cases d min is zero.An environment with hundreds of states can be compressed down to a few dozen at the cost of only 1% in overall fitness.
Remarkably, when the organism's average error tolerance is greater than d min , the slow growth in processing costs, apparent in the simulations, asymptotes to a constant.The suggestive results of the simulations can be confirmed by simple analytic argument.For each of the FIG. 1. Fault-tolerant organisms can radically simplify their environment.When an organism can tolerate errors in perception, large savings in storage are possible.Shown here is the scaling between environmental complexity, N , and processing costs R(D), when we constrain the average distortion, D to be 1% and 0.1% of the average cost of random guessing.We consider both environments with exponential and with log-normal (heavy-tailed) fitness; in both cases, dmin is equal to zero.A simple argument (see text) shows that in this low-fidelity regime, and as N goes to infinity, perceptual demands asymptote to a constant.
N environmental states, and overall error constraint D, there will be, on average, N P (d < D) states that are allowable ambiguities-i.e., that the organism can take as synonyms for that percept.While this is not the most efficient coding, it provides an upper bound to the optimal rate R(D).
The rate for such an encoding is approximately log N − log N P (d < D), which becomes exact in the large N limit.This means that both the encoding rate, R(D) and the effective symbol size go to a constant; effective symbol size proportional to the inverse of the conditional probability distribution, 1/P (d < D), and R(D) to its logarithm.More generally, R(D) is bounded from above so that where N D (x) is the number of synonyms for x with distortion penalty less than D (see Supplementary Information).This fact is independent of the underlying distribution.As long as N D is asymptotically proportional to N , this upper bound implies asymptotic insensitivity to the number of states of the environment.This is the case even when off diagonal entries are partially correlated, as long as correlation scales grow more slowly than environment size so that N D ∝ N .
For the exponential this upper bound means that ambiguities accumulate sufficiently fast that the organism will need at most 6.6 bits (for D equal to 1%) or 10 bits (for D equal to 0.1%) even when the set of environmental states becomes arbitrarily large.
This bound is not tight; as can be seen in Fig. 1, far better compressions are possible, and the system asymptotes at much lower values.When N becomes large, these compressions are more reliably obtained (i.e., the variance in compression rate decreases rapidly, so that most fitness functions one draws can be compressed to a nearly identical extent).These empirical results show not only the validity of the bound, but that actual behavior has a rapid asymptote; in both the exponential and log-normal cases, the scaling of N eff is already sub-logarithmic in N .
That the bound relies on the conditional distribution function means that our results are robust to heavy-tailed distributions.What matters is the existence of harmless synonyms; for the states we end up being forbidden to confuse, penalties can be arbitrarily large.We can see this in Fig. 1, where we consider a log-normal distribution with mean and variance chosen so that P (d < 0.1%) is identical to the exponential case.The existence of large penalties in the log-normal case does not affect the asymptotic behavior.
This remarkable result has, at first, a counterintuitive feel.As environmental richness rises, it seems that the organism should have to track increasing numbers of states.However, the compression efficiency depends on the difference between environmental uncertainty before and after optimal compression, and these two differences, in the asymptotic limit, scale identically with N .
The existence of asymptotic bounds on memory can also be understood by an example from software engineering.As the web grows in size, a search tool such as Google needs to track an increasing number of pages (environmental complexity rises).If the growth of the web is uniform, and the tool is well-built, however, the number of keywords a user needs to put into the search query does not change over time.For any particular query-"information theory neuroscience", say-the results returned will vary, as more and more relevant pages are created (ambiguity rises), but the user will be similarly satisfied with the results (error costs remain low). 1

III. THE HIGH-FIDELITY REGIME
As we approach d min , the bound given by 1/P (d < D) becomes increasingly weak, diverging when D is at the minimal confound level.As we approach this threshold, we enter the high-fidelity regime, where organisms attempt to distinguish difference at a fine-grained level.
In this regime, where we attempt to achieve lower error-rates than those of the minimal confounds, we can no longer allow for strict synonyms between a subselection of the off-diagonal elements.Our codebook, p(r|x), must attempt to break the degeneracy between the true environmental state and off-diagonal elements; as the environmental complexity increases, this task, in explicit contrast to the low-fidelity regime, becomes harder as the environment becomes richer.
As in the previous case, we can upper-bound coding costs by construction of a sub-optimal codebook; we can also lower-bound costs by finding the optimal codebook for a strictly less-stringent environment.Coding costs are then bounded between (see Supplementary Information) where d is the average off-diagonal cost in the environment.These bounds hold in the high-fidelity regime where D ≤ d min .
The distributions-exponential and log-normaldescribed in the previous section do not have a highfidelity regime; as environmental complexity rises, so does the number of harmless synonyms.If, however, we put a floor on these distributions, so that there is always a strictly non-zero penalty for confusion, the scaling of Eq. 4 appears.Fig. 2 compares these two regimes-the low-fidelity regime of Eq. 3, and the high-fidelity regime of Eq. 4-for error costs with d(x, x) greater than unity, and distributed exponentially.In the low-fidelity regime, D > 1, we see the same asymptotic complexity as in Fig. 1; when we try to achieve bounds below the minimal confound, the lower bound of Eq. 4 becomes relevant, and R(D) scales logarithmically with N (equivalently, N eff is a power-law in N , with N eff equal to N in the zero error limit).
The change-over is shown graphically in Fig. 2. While processing costs for the low-fidelity regime asymptote to a constant as N becomes large, the lower bound for the high-fidelity regime provides an asymptotic limit to the slope of the N eff curve on a log-log plot (equivalently, a R(D) ∼ log N relationship).This holds true even when FIG. 2. The high-fidelity regime is sensitive to environmental complexity.Shown here are encoding costs for the shifted exponential distribution, where all errors have a minimal penalty, dmin, of one.When we allow average distortions to be greater than dmin, we are in the low-fidelity regime, and costs, as measured by R(D), become constant.In the high-fidelity regime, when D is less than dmin, costs continue to increase, becoming asymptotically power-law in N eff , or logarithmic in R(D); the dashed line shows the asymptotic (in this case) square-root scaling for D/dmin equal to 1/2.The change-over from constant to this power-law scaling happens around D ∼ dmin.A simple argument suggests that evolution under increasing complexity will drive organisms to this transition point.environmental costs are correlated; the lower panel of Fig. 2 shows the same curves where the unconditioned cost distributions are identical, but we have induced pairwise correlations by averaging each row with a shuffled version of itself (except for the diagonal point, which remains zero).

IV. EVOLUTION AND POISED PERCEPTION
An organism's fitness includes both its error rate, D, and the processing costs associated with achieving that rate, R(D).Under the simplifying assumption that these costs add independently, and taking processing costs to be proportional to R(D), we can take an organism's fitness, F to be a monotonically decreasing function of total cost D +β −1 R(D), which takes into account the costs of both error and perceptual processing.The Lagrange multiplier, β, characterises the error-computation tradeoff.This basic linear tradeoff is a natural choice that has been the basis of studies of encoding in molecular biological systems (Ref.[2] and references therein).
Evolutionary processes tend to maximize fitness at the population level; the fitness of an organism can be thought of as its reproductive rate relative to average.Whatever the value of β, a higher than average fitness will, given sufficiently faithful reproduction, translate into exponential gains for that organism and its descendants.Rather than considering absolute differences we can then focus on rank order-what changes cause the fitness to rise or fall relative to baseline.
For any particular β tradeoff, there will be a unique, fitness-optimal solution.Because fitness is convex in the choice of the codebook [19,Thm. 3], finding the optimal point corresponds to an unsupervised classification of sensory signals based on gradient descent.It is thus a natural task for an organism's neural system [26][27][28][29], and also corresponds to the simplest models of selection in evolutionary time [30].
By finding new and more efficient mechanisms to process information, evolution can increase an individual's β. 2 This enables the individual to make finer and finer distinctions and thereby both lower D and raise its fitness.In the low-fidelity regime, when organisms compete in this fashion, their gains in accuracy are independent of increases in environmental complexity.As they increase β through evolutionary innovation, individuals will find an optimal fitness point at lower and lower values of D. Above the d min threshold, even large changes in N will leave the optimal D for any particular β unchanged.Low-fidelity perceptual systems are robust to large changes in environmental complexity.
As D approaches, and then goes below, d min , the picture changes drastically.Organisms may compete to lower D, but gains are transitory when the environment is itself changing.In particular, increases in environmental complexity mean that R(D) will now rise at least logarithmically as N increases.For the lower bound, we have so that, when N increases, organisms at the lower bound can lower costs by going to larger D. (This derivative relationship holds even when the bound is not tight, but R(D) takes the form f (D) log 2 N , with f (D) independent of N , since R(D) is a decreasing function of D.More generally still, as N increases, the growing lower bound of Eq. 4 means that costs in the high-fidelity regime will eventually exceed the fixed costs of solutions around D ∼ d min .)Since fitness is a monotonic function of cost, the new fitness maximum will also lie in the direction of larger D. As complexity rises, organisms in the high-fidelity regime will be driven towards d min , at the threshold between high and low-fidelity perception.This driving force, towards larger D, also holds when we take the costs to scale with effective symbol number, N eff , which is exponential in R(D).
Taken together, these results imply that, when organisms compete in an environment of rising complexity, we expect to find their perceptual apparatus poised around D ∼ d min .We refer to this as poised perception.
Organisms will compete on processing efficiency, increasing β and pushing D downward.This process is asymptotically insensitive to environmental complexity until a transition region around d min .Beyond this point, rising complexity provides a counter-force.When N is large and rising on timescales faster than those on which evolution increases β, we expect organisms to stall out at this threshold.Even when they are poised around d min , increasing β will still give an individual an evolutionary advantage; the effect of a changing environment is to force organisms to compete on efficiency, rather than richness of internal representations.

V. DISCUSSION
Where there is an accuracy-memory tradeoff, our results suggest that organisms in environments of rising complexity will find themselves able to distinguish minimal confounds, but no more.
We expect this to happen when the number of categories to be distinguished can rise.It is worth considering what happens when the environment has a hierarchical structure, and where there may be a fixed number of coarse-grained distinctions that are crucial to maintain, such as those between predator and prey, kin and non-kin, in-group and out-group.
Because of this hierarchical structure we do not expect organisms to have a single system for representing their environment.The results here then apply to subdomains of the perceptual problem.In the case of predator-prey, for example, we expect optimal codebooks will look block-diagonal, with a clear predator-prey distinction, and then subdistinctions for the two categories (eagle vs. leopard; inedible vs. edible plants).
For the large distinction, N is fixed, but environmental complexity can increase within each category.As new forms of predators or prey arise, the arguments here suggest that organisms will be poised at the thresholds within each subsystem.When, for example, prey may be toxic, predators will evolve to distinguish toxic from non-toxic prey, but tend not to distinguish between nearsynonyms within either the toxic or non-toxic categories.
Such an effect may influence the evolution of Batesian mimicry-where a non-toxic prey species imitates a toxic one-when such mimicry is driven by the perceptual abilities of predators [31].Our arguments here suggest that predator perception evolves in such a way that Batesian mimics will have a phenotypic range similar to that found between two toxic species.A harmless Batesian mimic can then emerge if it can approximate, in appearance, a toxic species by roughly the same amount as that species resembles a second species, also toxic.This also suggests that a diversity of equally-toxic species will lead to less-accurate mimicry.This is not because a mimic will attempt to model different species simultaneously (the multimodal hypothesis [32]), rather that predators who attempt to make finer-grained distinctions within the toxic-species space will find themselves driven back to d min when the total number of species increases.
Our results also have implications for the cognitive and social sciences.A small number of coarse-grained distinctions are often found in human social cognition, where we expect a block-diagonal structure over a small, fixed number of categories (kin vs. non-kin, in-group vs. out-group).Within each of the large distinctions, our representational systems are then tasked with making finegrained distinctions over sets of varying size.
When we attempt to make distinctions within a subcategory of increasing size, our results suggest that we will be barely competent at making the least important distinctions.Informally, we are just barely able to distinguish our least-important friends when our circles expand.Such ideas might be tested in a laboratory-based study that trains subjects on a set of increasingly difficult distinction tasks with varying rewards.The results here predict that, as they improve their decisionmaking abilities, individuals will develop representations that are barely able to make distinctions between the least-important cases.
Our results on poised perception apply when environments can increase in complexity over time and when perceptual systems struggle to represent and process environmental states.Rate-distortion theory provides new quantitative insight into the underlying structure of this problem.While not all perception problems take this form, those that do are key evolutionary drivers of increased perceptual and cognitive ability.

Appendix A: Supplementary Information
In this Appendix, we provide more discussion of the basic rate-distortion set-up and connect it to recent progress in understanding the sensorimotor loop.We present extended derivations of the results presented in the main text.And we present results that suggest, in the low-fidelity regime, a distribution-dependent universality in the rate-distortion curve We begin with a typical reinforcement learning setup [33].An agent takes a total of T actions a 0 , . . ., a T throughout its life in response to an environment whose state at any given timestep i is x i .The actions that the agent takes are, we assume, dependent only on the sensory percepts that the agent has stored at timestep i, xi .We denote this by writing a i as a i (x i ).In principle, these percepts can take into account information about the environment's past as well as its current state.The reward that an agent receives upon taking a particular action a i (x i ) is taken to be a function of the environment's present state x i , r(x i , a i (x i )).The agent accumulates a total reward of over its lifetime.In principle, this reward function could depend upon the environment's past as well as its present state [21,[34][35][36]; this additional layer of complexity is unnecessary to make the present point.Much work in reinforcement learning has focused on choosing optimal action policies.However, good action policies require accurate or nearly-accurate sensory perceptions.If we mistake a lion for a deer, we will probably die, despite having an optimal plan in place once we see a deer.We thus limits to our sensory models given finite resource constraints.
When the joint time series of inputs and actions is stationary, we can move from viewing the environment and the agent's actions as time series to viewing them as realizations of a stochastic process characterized by probability distributions Pr(X = x, X = x, A = a).This probability distribution implicitly allows for random action policies; a deterministic action policy would imply that Pr(A = a| X = x) = δ a,a(x) .The assumption from earlier that the action policy depends on the environment only through the sensory percept is more compactly described as X → X → A when we view the environmental state, the agent's sensory percept, and the agent's actions as random variables.And finally, the total reward is now expressible as so we find it convenient to define an expected reward of E[r] = R T ≈ x,x,a Pr(X = x, X = x, A = a)r(x, a(x)).Many real-world situations ask us to model environments which are prohibitively large, and recording the present environmental state with perfect fidelity is unreasonable given finite memory, energy, and other resource constraints.These constraints are thought to be relevant to how organisms actually function, e.g., as in Refs.[37][38][39][40], though the particular way in which these resource constraints affect organism computation might depend strongly on the organism's specific memory substrate.For example, E. coli bacteria, which store information about concentration gradients in the stochastic behavior of their ligand-gated ion channels, will have different energy, timing, and space costs than a human who stores information about more complex environments in everything from the structure of dendritic trees to the higher-level structure of cortical columns and all the way up to the maintenance of external records made possible by symbolic systems and writing.
Despite this, rate-distortion theory provides insight into the tradeoff between the quality of an agent's perception of the environment and the memory required to store those perceptions, regardless of the particular biological substrate for that memory.In economics, this realization goes under the name of "rational inattention" [14]; in theoretical neuroscience, this idea has taken hold in a few recent papers [41,42], though more attention has been focused on the lossless limit [43].These ideas are related to, but distinct from, Bayesian inference.We focus only on the memory limitations related to storing sensory information and not those related to taking action; see Refs.[21,34] and references therein for efforts on the latter.
To make these general ideas concrete, we focus on an agent with n neurons which communicate sensory information to higher cortical levels by their collective state at each time step.There are a total of 2 n possible states of these n neurons, implying a maximal rate of log 2 2 n = n bits per input symbol.For more direct connection with the language of rate-distortion theory, we think about our actions not as opportunities to reap rewards, but as potentially lost opportunities to reap higher rewards.If we fail to faithfully record an environmental state x with the sensory percept x, then our actions will necessarily fall short of the optimal actions.For each environmental state x and action policy Pr(A| X), there is some maximum reward r * (x) achieved by faithfully recording x in our sensory percept with an expected maximal reward of The rate-distortion theorem implies that min or, in words, that the implicitly action policy dependent rate-distortion function is a lower bound on the number of sensory neurons.For details, see Refs.[22] or other standard information theory texts.This bound may or may not be tight, though there is preliminary evidence that the bound is surprisingly tight [41,42].We emphasize that this example was used to illustrate an even more general point.In other setups, this rate-distortion function may be a lower bound on the number of hidden states in an ion channel, for instance.
The questions that we ask in this manuscript do not require that this bound be tight; rather, we aim to ask how R(D) scales with the number of environmental states N , and hope that the scaling relations provided are tight even if the specific bound is not.A key quantity, d min , is the minimal price we pay for not faithfully transmitting the environmental state: and pairs that satisfy this bound are called "minimal confounds".Despite the generality of this setup, there are apparently two different regimes for how R(D) scales with N .When D ≤ d min , then R(D) scales logarithmically with N ; when D > d min , then R(D) asymptotes to a constant as N tends to infinity.(This somewhat surprising result might be anticipated by an earlier theorem [44] showing that the optimal lossy representations of continuous random variables are discrete.)Additional structure in the environment would likely contribute to delineation of further scaling regimes, which we do not pursue here.
If we assume that we should choose the minimal D such that we have some robustness to sudden increases in environmental complexity-i.e., such that R(D) does not increase greatly with N -then our results suggest that D is optimally set to be d min .

An example: random environments
To obtain some intuition, we consider the case that distortions are chosen i.i.d.from a distribution with probability density function φ. (From our earlier construction, on-diagonal entries are set to d(x, x) = 0.) See Fig. 1 in the main text, giving R(D) for several D for various distributions φ and N .These numerical experiments suggest a weak universality in rate-distortion functions, apparent from the increasingly small variance in R(D) for different random distortion matrices: as N → ∞, R(D) is a statistic of φ and is independent of the specific distortion measure.If true, this conjecture implies that the required resources might be time-invariant even if the reward function is not.
We now ask how φ affects the scaling of R(D) with N .When we mean-shift φ by d min , R(D) starts to show deviations from the weak universality just described.Two different random distortion measures with the same φ and N still produce nearly identical R(D).But for expected distortions D < d min , R(D) appears to grow logarithmically with N , while for expected distortions D ≥ d min , R(D) tends to a constant, independent of N .This is shown in Fig. 4.

Scaling of n with N depends on desired reward
We can use analytic upper and lower bounds to explain some of the results found above.Define the minimal distortion The former is the distortion in the best-possible miscoding.The latter is the expected distortion when we choose our actions independently of the environment.Also, assume that inputs are equiprobable, p(x) = 1 N for all x.First, we upper bound the rate-distortion function in the high-fidelity regime using the suboptimal codebook

FIG. 3 .FIG. 4 .
FIG.3.Rate-distortion functions for φ(x) = e −x for increasing N .First five plots: rate-distortion functions for five different samples of the distortion measure; from left to right, we show N of 20, 50, 100, 200 and 300.Rate-distortion functions for different draws from the d(x, x) ensemble are nearly identical as N gets large.Bottom right plot: the means of the rate-distortion functions over the ensemble of matrices for various N .As N increases, these appear to limit to a rate-distortion function which is everywhere bounded.

C ≤ 1 . 2 N − H b D d min − D d min log 2 (N − 1 )
Symmetry implies that p(x) = 1 N for all x.This codebook has an expected distortion ofd = x,x p(x)p(x|x)d(x, x) = C N (N − 1) x =x d(x, x) = C d, (A9)and a rate ofI[X; X] = H[ X] − H[ X|X] = log 2 N − 1 N x H[ X|X = x] (A10)where application of the additivity axiom showsH[ X|X = x] = H b [C] + C log 2 (N − 1).(A11)Together, this givesI[X; X] = log 2 N − H b [C] − C log 2 (N − 1) = log 2 N − H b d d − d d log 2 (N − 1).(A12)Hence, when D ≤ d, the rate-distortion function is upper-bounded byR(D) ≤ log 2 N − H b D d − D d log 2 (N − 1) ≈ 1 − D d log 2 N. (A13) Next, we lower-bound the rate-distortion function by lower-bounding the distortion-rate function, D(R) := min p(x|x):I[X; X]≤R d .(A14)This is (by construction) greater than or equal to the distortion-rate function for the distortion measure,d L (x, x) = 0 x = x d min x = x .(A15)By symmetry, the optimal codebook for this distortion measure takes the form of the suboptimal codebooks above.(It is straightforward to check that those suboptimal codebooks satisfy the nonlinear equations in Thm. 3 of Ref.[19].)Hence, the rate-distortion function is lower-bounded:log ≤ R(D),(A16)valid when D ≤ d min .Together, the two bounds implylog 2 N − H b D d min − D d min log 2 (N − 1) ≤ R(D) ≤ log 2 N − H b D d − D d log 2 (N − 1) (A17)when D ≤ d min .In the large N limit, we find that1 − D d min log 2 N ≤ R(D) ≤ 1 − D d log 2 N. (A18)So, the rate-distortion function and the required number of neurons scale logarithmically with the number of inputs