Predictive models can enhance the salience of unanticipated input, and the neocortical laminar architecture is believed to be central to this computation. Here, we examined the role of a key potential node in model formation, layer (L) 6, using behavioral, electrophysiological and imaging methods in mouse somatosensory cortex. To test the contribution of L6, we applied weak optogenetic drive that changed which L6 neurons were sensory-responsive, without affecting overall firing rates in L6 or L2/3. This stimulation suppressed L2/3 deviance encoding, but maintained other stimulus encoding. The stimulation also selectively suppressed behavioral sensitivity to deviant stimuli without impacting baseline performance. In contrast, stronger L6 drive inhibited firing and suppressed overall sensory function. These findings indicate that, despite their sparse activity, specific ensembles of stimulus-driven L6 neurons are required to form neocortical predictions, and for their behavioral benefit. 45 50 55 60 65 70 75 2-Photon Imaging. A two-photon microscope (Bruker/Prairie Technologies) using an 8 kHz resonant galvanometer (CRS) for fast x-axis scanning, and a non-resonant galvanometer (Cambridge 6215) for y-axis increments was used. In Voigts, Deister and Moore Page 16/23 590 595 600 605 610 615 620 625 630 635 Code Availability. All custom software used in this study is freely available: Behavioral experiments were controlled using a custom state machine (www.github.com/open-ephys/behavioral_state_machine) written in Matlab via PCI DIO boards (National Instruments). Vibrissae were tracked using an automated tracker (Extended Data Figure 2, www.github.com/jvoigts/whisker_tracking). Spike sorting was performed using a custom manual sorting tool (www.github.com/open-ephys/simpleclust). Voigts, Deister and Moore Page 17/23 645 650 655 660 665 670 675 680 685 690