MINI REVIEW article

Front. Comput. Neurosci., 18 September 2026

Volume 20 - 2026 | https://doi.org/10.3389/fncom.2026.1924396

Design principles for cost functions in optimal sensory coding

  • Institute for Neural Information Processing, University Medical Center Hamburg-Eppendorf (UKE), Hamburg, Germany

Abstract

Studies of neural codes for sensory variables are rooted in the long-established principle that neural codes are organized to encode as much information as possible about sensory stimuli. This principle has been successful in explaining many features of neural activity, suggesting that a key component of a cost function determining sensory neural coding from first principles is the stimulus encoding error. However, recent work has shown that neural cost functions may have other terms reflecting costs or limitations of the biological hardware. One key piece is the metabolic cost of neural activity. Including metabolic cost in the cost function leads to optimized spiking models that exhibit spike-triggered adaptation. Another possible component of the neural cost function is reliable downstream transmission of information. Neurons have short integration time constants, which make it difficult for information to be transmitted reliably unless inputs to neurons are correlated. This suggests that cost functions accounting for constraints on downstream readout promote codes with redundancy-inducing correlations. We review and discuss evidence that neural codes in the brain have features consistent with the predictions expected if cost functions have additional terms beyond the encoding error. Adaptation currents are indeed present in biological neurons with the time scales predicted by metabolically efficient codes, and neural population codes have information-reducing correlations that support downstream information transmission. Finally, we discuss future directions important for fully establishing the different contributions to neural cost functions.

Introduction

A central question for understanding biological intelligence concerns the principles determining how sensory information is encoded, processed and transmitted through the activity of neurons and neural populations. Seminal early work introduced the idea that sensory information processing should be analyzed in terms of the information carried by neural signals and the constraints imposed by their finite signaling capacity. Normative theories of neural computation proposed that sensory systems are organized to maximize information about external stimuli (; ), or to minimize errors in stimulus reconstruction, prediction, or dynamical representation (; ). These theories have provided powerful frameworks for understanding neural activity in terms of the computations it supports. In particular, they have provided compelling explanations for observed neural activity features such as response non-linearities, adaptation to stimulus statistics, and redundancy reduction in early sensory systems (Simoncelli and Olshausen, 2001).

The optimality of a neural code depends on the criteria used to define it. These criteria are formalized by a cost function that needs to be minimized to achieve optimality. The traditionally considered cost function focuses on accurately encoding input stimuli and has been operationalized as the root mean squared error or minus the mutual information between the neurally-represented and target sensory signals. However, a cost function might contain other components in addition to the term for sensory encoding. Neural activity is metabolically expensive (), and spikes and synaptic transmission impose significant costs on the organism (). Thus, a neural cost function may also contain a metabolic cost term that penalizes high activity levels. Adding metabolic constraints to the cost function can substantially change which sensory representations are optimal compared with costs based on encoding accuracy alone. Further, information present in one neural population is not necessarily fully available to downstream circuits. Downstream neurons read out information through biophysical mechanisms with short integration windows and non-linear input-output functions which are more effective when operating on correlated population activity. Therefore, cost functions may also include downstream-readout constraints and favor neural codes that differ from codes optimized only for stimulus encoding, such as codes with redundant correlations ().

Here, we review studies suggesting that cost functions of biological neural populations may include constraints beyond those for optimal sensory coding. We focus on constraints that we investigated in our recent work, namely metabolic cost (; ) and downstream readout (; Valente et al., 2021; Safaai et al., 2025; ), and discuss experimental observations supporting this view. We discuss both how these constraints can be applied to cost functions defined at the single neuron level, potentially explaining experimental properties of single neurons, or at the population level, potentially revealing the consequences for optimal computations of different types of relationships between neurons and enabling the design of optimal networks.

Efficient coding based on sensory encoding and adaptation to stimulus statistics

An early formulation of efficient coding is the hypothesis that neurons and neural systems optimize a cost function maximizing the information they encode about external stimuli (; ). A central result of studies investigating optimal neural coding of sensory information is that sensory coding must adapt to the statistical properties of the sensory stimuli. Because the neural response range is limited, efficient codes should allocate their range preferentially to stimulus values that occur frequently or carry high behavioral relevance, which means that optimal sensory responses should reflect key aspects of the statistics of the stimuli that an organism encounters.

Because of this, neurons and networks optimizing sensory coding must also adapt optimally to changes in stimulus statistics. Experimental and theoretical work has provided evidence that neurons in the sensory periphery and sensory cortex adjust their responses to changes in the distribution of sensory stimuli (Simoncelli and Olshausen, 2001). ) showed that a single neuron (H1) in the fly sensory system adapts to changes in stimulus variance by rescaling its input-output function. When stimulus variance increased, the input-output function became shallower and covered a wider range of stimulus values. When stimulus variance decreased, it instead became steeper and concentrated sensitivity over a narrower stimulus range. ) extended this work considering the information-theoretic optimal adaptation of neural population responses to changes in stimulus statistics. They derived population codes that optimally trade-off the need to encode accurately the current incoming stimuli with the contrasting need to detect and adapt to sudden changes in stimulus statistics. These optimal population codes have properties closely resembling those observed in real cortical population responses during adaptation.

Together, these studies show the power of sensory-encoding-based cost functions to understand from first principles the responses of neurons and populations to sensory stimuli.

Trade-off between encoding error and metabolic cost

Because neural activity is metabolically expensive, neural computations are likely constrained by metabolic expenditure (). Thus, several studies incorporated metabolic cost into single neuron or population cost functions. At the level of single neurons, Wang et al. (2016) analytically derived monotonic tuning curves that optimize information transmission for given stimulus statistics under metabolic constraints, finding that metabolic constraints strongly shape sensory tuning curves. When the metabolic constraint is not included, information-optimal tuning curves follow the histogram equalization principle suggested by ), so that neural response levels are used uniformly across the available dynamic range. Including the metabolic constraint instead biases responses toward lower firing rates.

Other models introduced metabolic constraints at the level of neural populations. Instead of focusing on how neural populations minimize their encoding error when stimulus statistics changes, these studies asked how a neural population optimizes its parameters for a fixed stimulus distribution under both sensory coding and metabolic constraints. The problem of designing such efficient recurrent networks has been addressed first with rate models (Zhu and Rozell, 2013; ; ; ; ) and then with spiking-neuron models (hereafter termed models of efficient coding with spikes). Here, we focus on models of efficient coding with spikes because they are more biologically plausible.

These models have considered how a whole recurrent neural network can minimizes the sum of a population-level encoding error of a time-dependent stimulus signal and a population-level metabolic cost of spiking (). The encoding error penalizes inaccurate representations of the target signal, whereas the metabolic cost penalizes recent spiking activity. Minimizing this efficiency cost function therefore favors accurate signal representation with few spikes. The occurrence of each spike is conditioned on a decrease of the instantaneous loss. Each spike is thus timed to decrease the loss. More generally, fine-grained spike timing allows more information to be processed with the same number of spikes and may reduce energy cost relative to implementations not exploiting it (Verzi et al., 2018).

The efficient-coding cost function can be implemented by recurrently connected networks of leaky integrate-and-fire neurons (). The structured recurrent connectivity derived from the cost function shapes network activity in both stimulus-driven and spontaneous states (). Efficient spiking models reproduce empirically observed levels of single-neuron variability and yield neural representations that are robust to neuronal loss (), neuron-intrinsic noise, synaptic delays (, ) and perturbations to population activity (). Moreover, local learning rules can approximate the optimal synaptic connectivity prescribed by analytical derivations of efficiency cost functions by maintaining time-dependent balance between excitatory (E) and inhibitory (I) synaptic currents in the presence of error feedback signal (; ).

A key property of biological networks is Dale's law: a neuron uses the same neurotransmitter on all of its outgoing synapses. Unlike what happens when using cost functions that do not separate neurons into cell types, assigning separate cost functions to E and I neurons yields E-I efficient spiking networks that obey Dale's law (; ). By design, efficient E-I spiking networks keep firing rates and representational error bounded at all times (Urdu et al., 2025). In such E-I efficient networks, parameters that optimize the trade-off between average encoding error and metabolic cost correspond to a biologically realistic parameter set that matches measurements from primary sensory cortex (). These results indicate that E-I-specific cost functions that trade off encoding accuracy against metabolic cost can capture key properties of sensory cortical networks and highlight the relevance of cell-type-specific cost functions.

In a series of studies, we and others investigated the effect of including metabolic cost in the cost function in networks designed to encode low-dimensional time-varying signals, that is, signals made of few independent features (; ; ; ; ; Zeldenrust et al., 2021). In such networks, metabolic cost adds a constant term to the firing threshold (), reducing spike probability. When single-neuron and population readouts have different time constants, the same cost function also prescribes neuron-intrinsic currents (). Under additional constraints, these currents can produce slow () or fast spike-triggered adaptation (). Spike-triggered adaptation transiently hyperpolarizes the membrane potential after a spike and reduces subsequent excitability, with an amplitude that increases with the relative weight of metabolic cost in the cost function. Thus, metabolic cost does not only suppress firing but also changes the timing of spikes selected by the efficiency cost function. These results suggest that the after hyperpolarization currents widely observed in biological neurons (Shao et al., 1999; Storm, 1987) may be understood as the result of optimizing sensory coding while controlling its metabolic cost.

We asked whether adding metabolic cost to sensory coding cost affects the optimized network parameters and resulting neural response features (; ). We first derived properties of networks designed to optimize a cost function that includes both encoding error and metabolic cost. To illustrate the specific contribution of the metabolic cost, we then compared networks optimized either for encoding error alone or for the sum of encoding error and metabolic cost, while keeping everything else identical (Figure 1A). We jointly optimized four parameters: the membrane time constant, the noise intensity, the ratio of E to I neuron numbers, and the ratio of average I-I to E-I connectivity strength. After optimization, both models tracked time-dependent target signals with similar accuracy (Figure 1B, black for target signals and red for E-population estimates). However, they converged to distinct parameter regimes. Compared with networks optimizing encoding error and metabolic cost, networks optimizing encoding error alone had lower noise and weaker inhibition, while the E-I neuron number ratio did not differ systematically between the two cost functions (Figure 1C, black and magenta for networks optimizing error alone and the sum of error and cost). Differences in optimized parameters translated into differences in network activity (Figure 1D). The network optimizing the encoding error alone had slightly higher firing rates and significantly lower trial-to-trial variability. In particular, the network including metabolic cost had Fano Factor (the ratio of the variance to the mean across trials of spike counts) close to 1, whereas the network optimizing only the coding error had Fano Factor close to 0.5. These differences are consistent with the lower noise intensity and weaker inhibition (Figure 1C). Thus, optimizing metabolic cost does not simply reduce firing, but shapes response variability. Because the trial-to-trial variability of sensory cortical neurons is close to that of a Poisson process (), including metabolic cost makes the activity of efficient spiking networks more biologically realistic.

Figure 1

). Both models have the same E-I architecture, receive the same stimulus s(t), and estimate the same target signal x(t). The encoding error is the average of the E- and I-population encoding errors. The E-population encoding error is the squared error between the E-population readout and the target signal x(t). The I-population encoding error is the squared error between the E- and I-population readouts. The stimulus consisted of three independent Ornstein-Uhlenbeck processes. (B) The target signal (solid black) and E-population readout (signal estimate; dashed red) in the best performing network minimizing the encoding error alone (top) or the sum of the encoding error and the metabolic cost (bottom). The best network minimizing the linear sum of encoding error and metabolic cost recovered the same set of parameters as reported in Ref. (). (C) Parameters of the 15 best networks (lowest training loss) minimizing the encoding error alone (black) or the sum of the encoding error and the metabolic cost (magenta). The error bars show the mean ± standard deviation. The non-zero optimal noise levels found in both network types (left) are consistent with analytical results (Timcheck et al., 2022) (D) Firing rate (left), Fano factor (middle) and the time-averaged net sum of E and I synaptic inputs to single neurons (right) computed on the best performing network of each type. Results are shown for E (red) and I neurons (blue). I neurons have higher firing rates and therefore higher metabolic expenditure than E neurons in both network types. The Fano factor, which measures spike-count variability, is significantly lower in the network minimizing the encoding error alone. Further, the net synaptic input in I neurons is dominated by excitation in the network minimizing the encoding error and dominated by inhibition in the network minimizing the sum of the encoding error and the metabolic cost, indicating a transition between the two network types from an excitation-dominated to an inhibition-dominated regime in I neurons. In both network types, the time-averaged net synaptic input is also more negative in E than in I neurons. Each distribution is across neurons. For (B–D), we used 100 parameter initializations and 5 random seeds. All initializations reached convergence. For (B) and (D), we tested network performance on new Ornstein-Uhlenbeck stimuli generated with the same parameters as the training stimuli. For (D), we used 100 simulation trials of 1 s duration and averaged results across trials. The Fano factor was measured on spike counts in 100 ms time bins. Please note that panels C (middle), C (right), and D (middle) report unitless quantities.

Further, a cost function with only encoding-error optimization prescribes structured recurrent connectivity that in turn promotes temporal E-I balance, defined as the ability to maintain a tight balance of E and I synaptic inputs to each neuron at each time instant (). Including the metabolic constraint increased temporal E-I balance () and enforced an inhibition-dominated regime, in which I synaptic inputs were stronger than E inputs (Figure 1D, right; see ref ). Including the metabolic cost therefore resulted in neural dynamics consistent with two empirical observations in sensory cortex: synaptic excitation and inhibition are coordinated over time (), and inhibition often dominates ().

Trade-offs between information encoding and information transmission

The notion that neural codes optimize information encoding has also permeated the study of neural population codes (; ; ). Many studies considered which features of population activity enhance the amount of information encoded in a neural population, under the assumption that neural population codes maximize encoding of information within the same population. For example, several studies have investigated how the information encoded by populations depends on the sparseness of neural representations (intuitively, the fraction of active neurons at any given time), finding that very low values of sparseness maximize the information per spike, a measure which combines encoding quality and metabolic cost (; ; ).

A feature of neural activity that has received substantial attention in terms of its contribution to the encoded information is the correlations between neurons (; ). Modeling studies have investigated how the strength and structure of correlations between neurons affect the amount of information about sensory stimuli that the responses of a population carry (; ; ). Correlations between the activity of different neurons can either increase, decrease or leave unchanged the information carried by a population. Their effect depends on several factors, the main one being the relative sign of noise and signal correlations. Noise correlations quantify the correlations between the activity of neurons at fixed stimulus. Signal correlations quantify the correlations between the trial-averaged activity across different stimuli. When signal and noise correlations have the same sign, noise correlations decrease information (Figure 2A, left). When they have opposite signs, noise correlations increase information (Figure 2A, right). In most experimental studies on sensory cortices or decision-making areas, noise correlations were found to decrease information. This was shown by comparing information decoded from the real simultaneously recorded responses of the neural population (which contains noise correlations) and the decoding of the stimulus from pseudo-population responses obtained from randomly shuffling responses of different neurons from trial to the same stimulus to destroy noise correlations (as in Figure 2A, center). The information in shuffled responses is often higher than that in the real responses (; ; ; ).

Figure 2

These results suggest that a neural code optimized solely for population-level encoding should not contain information-limiting correlations. However, such correlations are commonly found in cortical data (; ). Does this imply that neural population codes are not designed optimally? Or does it mean that they are designed optimally with a cost function containing terms other than encoding? A clue to this answer was found in a series of recordings from mouse cortex during perceptual decisions, which reported that correlations were information limiting but yet were stronger in trials in which mice made correct perceptual judgments, compared to trials when mice made incorrect judgements (; Valente et al., 2021; Safaai et al., 2025; ).

One possibility to explain these results is that the downstream readout of information to produce choices is facilitated by correlations. We demonstrated this in a recent study in which we constructed a statistical model of single-trial choices made by the mouse based on the information in neural activity in the same trial. We found that the probability of making a choice that followed the stimulus inferred as the most likely by decoding neural activity was higher when responses of neurons were more correlated (Valente et al., 2021; Safaai et al., 2025; ). This implies that information encoded in the activity of neurons can be more effectively used for downstream decisions if responses have some level of correlations. We also studied this with biophysical models of propagation of synaptic signals through the membrane of a neuron (Figure 2B). Because of short membrane integration time constants, activity is better propagated if correlations cluster spikes closer to each other in time (Figure 2B). An analytical study of this model () shows that moderate, intermediate correlation strength maximizes the amount of information transmitted through the membrane of the neuron (Figure 2B). The values of correlations maximizing the amount of transmitted information are roughly comparable to the range of values observed in cortical neurons ().

These results suggests that neural codes are not optimized to encode information locally, but to trade off the need to encode information with the need to transmit it. How to optimally trade off these demands may depend on the primary function of the brain area, with a study suggesting that population codes in sensory areas have weaker correlations to weigh more sensory coding and populations in decision-making areas have stronger correlations to weigh more downstream transmission ().

Discussion

Sensory-encoding-based neural cost functions have proven successful for explaining response properties of sensory neurons. We reviewed how adding additional biologically-plausible constrains may change these results. Adding constraints on metabolic expenditure leads to designing biologically plausible E-I networks that reproduce additional single-neuron and network-level properties of sensory cortex. Adding constraints on downstream readability leads to population codes that allow redundant correlations to promote information transmission to downstream areas at the cost of possibly reducing the encoded information.

A first direction for future work is to understand how to jointly optimize encoding accuracy, transmission to downstream readouts, and metabolic cost. Multilayer spiking networks provide a natural setting, because they allow cost functions that constrain both the encoding of information at one layer and their transmission across layers. Such models could form important theoretical counterparts to empirical studies of organization of neural codes in projection pathways (Safaai et al., 2025). We hypothesize that incorporating information transmission into cost functions would lead to networks with higher across-neuron correlation strength.

A second direction is to ask how richer computations can be implemented efficiently. Cortical neurons often non-linearly combine different afferent features. For example, primary somatosensory neurons non-linearly combine information from different types of skin receptors (). It remains unknown how to capture complex feature interactions, for example mutually amplificatory and suppressive interactions, in efficient coding models. Other important computations include linear dynamical signal transformations, such as converting transient inputs into damped oscillations (), and non-linear transformations, such as generating persistent attractor states ().

A third direction is to understand the relationship between efficient coding and low-rank recurrent networks (; ), especially those producing target outputs that solve cognitive tasks (). The recurrent connectivity optimizing cost functions with sensory and metabolic cost has low-rank structure determined by the dimensionality of the encoded stimuli (; ). It would be interesting to examine how metabolic cost may change the optimal connectivity rank, for example selecting among degenerate solutions by preserving stiff dimensions that strongly affect coding performance while suppressing energetically costly dimensions with little coding benefit.

Statements

Author contributions

VK: Conceptualization, Writing – original draft, Writing – review & editing, Visualization. SP: Conceptualization, Writing – original draft, Writing – review & editing.

Funding

The author(s) declared that financial support was received for this work and/or its publication. This work was supported by the German Federal Ministry of Education and Research (BMBF 01GQ2404).

Acknowledgments

We thank S. Deneve, S. Blanco Malerba, G. Bondanelli and T. Schwalger for valuable collaborations.

Conflict of interest

The author(s) declared that this work was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

Generative AI statement

The author(s) declared that Generative AI was not used in the creation of this manuscript.

Any alternative text (alt text) provided alongside figures in this article has been generated by Frontiers with the support of artificial intelligence and reasonable efforts have been made to ensure accuracy, including review by the authors wherever possible. If you identify any issues, please contact us.

Publisher’s note

All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.

References

Summary

Keywords

correlations, efficient coding, neural coding, population coding, sensory coding, spiking neural networks

Citation

Koren V and Panzeri S (2026) Design principles for cost functions in optimal sensory coding. Front. Comput. Neurosci. 20:1924396. doi: 10.3389/fncom.2026.1924396

Received

30 June 2026

Revised

25 August 2026

Accepted

31 August 2026

Published

18 September 2026

Volume

20 - 2026

Edited by

Alireza Alemi, University of California, Davis, CA, United States

Reviewed by

Carlotta Martelli, Johannes Gutenberg University Mainz, Germany

Yuya Sato, Waseda University, Japan

Mario Antoine Aoun, Concordia University, Canada

Updates

Copyright

*Correspondence: Veronika Koren, ; Stefano Panzeri,

Disclaimer

All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article or claim that may be made by its manufacturer is not guaranteed or endorsed by the publisher.

Outline

Figures

Cite article

Copy to clipboard


Export citation file


Share article

Article metrics