Every moment of our lives, our bodies are awash in sensory signals. Photons hit our retinas. Waves of compressed air collide with our eardrums. Volatile molecules bind to receptors in our nostrils, and chemicals slather our taste buds. Pressure and heat activate nerve endings in our skin. We are able to navigate this torrent because the brain does an enormous amount of data compression. Through a process known as categorization, the brain turns the messy, noisy, information-rich world into objects, people, concepts, and emotions that we can understand and act on at the level of experience.

In neuroscience’s traditional view, categorization happens at the very end of sensory processing. The brain passively receives sensory details, then decodes their features and matches them to stored templates in memory, like a clerk shuffling through a neural filing cabinet. But this approach to categorization struggles to account for the extraordinary flexibility in the way we assign labels to features of the world. On a clear day on an open street, a sudden rhythmic patter is a pigeon taking flight, yet when we’re walking down a dimly lit alley at night, the same sound is the shuffle of a stranger’s footsteps. How can the brain categorize similar sets of sensory signals in radically different ways for different situations?