How sensory systems rapidly adapt to changing stimulus statistics remains unclear. Here the authors show that gain adaptation in recurrent networks can implement fast efficient coding, unifying prior ...