Abstract
Animals exhibit remarkable behavioral flexibility, robustly performing demanding tasks —such as searching for food or avoiding predators— in a variety of different contextual and environmental conditions. However, the demands that detecting and adjusting to changes in the environment place on a sensory system often differ from the demands associated with performing a specific behavioral task, even when both objectives rely on the same sensory modality. This necessitates neural encoding strategies that can dynamically balance these conflicting needs. Here, we develop a theoretical framework that explains how this balance can be achieved, and we use this framework to study tradeoffs in speed, performance, and information transmission that arise as a consequence of efficient coding in dynamic environments. This work generalizes current theories of efficient neural coding to dynamic environments, and thereby provides a unifying perspective on adaptive neural dynamics across different sensory systems, environments, and tasks.