For the 6 mice that contributed to Figure S6 , the optic fiber was included as a part of the implant (200 μm multimode fiber, Thorlabs FG200UCC). The fiber was incorporated into the flexDrive such that it would occupy one of the guide tubes, which allowed the bottom surface of the fiber to be positioned perpendicular to the cortical surface. A 1.25 mm diameter stainless steel ferrule (SFLC270) was glued to the top side of the fiber, and polished to generate an even surface.

We implanted flexDrives constructed in-house, loaded with either 16 tetrodes or 4 tetrodes (). Tetrodes were made with Sandvik Kanthal HP Reid Precision Fine Tetrode Wire, Nickel-Chrome 0.012 mm diameter, and gold-plated to 200 – 400 kΩ impedence. The guide tube array was made with 33 ga polyamide tubes, resulting in ∼250 μm spacings. Two stainless-steel screws (0.6 or 0.8 mm diameter, 0.5 or 1 mm length) were electrically connected (soldered) to the electrode interface board (EIB) through stainless steel wire. These skull screws were implanted through skull to rest on top of the dura to serve as ground: one was positioned anterior to bregma and the other on the right hemisphere.

The surgical procedure for the 6 optogenetic mice ( Figure S6 ) were identical to the four detection-only mice, save for the addition of the viral injection step which succeeded the craniotomy and durotomy, and preceded the flexDrive implant. We injected the rAAV5-hSyn-Con/Fon–hChR2(H134R)-eYFP-WPRE (a gift from Karl Deisseroth, purchased from the Vector Core Facility at University of North Carolina Chapel Hill; titer 2.3х10vg/mL). This virus is a type of INTRSECT that allows expression of hChR2 in only the neurons that express both Cre and Flp (). In our case, the virus would express in just the GABAergic PV+ neurons, which addresses the concern that PV is expressed in a subset of layer 5 pyramidal neurons and other non-interneuron cells (). We injected in 3 coordinates per mouse at depth of 0.45 mm: 1.25 mm posterior and 3.25 mm left of bregma, 1 mm and 3 mm, 1.5 mm and 3.5 mm. For each injection coordinate, 0.5 μL was injected at 0.05 μL/min, and the injection pipette was left in place at the injection depth for 10 more minutes before being retracted from the brain.

Details of the surgical procedure and behavior control were reported in a prior study (). Mice were induced with isoflurane anesthesia (0.5 – 2% in oxygen 1 L/min) and secured in a stereotaxic apparatus. We injected slow-release buprenorphine subcutaneously (0.1 mg/kg; as an analgesic) and dexamethasone intraperitoneally (IP, 4 mg/kg; to prevent tissue swelling). Hair was removed from the scalp with hair-removal cream, followed by scalp cleansing with iodine solution and alcohol. Then, the skull was exposed by scalp incision. After the skull was cleaned, muscle resection was performed on the left side. A titanium headpost was affixed to the skull with adhesive luting cement (C&B Metabond). Next, a ∼1.5 mm–diameter craniotomy was drilled over barrel cortex of the left hemisphere, and subsequently a durotomy was performed. The guide tube array was centered at 1.25 mm posterior to bregma and 3.25 mm lateral to the midline. The drive body was angled 30 degrees relative to vertical to compensate for the curvature of barrel cortex. Once the implant was stably positioned, C&B Metabond and dental acrylic (All for Dentist) was placed around its base to seal its place. A drop of surgical lubricant (Surgilube) prevented dental acrylic from contacting the cortical surface. Mice were given ≥ 3 days to recover before the start of water restriction.

Tetrodes were lowered at the end of a session if the experimenter noticed that there were no single units detected from online sorting. Tetrodes were lowered by 1/8 turns, corresponding to ∼31.25 μm.

To obtain single unit activity (SUA), offline spike sorting was conducted manually using Simple Clust ( https://www.github.com/open-ephys/simpleclust ). Only the clusters that were well isolated were classified as SUA. After sorting, single units were classified into regular spiking (RS) and fast spiking (FS) units, based on the time between peak to trough (T) in their average spike waveform (RS if T> 0.4 ms, FS if T≤ 0.4ms; Figures S6 Aii and S6Bii).

Local field potentials (LFP) were defined as the continuous data down-sampled to 1000 Hz. Median filtering was applied concurrent with down-sampling, i.e., down-sampling was conducted by choosing the median every 30 samples. Spike detection was conducted online during data acquisition to visualize the relevance of a recording site, with the online criterion for spikes was whether 300 – 6000 Hz bandpass filtered data crossed a permissive threshold of −50 μV, in at least one of the four electrodes comprising each tetrode. Offline, spike threshold for each electrode was readjusted as 4 times the standard deviation of 300 – 6000 Hz bandpass filtered data. The standard deviation was approximated as the median value divided by 0.6745 (). Multi unit activity (MUA) for each tetrode was defined as spikes that crossed this threshold in at least one of the four electrodes of that tetrode (one MUA per tetrode, per session).

All electrophysiology data were collected using the Open Ephys system continuously, with a sampling rate of 30 kHz. Trial alignment was achieved through a synchronizing pulse output from the computer running the behavior control software, via an analog channel of a NI-DAQ device.

Behavior Training

Mice were water restricted for ≥ 7 days before start of training, during which time they were acclimated to being head-fixed on a fixed-axis styrofoam ball, where they could walk or run freely. Locomotion was tracked in a subset of sessions using a rotary encoder (E6B2-CWZ3E). Water was delivered through a syringe after each acclimation session.

When training began, the vibrissae were secured through a suture loop. All macrovibrissae posterior to the 4th arc on the right side were secured ∼3 mm from the mystacial pad. The suture loop, in turn, was fed through a glass capillary tube (0.8 mm outer diameter) glued to a piezoelectric bender (Noliac CMBP09). On each trial, 20 Hz vibratory vibrissal stimulus train (10 deflections, 500 ms) were delivered through the piezoelectric bender in the caudorostral direction, with a half-sine wave velocity profile that had fast rising phase (6 ms) and a slower relaxation phase (20 ms). The 10 deflections within each stimulus train of a trial were of the same amplitude. On a trial-by-trial basis, the stimulus amplitude was varied between 0 (a catch trial) to maximal amplitude (∼1 mm deflection) in a randomized manner. Before the start of each session, the experimenter set the overall percentage of maximal trials and 0 amplitude catch trials. The rest of the trials were submaximal trials, where the stimulus amplitude was randomly drawn from a uniform distribution between 0 and maximal amplitude. Throughout training, the percentage of maximal amplitude trials was gradually lowered to 10%, and the percentage of catch trials was gradually increased to 25%.

The mice initially learned the vibrissal deflection to reward association in sessions where every vibrissal deflection trial was paired with ∼3 μl water delivery regardless of the animal’s response. Vacuum suction followed 500 ms after every reward delivery, which removed any excess water not consumed by the animal in that trial. Mice learned the vibrissal deflection to reward association after about a week of reward-all training, at which point the animals would lick in anticipation of the reward with a stereotyped reaction time of ∼250 ms poststimulus onset (median 254 ms; IQR 187 – 389; Figure 5 B). When this behavior was observed (> 4 days of training), the reward-all phase of training was concluded.

During the subsequent phase performance was required for reward, and it was only delivered on detected (hit) trials where the mouse correctly reported detection by licking 0 – 700 ms of the stimulus onset (report window). Here, the consequence of non-detection (misses) was omission of reward. If the mouse falsely reported detection by licking during the 700 ms report window on catch trials, the trial outcome was classified as a false alarm. The consequence of false alarms was a 15 s timeout from the task, effectively delaying the next opportunity to obtain a reward. If the mouse correctly refrained from licking during the report window on catch trials, the outcome was classified as a correct reject. Inter-trial intervals (ITIs, defined as the interval between report window onsets) were randomly drawn from a uniform distribution ranging between 4.5 – 8 s. There was no cue indicating the start of each trial.

If the animal developed a habit of excessive impulsive licking, an ITI-reset was implemented until that habit was eliminated. In these sessions, licking during the ITI would prolong the ITI up to 10 times.

Mice were weighed before and after each session. If the mouse consumed ≥ 1 ml of water throughout a behavior session, the mouse would gain ∼0.7 g at the end of a behavior session. Hence, if the mouse did not gain ≥ 0.7 g during the behavior session, supplementary water was given several hours after the conclusion of the session, so that the mouse would have drunk at least 1 mL each day. In addition, mouse weight was monitored throughout the duration of training and maintained ≥ 80% of their original weight at the time of surgery. The duration of training ranged between 3 to 7 months.