Neocortico-hippocampal ripple-based coordination during naturalistic encoding

Memory formation relies on effective communication between the hippocampus and neocortical areas. Ripples have been proposed as a key neural signature facilitating information transmission in the brain. However, their role in human memory encoding during naturalistic scenarios remains unexplored. Here, we recorded intracranial electrophysiological data from ten epilepsy patients watching a movie. Ripples were analyzed in the hippocampus and in neocortical regions (i.e., temporal and frontal cortex). Our results revealed a coordinated neocortico-hippocampal ripple-based interaction during encoding. However, this interaction exhibited distinct timing patterns: ripples in the temporal cortex preceded those from the hippocampus which then preceded those from frontal cortex. Additionally, enhanced hippocampal ripple recruitment was observed at event boundaries, reflecting hippocampal involvement in event segmentation. These findings shed light on the neural mechanisms underlying memory encoding and provide insights into the role of ripples in event segmentation, suggesting their potential role in forming long-term memories of distinct episodes.


Introduction
In the process of encoding an event, effective communication between the hippocampus and cortical areas is of utmost importance for memory formation (Baldassano et al. 2017;Geerligs et al. 2021;Ranganath et al. 2005;Reagh and Ranganath 2023).Among the different patterns of neural activity, sharp wave ripples (SWRs) have emerged as a distinct neural signature involved in the transmission of information within the brain.SWRs are characterized by sharp, high-frequency neural oscillations that occur in a highly coordinated and precisely timed manner (Bragin et al. 1999) and can be observed in the local field potential (LFP) signal.Extensive studies conducted in rats have demonstrated that these transient events are accompanied by widespread changes in neural states in both cortical and subcortical regions (Karimi Abadchi et al. 2020;Gomperts, Kloosterman, and Wilson 2015).It is believed that ripples indicate replay of hippocampal activity and information transfer between hippocampus and neocortex, facilitating efficient interaction during memory formation and consolidation (Todorova and Zugaro 2020;Vaz et al. 2019;Norman et al. 2021;Dickey et al. 2022).Recent studies have provided evidence for the occurrence of this specific type of neural activity in the human hippocampus (Norman et al. 2019;Vaz et al. 2020;Axmacher, Elger, and Fell 2008), suggesting that it also plays a role in facilitating the formation and retrieval of episodic memories in humans too (Kunz et al. 2022;Sakon and Kahana 2022).However, whether the formation of a memory during naturalistic encoding, where episodic information unfolds continuously, is mediated by ripple events remains unexplored.
Understanding the cognitive and neural underpinnings of episodic memory formation in realistic environments is largely influenced by the view that continuous experiences are rapidly transformed into discrete episodic units via the detection of event boundaries (Zacks et al. 2007).Indeed, event segmentation affects not only our perception of an experience, but its subsequent organization in long-term memory (Kurby and Zacks 2008;Radvansky 2012;Sargent et al. 2013), such that elements within an event are bound together more cohesively than elements across events (Ezzyat and Davachi 2011;DuBrow and Davachi 2013;2014;Horner et al. 2016).Processing at event boundaries has been associated with improved longterm memory for the corresponding event (Newtson and Engquist 1976;Schwan, Garsoffky, and Hesse 2000;Schwan and Garsoffky 2004).Intriguingly, while the hippocampus has been shown to be particularly active during these moments (Ben-Yakov, Eshel, and Dudai 2013;Baldassano et al. 2017;Ben-Yakov and Henson 2018), neocortical regions have been shown to support memory encoding within events themselves (Reagh and Ranganath 2023).
Here, our aim was to examine the dynamic coordinated pattern of hippocampal-neocortical ripple-based interaction supporting the formation of memories for realistic encoding.Previous research has focused on the detection of ripples during sleep or during awake periods where participants had to encode discrete stimuli.In this study, we investigate, for the first time, the occurrence of this type of neural activity within a continuous and dynamic stream of information.To address this question, we recorded intracranial electrophysiological data simultaneously from the hippocampus, frontal cortex and temporal cortex of patients undergoing treatment for pharmacologically intractable epilepsy, while they were watching the first 50 min of the first episode of BBC's Sherlock.Building upon earlier evidence of widespread ripple occurrence across the cortex, we examined whether ripples co-occurred in diverse cortical areas throughout the encoding of an event and investigated their impact on activity in other regions.Simultaneously, to assess if ripple activity reflected the specific hippocampal recruitment at event boundaries seen in previous fMRI studies (Ben-Yakov, Eshel, and Dudai 2013;Baldassano et al. 2017;Ben-Yakov and Henson 2018), we studied how the ripple rate fluctuated around boundaries at the hippocampus and neocortical regions and compared it with the ripple rate within events.Overall, this study provides compelling evidence for a cortico-hippocampal ripple-based coordinated activity during the encoding of continuous and naturalistic stimuli.

Hippocampal and neocortical ripples during movie encoding
To investigate the timing and functional role of ripples during the encoding of naturalistic stimuli, we recorded electrophysiological activity from intracranial electrodes implanted in ten epileptic patients while they watched the first 50 min of the first episode of BBC's Sherlock (Fig. 1a), a stimulus already used in previous research (Chen et al. 2017;Baldassano et al. 2017;Silva, Baldassano, and Fuentemilla 2019).They were then asked to freely recall the episode while being recorded using an audio recorder.An event model composed by 38 events and validated in Silva, Baldassano, and Fuentemilla 2019 was used for the current analysis.On average, we found that most of the participants were successful in recalling the encoded events (M = 40.79%,SD = 11.18%), and were accurate in maintaining the order in which the events were presented in the movie during recall (mean Kendall  = 0.74, p < 0.01), similar to previous findings in healthy participants (Silva, Baldassano, and Fuentemilla 2019).
We identified human ripples during the encoding of the movie by examining LFPs from bipolar macroelectrode channels located at the anterior and middle hippocampus and middle and superior temporal cortex of all ten participants and from electrodes located at rostral medial frontal cortex in six participants (Fig. 1b).Following previous ripple detection methods (Vaz et al. 2019;2020) we identified a total of 5288 hippocampal and 4756 temporal cortex ripples across all 10 participants and 2965 frontal cortex ripples across the six participants.The identified ripples exhibited a power peak at ~90 Hz (Fig. 1d-f) and a mean duration of 35 ms (Fig. 1g,h,i; Supplementary Fig. 1), consistent with previous studies in humans (Axmacher, Elger, and Fell 2008;Norman et al. 2019;Vaz et al. 2019;Kunz et al. 2022;Sakon and Kahana 2022).However, we observed that the Inter-Ripple-Interval (IRI), the time between successive ripples (Fig. 1g-i), was ~6 sec and thus considerably longer than reported in previous human studies on task-induced ripple activity (Vaz et al. 2020;Norman et al. 2019;Kunz et al. 2022).This discrepancy suggests that the temporal dynamics of ripples may vary between naturally occurring memory processes and memory formation during cue-locked task conditions.
We next analyzed whether ripples occurred predominantly during specific phases of delta band activity (0.5-4Hz), in line with the possibility that ripple occurrence tend to cluster around specific neural states of the ongoing activity (Sirota et al., 2003).Consistent with previous findings (Axmacher, Elger, and Fell 2008;Kunz et al. 2022), we found that hippocampus and neocortical ripples were phase coupled to the ongoing delta rhythm (Fig. 1j,k,l), (p < 0.001 for all regions).Ripples in hippocampus and temporal cortex were found to occur at different phases of the ongoing delta oscillations (Kuiper test, p < 0.001; Hippocampal Mean = ~194º; Temporal Cortex Mean = ~320º; Supplementary Fig. 2b).In the frontal cortex, ripples aligned with specific delta phases at individual level as well (Kuiper test, p = 0.005; Frontal Cortex Mean = ~250º; Supplementary Fig. 2b).Interestingly, however, among the 6 participants, ripples were sometimes locked to the same delta phases as hippocampal ripples, while they were locked to similar delta phases as ripples in the temporal cortex in other participants (Supplementary Fig. 2a), perhaps due to the inherent variability of the orientation of the implanted electrode in frontal regions.We hypothesized that there would be higher ripple occurrence at the hippocampus than in the neocortex; for ripples at the hippocampus to occur closer to event boundaries and ripples at the neocortex to occur within events; and for ripples in the hippocampus and neocortex to co-occur temporally.b) Left: Temporal cortex (red) and frontal cortex (green) electrode localizations from all participants mapped into common space, shown on a three-dimensional model.Right: Hippocampal electrode locations, each color representing one participant.Each pair of dots indicates the two electrodes from the participants used for bipolar referencing, resulting in one trace per patient.c) Example of procedure for identifying ripples.Top to bottom: raw LFP; LFP filtered in the 80-120 Hz ripple band; envelope of the ripple-band LFP.In green an example of an identified ripple is shown.d) Grand-average voltage trace of hippocampal ripples across all channels in the LFP (<200Hz) time domain and z-scored power spectrogram in the timefrequency domain, with time 0 corresponding to ripple peak.e) Similar for temporal cortex and f) frontal cortex.g) Distribution of ripple durations (green) and inter-ripple intervals (IRIs) (red), across all participants for hippocampus, h) similarly for temporal cortex and i) frontal cortex.j) Inter-trial phase coherence (ITPC) values across ripples (green) and surrogate data (gray), for hippocampus, k) similarly for temporal cortex and l) frontal cortex.For all boxplots, the central mark is the median, and the edges of the box are the 25th and 75th percentiles.* Significant at group level (p < 0.05).
Next, we sought to explore whether the frequency occurrence of ripples during encoding of the movie were predictive of memory recollection of movie events during the subsequent recall test.To address this issue, we compared the rate of ripples, normalized by the length of each event, occurring within events that were remembered or forgotten.Our findings suggest that during the encoding of naturalistic and continuous stimuli, the rate of ripple activity may have a selective direct mechanistic conduit of memory formation depending on the brain region (Fig. 2).Ripple occurrence at temporal cortex was significantly higher during the encoding of subsequently remembered versus forgotten movie events (t(9) = 3.25, p = 0.01), whereas no significant differences were found for hippocampal (t(9) = -0.66,p = 0.53) or frontal cortex events (t(5) = 0.28, p = 0.79).The current results highlight the relevance of temporal cortex in determining successful encoding, which is in line with studies in humans showing that the direct stimulation of temporal cortex, but not hippocampus or frontal cortex, improves memory formation (Ezzyat et al. 2018;Kahana et al. 2023).

Hippocampal-neocortical ripple-based interaction during movie encoding
Having shown that ripples occur during movie encoding in both hippocampus and neocortical regions but exhibit different functional properties, we next examined their interaction across regions.Indeed, rodent research has shown that coordinated peri-ripple activity in the hippocampal-neocortical network is essential for mnemonic information processing in the brain (Buzsáki 2015;1989;Schwindel and McNaughton 2011;Qin et al. 1997).However, most of these findings are derived from observations of ripple activity during periods of sleep, where ripples align with Slow Oscillations (SO) (Skelin et al. 2021), supporting the idea that widespread concurrent ripple patterns optimize synaptic plasticity for memory consolidation (Buzsáki 2015;Sadowski, Jones, and Mellor 2016).However, SOs are not present during wakefulness, and the precise pattern of hippocampal-neocortical ripple-based interaction during this state remains less clear.
We then first tested whether ripple events in neocortical regions were temporally coupled to hippocampal ripples during the encoding of the 50 min movie.To quantify the temporal relationship between ripples in hippocampus and temporal and frontal cortex, we calculated the cross-correlation between the ripple time series of these brain regions.Our analysis revealed a statistically significant peak of correlation between temporal and hippocampal ripples at approximately a 540 ms time lag, when compared to surrogate data using a cluster permutation test (cluster permutation test, tmax = 2.93, p < 0.001) (Fig. 3a).This finding provides evidence that temporal cortex ripples tend to occur before hippocampal ripples during the encoding of movie events.Conversely, frontal cortex ripples tended to occur approximately 270 ms after hippocampal ripples (cluster permutation test, tmax = 2.88, p < 0.001) (Fig. 3b).These results suggest that during movie encoding there is a dynamic, temporally orchestrated, feedforward interaction between hippocampal and neocortical ripples, with frontal ripples leading, followed by hippocampal ripples, and then temporal cortex ripples.Additionally, the fact that ripples in temporal cortex occur before hippocampus supports models positing that information is transferred during waking state from cortex to hippocampus for memory encoding while a reverse pattern may occur during memory retrieval (Marr 1971;McClelland, McNaughton, and O'Reilly 1995;Nadel and Moscovitch 1997;Kunz et al. 2022;Vaz et al. 2019).
To investigate the potential involvement of ripple-based temporal coordination between hippocampal and neocortical regions in the formation of memories during movie viewing, we then calculated cross-correlation values between the time series of the two regions, as we had done previously, separately for the time-series of ripples occurring during recalled events and the one of ripples occurring during forgotten events.By averaging the correlation values for the identified significant cluster, we observed that the temporal relationship between hippocampal and temporal cortex ripples was only present for events that were later recalled (t(9)=2.56,p = 0.03), while no difference between recalled and forgotten was found when considering the temporal relationship between hippocampus and frontal cortex (t(5)=-0.37,p=0.73) We next explored how the interaction of hippocampal and neocortical ripples was related to neural state changes as reflected in the power of LFP oscillations.We first examined LFP power changes in frontal and temporal cortical regions locked to the occurrence of hippocampal ripples.This analysis revealed a reduction of LFP power in high frequencies (>20Hz) of the temporal cortex around hippocampal ripples (cluster permutation test, tmax = -5.42,tmean = -3.25,p < 0.001) (Fig. 3c).A similar, but briefer decrease in LFP power at high frequencies (>20Hz) was also found at frontal regions around hippocampal ripples (cluster permutation test, tmax =-6.72, tmean = -3.66,p = 0.002) (Fig. 3d).These results are consistent with recent rodent studies highlighting that, unlike during sleep, neocortical activity is dominated by inhibition around awake ripples (Karimi Abadchi et al. 2023).
Having observed that neocortical activity is strongly modulated during hippocampal ripples, we investigated whether the reverse was also the case -i.e., whether hippocampal activity was modulated during neocortical ripples.This analysis revealed a marked decrease of hippocampal LFP power at low frequencies (<20Hz) around the onset of temporal cortex ripples (cluster permutation test, tmax = -7.40,tmean = -3.25,p < 0.001 (Fig. 3e).Statistically weaker, though in the same direction, were observed during frontal cortex ripples (cluster permutation test, tmax = -6.31,tmean = -3.96,p = 0.047) (Fig. 3f).Overall, the results show that during the encoding of continuous and naturalistic stimuli the hippocampus-neocortical ripple-based interaction emerges consistently in a timing continuum, with temporal cortex ripples preceding hippocampal ripples by ~540ms, which in turn precede frontal ripples by ~270ms.Thus, unlike the unidirectional hippocampal-to-neocortical ripplebased interactions seen during memory retrieval (Vaz et al. 2019;Kunz et al. 2022), the current evidence provides support to models that posit that information is transferred during waking from cortex to hippocampus for memory encoding.Additionally it also indicates, in line with rodent studies (Karimi Abadchi et al. 2020;Dickey et al. 2022) that the directionality of this interaction, and the neural neocortical and hippocampal state changes associated ripples, is heterogeneous throughout the brain during the encoding of continuous stimuli.

Hippocampal ripples increase around movie event boundaries
Event boundaries -i.e.time points at which there is a shift in one's current event model -are thought to be the moments in time when the organization and binding of information into longterm memory occurs (Ben-Yakov and Henson 2018; Baldassano et al. 2017;Silva, Baldassano, and Fuentemilla 2019).In line with findings in rodents that hippocampal ripples promote memory formation for just encoded events (Foster and Wilson 2006;Diba and Buzsáki 2007;Karlsson and Frank 2009), we next tested whether the occurrence of hippocampal ripples increased around event boundaries during movie viewing (Bilkey and Jensen 2021), possibly reflecting brief temporal opportunity windows of memory plasticity during awake encoding (Foster 2017).To test this hypothesis, we calculated a peri-boundary ripple rate by computing the peristimulus time histogram (PSTH) relative to all boundary onsets and compared it to a null distribution by shuffling the temporal order of the events while maintaining their lengths.We found a marked increase in hippocampal ripple activity concomitant with a reduction in neocortical electrode activity specifically at boundaries (Fig. 4).The increase of hippocampal ripples at boundaries is in line with fMRI studies which show that stronger event encoding was related to lower hippocampal activation during the event and a high activation at its offset (i.e., at boundaries) (Ben-Yakov and Henson 2018; Baldassano et al. 2017).The decrease activity in the cortex could be indicative of a switching mechanism in which neocortical regions need to be silenced at moments in which resources have to be concentrated at the hippocampus (Logothetis et al. 2012).

Discussion
Real life experiences entail an unbroken succession of interconnected information, connecting different moments together.Nevertheless, the neural mechanisms underlying episodic memory formation amid the continuous flow of stimuli remain elusive.In this study, we recorded intracranial electrophysiological data from the human brain to examine the properties and interactions of ripples in hippocampus and in frontal and temporal cortex while participants watched a movie.We found that ripples co-occurred in the hippocampus and neocortical areas during the encoding of an event.This temporal dynamic had an impact on the memory encoding of an event, as ripples occurring in the temporal cortex predicted later recollection of that event.Hippocampal ripple activity increased at event boundaries and was coupled to events in the neocortex, reflecting a distinctive rhythm of ripple timing during continuous perception.This cortico-hippocampal ripple-based communication during encoding highlights the involvement of ripples in the formation of episodic memories in naturalistic circumstances.
Interactions between cortex and hippocampus play a pivotal role in the encoding of events.An accepted view is that the cortex processes and analyzes information related to an event and the hippocampus provides the temporal and contextual framework necessary for organizing and integrating the elements of this event into coherent event representations (Reagh and Ranganath 2023).The communication between these brain regions during event encoding ensures the integration of perceptual details with contextual information, facilitating the formation of meaningful and distinct memory traces.One mechanism through which the brain achieves this integration is through sharp wave-ripples.Ripples are not isolated hippocampal events but are part of a complex system of interconnected oscillatory networks involving the cortex and hippocampus (Dickey et al. 2022).The coordination of these networks facilitates specific information transfer between neocortical and hippocampal cell assemblies, contributing to the cohesive processing and encoding of event-related information.
In this study, we observed a pattern of ripple activity occurring in the temporal cortex preceding those in the hippocampus, particularly during events that were later successfully recalled.This finding aligns with models of hippocampo-cortical interactions in memory processing.For example, it parallels previous research indicating that hippocampal ripples tend to precede cortical ripples during sleep, while cortical ripples tend to precede hippocampal ripples during wakefulness (Dickey et al. 2022).The temporal cortex, particularly the anterior temporal lobe where the majority of electrodes used in this analysis were placed, plays a critical role in semantic memory and represents information about objects and individuals (Bonner and Price 2013;Reagh and Ranganath 2023).The observed precedence of ripple activity in the temporal cortex suggests its involvement in capturing this type of information and subsequent transmission to the hippocampus.The hippocampus, known for its role in incorporating eventspecific details into comprehensive memory traces, receives the information from the temporal cortex and integrates it into a complete description of the event.During the event encoding process, cortical ripples may then be triggered by stimulus-specific neuronal activity, facilitating the transfer of information from extrahippocampal regions to the hippocampus.
In contrast, we observed that ripples in the hippocampus preceded those in the frontal cortex, consistent with previous findings demonstrating activity in frontal areas following hippocampal ripples (Logothetis et al. 2012;Jadhav et al. 2016).The frontal cortex receives direct and indirect projections from the hippocampus (Cenquizca and Swanson 2007) and has been implicated in various functions such as decision-making, long-term memory consolidation, and working memory (Cenquizca and Swanson 2007).The majority of frontal electrodes included in this analysis were located in the rostral medial cortex, which have also been associated with prospective memory (Volle et al. 2011).Although the precise role of the frontal cortex in the current task remains uncertain, it seems reasonable to hypothesize its involvement in monitoring working memory maintenance during an event (Kurby and Zacks 2008;Radvansky 2017).The temporal dynamics of ripple coupling between the frontal cortex and hippocampus was not associated to whether an event would be later recalled or forgotten.This suggests that ripples in frontal cortex may not necessarily support the process of memory formation for specific event details.Instead, they could potentially serve as a mechanism for detecting transient changes in the event, allowing the brain to update event models and respond accordingly.
In line with recent research on human hippocampal ripples (Axmacher, Elger, and Fell 2008;Kunz et al. 2022;Staresina et al. 2015;2023), we found that ripples occurred in a phase-locked manner to specific phases of delta band activity.Neocortical delta oscillations have been associated with alternating states of enhanced and reduced cortical excitability, known as up and down-states (Steriade, Nunez, and Amzica 1993).Studies in rats have revealed that hippocampal ripples were synchronized with the depolarizing phase of neocortical delta waves and were more likely to occur during down-states than during up-states, often coinciding with transitions from down to up-states (Battaglia, Sutherland, and McNaughton 2004;Staresina et al. 2015;2023).While most of these studies have been conducted during sleep, an interesting hypothesis to investigate in future studies would be to explore the possible association of ripple activity with synchronization and desynchronization states during awake time.
We also observed widespread changes in LFP that were linked to the occurrence of ripples.When a ripple occurred in the hippocampus, cortical high-frequency activity was suppressed, and conversely, when a ripple occurred in cortical areas, hippocampal activity showed a corresponding suppression pattern.This could also be seen considering a synchronization/desynchronization framework, as oscillatory power decreases are typically observed in the lower-frequency ranges (<20 Hz) during the formation of memories (i.e., encoding; Hanslmayr, Staresina, and Bowman 2016).Furthermore, these observations, combined with the fact that ripples in the hippocampus and cortical areas appeared to be locked to different phases of the delta band, suggest the existence of a dynamic system where the occurrence of ripples during specific transitions from down to up-states may influence the silencing or activation of specific brain areas.
The hippocampus has been found to exhibit heightened activity and engagement at event boundaries (Ben-Yakov, Eshel, and Dudai 2013;Baldassano et al. 2017;Ben-Yakov and Henson 2018), while other cortical areas appear to be more sensitive to representing information within an event (Reagh and Ranganath 2023).In our study, we observed that this alternating recruitment pattern during the encoding of an event is reflected at the level of ripple activity.Specifically, when examining event boundaries, we observed an increase in hippocampal ripples accompanied by a decrease in cortical ripples.These findings, along with the previously mentioned results, underscore how the complementary functions of different cortico-hippocampal networks enable the brain to flexibly construct and reuse mental representations of event components.The recruitment of ripples at different moments and in different areas during the encoding of a dynamic event may serve as a computationally efficient strategy for simplifying complex events into key components.Furthermore, the coactivation of stimulus-specific cells during hippocampal ripples, as observed during the encoding of objectplace associations in humans (Kunz et al. 2022), suggests that ripples may play a facilitative role in binding diverse memory elements represented across distinct cortical areas.This facilitation enables the formation of coherent event representations, supporting the integration of information from different cortical regions.
The investigation of ripple events during awake behavior in rodents has uncovered a structured and temporally-compressed replay of hippocampal multi-cell sequences representing past navigation-related experiences, as well as "preplay" of potential future (Diba and Buzsáki 2007;Pfeiffer and Foster 2013;Jadhav et al. 2012;Foster and Wilson 2006;Gupta et al. 2010).Boundaries have been shown to trigger a rapid reinstatement of the just encoded event, facilitating its consolidation into long-term memory (Sols et al. 2017;Silva, Baldassano, and Fuentemilla 2019;Wu et al. 2022).The relationship between the observed increase in ripples at boundaries and this post-boundary reinstatement pattern remains unknown.Further research is needed to determine whether there is a connection between these two boundary phenomena and whether there is any link between ripple occurrence throughout event encoding and replay.Investigating these aspects will shed light on the mechanisms underlying memory consolidation and the role of ripples in the dynamic interplay between hippocampal activity, event boundaries, and replay processes.
In sum, our findings suggest that ripples could be involved in the binding of memory elements represented across disparate cortical areas into coherent representations.Additionally, we observed increased ripple activity at event boundaries in the hippocampus and within events in cortical regions, reflecting the distinctive patterns of information processing during different temporal periods.These findings shed light on the intricate mechanisms underlying memory encoding and provide insights into the role of ripples in event segmentation and memory consolidation.

Data collection
We tested 10 human subjects who were undergoing treatment for pharmacologically intractable epilepsy at Hospital Clínic -IDIBAPS in Barcelona.Prior to performing the task, all participants were thoroughly briefed on the specificities of the task, ensuring they had a comprehensive understanding of the objectives, procedures, and potential risks involved.Each participant was provided with a consent form, which they attentively reviewed and signed, demonstrating their informed consent to participate in the study.The study was approved by the hospital Ethics Committee.
Patients were surgically implanted with intracranial depth electrodes for diagnostic purposes, with the goal of isolating their epileptic seizure focus for potential subsequent surgical resection.The exact electrode number and locations varied across subjects and were determined solely by clinical needs.The recordings were performed using a clinical EEG system (Natus Quantum LTM Amplifier) with a 2048Hz sampling rate and an online bandpass filter from 0.1Hz to 4000Hz.Intracerebral electrodes (Microdeep, DIXI Medical) were used for recordings.Each multielectrode had 8 to 18 contacts, spaced 5 mm and 1 to 2 mm long with a diameter of 0.8 mm.

Experimental Design
The experiment was conducted in a sound-attenuated room in the hospital, with participants sitting upright in a comfortable chair or on their bed.Participants were asked to watch the first 50 min of the first episode of BBC's Sherlock, dubbed in Spanish, as done previously in Silva, Baldassano, and Fuentemilla 2019.Participants were informed that a subsequent recall memory test would follow.After the movie, some time was given to rest (5-10 min) before the test began.During the test, they were asked to freely recall the episode without cues while being recorded using an audio recorder placed on the overbed table next to the laptop computer.The audio files were later analyzed to access participants' length of the recall.The experimental design was implemented using PsychoPy (Peirce et al. 2019) and presented on a 13-inch portable computer, placed on the overbed table at approximately 60 cm distance in front of the patients.

Event boundary annotations
The event model validated in Silva, Baldassano, and Fuentemilla 2019 was used for the current analysis.This model is composed by 38 events (minimum = 4 s, maximum = 444 s, and mean = 76.02 s) and it was constructed by having six external participants annotate the temporal point at which they felt "a new scene is starting; these are points in the movie when there is a major change in topic, location or time" (Baldassano et al., 2019).The final model was built based on boundary time points that were consistent across observers.To find a statistical threshold of how many observers should coincide in a given time point to be different from chance in our data, we shuffled the number of observations 1000 times and created a null distribution of the resulting coincident time points.An α = 0.05 as a cutoff for significance indicated that boundary time points at which at least 3 observers coincided in (considering 3 s as possible window of coincidence as in Baldassano et al. 2017) could not be explained by chance.

Verbal recall analysis
The audio files from the free verbal recall were analyzed by a laboratory member who was a proficient Spanish speaker, using the list of events from the event model mentioned in the previous section.An event was counted as recalled if the participant described any part of that scene.
To statistically assess whether the order of events during movie watching was preserved during free recall, we computed Kendall rank correlation coefficients between each individual event temporal order and a simulated correct linear order.A positive Kendall tau coefficient close to 1 indicates that the encoded temporal order of the events was highly preserved during their recall.

Electrode localization and selection
The presence of electrodes in the respective brain areas was assessed with the examination of a computed tomography (CT) and preoperative Magnetic Resonance Imaging (MRI) T1 scans.Cerebral atlases of each patient were obtained with the parcellation of the preoperative T1 using Freesurfer (https://surfer.nmr.mgh.harvard.edu).The CT was co-registered to the T1 and contact tags and names were placed manually using fieldtrip's toolbox (https://www.fieldtriptoolbox.org/).Selection of channels was done in native space to prevent errors due to distortions.To eliminate potential system-wide artifacts or noise and to better sense ripples locally, we applied bipolar re-referencing between pairs of neighboring contacts.The channels of interest were selected based on the following criteria: if more than one channel was eligible, we privileged the channel that had an adjacent distal referencing contact also in that region; if this was not possible then an adjacent white matter electrode was selected; in the case where more than one pair of adjacent channels were eligible, we selected those that had the least amount of epileptic activity according to visual inspection.
Based on the above mentioned anatomical and functional criteria, one pair of hippocampal depth electrode contacts was selected for each of the ten participants.The number of hippocampal contacts was small in most of our participants, as most of them contained only one pair of hippocampal electrodes.For that reason, and to ensure comparability between regions, we decided to select only one electrode per participant on all cortical areas used in this analysis.One pair of frontal cortex electrodes was selected for six out of the ten participants, as the missing four did not contain any electrode on that desired area.

Intracranial EEG preprocessing and Ripple Detection
Intracranial analyses were performed to identify ripples and examine their relationship to LFPs.In order to detect ripples, the procedure applied in Vaz et al. 2019; 2020 was used.First, the EEG signal was band-pass filtered in the ripple band (80-120 Hz) using a second order Butterworth filter.Then a Hilbert transformation was applied to extract the instantaneous amplitude within that band.Events were selected if the Hilbert envelope exceeded 2 standard deviations above the mean amplitude of the filtered traces.Only events that were at least 25 ms in duration and had a maximum amplitude greater than 3 standard deviations were retained as ripples for analysis.Adjacent ripples separated by less than 15 ms were merged.
Simultaneously, an automated event-level artifact rejection (Vaz et al. 2019;2020) was applied in order to remove system level line noise, eye-blink artifacts, sharp transients, and interictal epileptiform discharges (IEDs), which can be mistakenly characterized as ripples after high pass filtering.To do so, we calculated a z-score for every time point based on the gradient (first derivative) and amplitude after applying a 250 Hz high pass filter.Any time point that exceeded a z-score of 5 with either gradient or high frequency amplitude was marked as artifactual, including periods of 200ms before and after each identified time point.
All data and identified ripples were visually inspected to ensure that the above methodology reliably identified ripples and excluded IEDs and apparent high frequency oscillations associated with IEDs.
For each ripple, we extracted its peak time as the time point at which the band-pass signal was highest; the ripple duration as the time difference between the start and end time of a given ripple; and the inter-ripple interval (IRI) as the time difference between the onset of two consecutive ripples.To depict the time-domain signal, we extracted the raw LFP traces and the time-frequency-domain power spectrum (using Morlet wavelets with 7 cycles at 30 logarithmically spaced frequencies between 1 and 200 Hz), within -100 to 100 ms around each ripple.

Ripple phase locking to ongoing neural oscillations at the delta band
To investigate whether ripples were locked to particular phases of delta oscillations (0.5 to 4 Hz) we filtered the signal using a two-pass Butterworth filter and extracted the instantaneous phase using the Hilbert transform at the onsets of each ripple.To assess phase consistency across ripples we computed inter-trial phase coherence (ITPC) values across ripples for each participant (Cohen 2014).ITPC spans from 0 to 1, with 1 corresponding to a perfect inter-trial coherence (i.e., the same phase on each trial onset).
To assess statistical significance of ripple-phase coupling, we compared the empirical values against 1000 surrogate values computed by permuting the inter-ripple interval distribution (i.e., permuting the time differences between the onset of two consecutive ripples), for each participant.Then we computed a group-level p-value of the empirical average ITPC z-value in comparison to the surrogate ITPC z-values as the fraction of surrogate values that were larger than the empirical value, with an alpha of 0.05.

iEEG spectral power during ripples
To assess whether hippocampal/cortex ripples were associated with significant changes in LFP power in neocortex/hippocampus, respectively, we computed ripple-aligned time frequencyresolved power spectrograms (Kunz et al. 2022) across the entire recording, using Morlet wavelets with 7 cycles at 50 logarithmically spaced frequencies between 1 and 200Hz.Power values were z-scored across time for each frequency.Values around each hippocampal ripple (±3 s) were extracted and time points with IEDs were excluded (i.e., set to NaN).Finally, power z-values were averaged across ripples and smoothed with a Gaussian filter across time (kernel length, 0.2 s).This procedure was computed individually for each participant and then averaged across participants.For visualization we truncated the spectrogram ±0.5 s around the ripple peak time point.
To statistically evaluate power changes, we performed a cluster-based permutation test (1000 surrogates) across channels in which we first applied a one-sample t-test to the empirical data, separately for each time-frequency bin, and identified contiguous clusters of time-frequency bins in which the uncorrected p-value of the t-test was significant (α = 0.05).Then for each cluster, we computed an empirical cluster statistic by summing up all t-values being part of that cluster.The empirical cluster statistics was compared against surrogate cluster statistics, obtained by flipping the sign of the power values of a random subset of the spectrograms, performing exactly the same steps as for the empirical data, and keeping only the maximum cluster (Kunz et al. 2022).The empirical cluster statistic was considered significant if it exceeded the 95th percentile or if it fell below the 5th percentile of all surrogate maximum cluster statistics.

Ripple cross-correlation between brain regions
To examine the hippocampal-neocortical coordination of ripple activity, we computed crosscorrelations between the ripple time series of the hippocampal channel and the time series of the temporal and frontal cortical channels (composed of zeros and ones where ones indicate the ripple periods) (Kunz et al. 2022).A maximum time lag of ±1s was considered, as most ripples were expected to occur closely together in time.The cross-correlations were computed for each participant separately, smoothed with a gaussian filter (kernel length of 0.2 s) and zscored across time lags.
Statistical assessment was performed via a cluster-based permutation test (1000 surrogates) across channels.First a one-sample t-test was computed on the empirical data, separately for each time lag, and contiguous time lags were identified for which the uncorrected p-value of the t-test was significant (α = 0.05).Then for each cluster, we computed an empirical cluster statistic by summing up all t-values that were part of that cluster.The empirical cluster statistics was compared against surrogate cluster statistics, obtained by flipping the sign of a random subset of the correlation series, and then performing the same steps as for the empirical data, keeping only the maximum cluster.The empirical cluster statistic was considered significant if it exceeded the 95th percentile or if it fell below the 5th percentile of all surrogate maximum cluster statistics.

Ripple rate during the encoding of movie events
The analysis of the ripple rate during the encoding of movie events was assessed by counting the number of ripples that occurred within each event, for each participant.This value was normalized by the length of the event, and then the resulting normalized ripple count was averaged across events.To evaluate the extent to which the number of ripples during the encoding of an event determined its successful recall at the later verbal recall test, for each participant, we split the events that were later recalled and forgotten and obtained an averaged measure of ripple count for each condition and participant, which was then compared by using a one-sample paired t-test, with significance threshold set at an alpha of 0.05.

Ripple rate at movie event boundaries
To assess how ripples fluctuated around event boundaries we computed a peri-ripple time histogram of ripples across event boundaries, for each participant.We used 300-ms time bins starting from -2 to 2 s relative to boundary occurrence.For visualization purposes, we smoothed it with a 5-point triangular window.This resulted in an estimated probability of observing a ripple at each time-point during the -2 to 2 s epoch.
The empirical ripple rates were compared against 1000 surrogate values computed by calculating peri-stimuli histograms of the -2 to 2 s epoch but by shuffling the temporal order of the events throughout the movie.This procedure ensured that each surrogate preserved signal properties and maintained the lengths of the events, resulting in ripple rates that corresponded to within event windows, for each participant.For each time-point surrounding an event boundary, we determined the p-value by calculating the fraction of surrogate values that exceeded the empirical value, considering the z-value of the empirical rate.An alpha level of 0.05 was used for this analysis.The p-values were later FDR corrected (Benjamini and Hochberg 1995).

Figure 1 .
Figure 1.Experimental design, ripple detection and properties.a) Experimental design and schematic depiction of expected ripple behavior.We hypothesized that there would be higher ripple occurrence at the hippocampus than in the neocortex; for ripples at the hippocampus to occur closer to event boundaries and ripples at the neocortex to occur within events; and for ripples in the hippocampus and neocortex to co-occur temporally.b) Left: Temporal cortex (red) and frontal cortex (green) electrode localizations from all participants mapped into common space, shown on a three-

Figure 2 .
Figure 2. Average frequency of ripples during an event, for each participant, normalized by the length of the event, for recalled (green) and forgotten (yellow) events, in a) hippocampus, b) temporal cortex and c) frontal cortex.For all boxplots, the central mark is the median, and the edges of the box are the 25th and 75th percentiles * Statistically significant at group level (p < 0.05).

Figure 3 .
Figure 3. Cross-correlation analysis and LFP changes locked to ripple occurrence.(a) Crosscorrelations between hippocampal and temporal cortex ripples during movie encoding.(b) Crosscorrelations between hippocampal and frontal cortex ripples during movie encoding.In (a) and (b), the shaded region corresponds to SEM across participants.The black line at top indicates crosscorrelations significantly above 0 (cluster-based permutation test: p < 0.05).(c) LFP power (z-scored) changes in (c) temporal cortex and (d) frontal cortex locked to hippocampal ripples, where 0 corresponds to ripple peak.LFP power (z-scored) changes in (e) frontal cortex and (f) temporal cortex locked to hippocampal ripples during the encoding of the movie, where 0 corresponds to ripple peak.In (c-f), black contours correspond to statistically significant clusters (two-sided cluster-based permutation tests: p < 0.05).

Figure 4 .
Figure 4. Instantaneous ripple rate computed in 300ms time bins around boundary onset and smoothed by a five-point triangular window, for empirical data (green) and surrogate data (grey), computed by shuffling the temporal order of the events while maintaining their lengths, for a) hippocampus, b) temporal cortex and c) frontal cortex.Shaded region corresponds to SEM across