## Main

Depression is a highly prevalent mental health condition1, the incidence of which has increased during the COVID-19 pandemic2, for example, as reflected in increased prescriptions of antidepressant medications3. However, even the best-performing antidepressant drugs show modest efficacy, non-negligible side effects, discontinuation problems and high relapse rates4,5,6,7, highlighting the need for new, improved treatments8.

Patients with a diagnosis of depression often exhibit a negative cognitive bias, characterized by pessimism, poor cognitive flexibility, rigid thought patterns and negative fixations regarding ‘self’ and the future9,10. A number of authors have directly or indirectly taken inspiration from dynamical systems theory to describe depressive episodes as ‘attractor states’ (stereotyped cognitive states with ‘gravitational pull’11).

Neuroimaging research has consistently found examples of abnormal brain functioning in depression, resonant with its phenomenology12,13,14. A hierarchically supraordinate intrinsic brain network15, the default mode network (DMN), is associated with introspection and self-referential thinking16. These cognitive functions are often overactive in depression9, and several studies have linked excessive engagement of DMN functioning with depressive symptomatology12.

In addition to the DMN, other higher-order brain networks such as the executive network (EN) and salience network (SN) have been implicated in depression14,17. These networks are associated with ‘cognitive control’ and internal versus external attention switching18,19,20. Such attentional switching is often impaired in depression21. Tellingly, the serotonin 2A (5-HT2A) receptor subtype, which is the key proteomic binding site of ‘classic’ serotonergic psychedelic drugs, such as psilocybin22, is most densely expressed in a broad pattern of cortex that closely resembles a conjunction map of the DMN, EN and SN23, corresponding to the transmodal portion of the brain’s principal hierarchical gradient15.

In the last 15 years, at least six separate clinical trials have reported impressive improvements in depressive symptoms with psilocybin therapy24. Included among these studies are (1) an open-label trial in treatment-resistant depression25 and (2) a double-blind, randomized controlled trial (DB-RCT) with an active comparator, the selective serotonin reuptake inhibitor (SSRI) and conventional antidepressant, escitalopram26. These two trials, which included pre-treatment and post-treatment fMRI, are the focus of this paper’s analyses.

The therapeutic action of psilocybin and related psychedelics is incompletely understood; however, one model proposes that psychedelics cause a 5-HT2A receptor-induced dysregulation of spontaneous population-level neuronal activity, linked to a temporary ‘disintegration’ of intrinsic functional brain networks27 and a hypothesized decrease in the precision-weighting of predictive models encoded (at least in part) by the integrity of functional modules28. One important corollary of modular ‘disintegration’ seems to be the broadening of the brain’s functional repertoire of states, commensurate with a broader or flatter global energy landscape29.

Here we hypothesize that the well-replicated finding of brain network disintegration and desegregation under psychedelics30,31 will be apparent subacutely, in post-treatment resting-state fMRI data. We also hypothesize that this effect, consistent with a flatter energy landscape, will relate to improved depression outcomes and will not be observed after a course of the SSRI, escitalopram.

## Results

### Open-label trial

#### Rapid antidepressant effect of psilocybin therapy

Patients with treatment-resistant depression (TRD) participated in a single-arm, open-label psilocybin therapy clinical trial (Fig. 1a). Baseline clinical assessment and resting-state fMRI were followed by fixed-order ‘low’ (10 mg) and ‘high’ (25 mg) psilocybin therapy dosing days (DDs) that were separated by 1 week. A second clinical assessment and fMRI scan were conducted 1 d after DD2. Remote assessments of clinical status were conducted 1 week, 3 months and 6 months after DD2. Further details are available in Methods and elsewhere25.

Of the 19 patients recruited, 3 were excluded due to excessive fMRI head motion (Fig. 2a). We first confirmed an antidepressant effect of psilocybin in this imaging sample of 16 patients (mean age, 42.75 years, s.d. = 10.15, 4 females) using the Beck Depression Inventory (BDI-1A). This patient-rated measure was preregistered for the original investigation (gtr.ukri.org MR/J00460X/1). The BDI captures a broad range of symptoms and places particular emphasis on the cognitive features of depression32, which may be an important target of psilocybin therapy.

Baseline BDI scores indicated severe depression (mean BDI = 34.81, s.d. = 7.38). In line with our previous report25, rapid, substantial and sustained reductions in depression severity were observed after treatment (Fig. 3a,b). Relative to baseline, significant BDI reductions were observed at 1 week (mean difference, −21.0 points; t15 = 7.11, 95% confidence interval (CI) −27.30 to −14.71, P < 0.001, Cohen’s d = 1.78) and still evident at 6 months (mean difference, −14.19 points; t15 = 4.26, 95% CI −21.29 to −7.09, P < 0.001, d = 1.07).

#### Decreased brain modularity one day after psilocybin therapy

To test our primary hypothesis, preprocessed fMRI data were used to estimate normalized network modularity from Pearson correlation functional connectivity matrices of the cortex (Methods). Confirming our primary hypothesis, brain network modularity was significantly reduced (Fig. 4a) 1 d after psilocybin therapy (mean difference, −0.29; t15 = 2.87, 95% CI 0.07 to 0.50, P = 0.012, d = 0.72). This result implies a global increase in functional connectivity between the brain’s main intrinsic networks.

#### Decreased modularity predicts improved clinical outcomes

We hypothesized that decreased brain network modularity would relate to the sustained improvements in depression severity that follow psilocybin therapy. To test this, we calculated Pearson correlations between the post-treatment brain modularity and BDI scores from the three post-treatment time points (1 week, 3 months, 6 months). After false discovery rate (FDR) correction for multiple comparisons, a strong significant Pearson correlation was observed at the 6 months primary end point (r14 = 0.64, 95% CI 0.29 to 0.84, P = 0.023; Fig. 4b). Directionally consistent relationships were seen at 3 months (r14 = 0.46, 95% CI 0.03 to 0.74, P = 0.114) and 1 week (r14 = 0.29, 95% CI −0.16 to 0.64, P = 0.284), but these did not survive correction. Pre-treatment versus post-treatment changes in modularity significantly correlated with change in BDI score at 6 months, relative to baseline (r14 = 0.54, 95% CI 0.14 to 0.78, P = 0.033; Fig. 4c). These results imply that decreased brain modularity 1 d after psilocybin therapy relates to long-term improvements in depression symptom severity.

#### DMN changes in within-network and between-network functional connectivity one day after treatment

Previous research has implicated depressive symptomology with hyperconnectivity of the DMN12 and hypoconnectivity of the DMN with other higher-order ‘cognitive’ networks, including the EN and SN14,17. We therefore tested for evidence of these abnormalities being attenuated after treatment using functional cartography (Methods). Consistent with our previous hypothesis, significant reductions in DMN network recruitment (mean difference, −0.54; t15 = −2.99, 95% CI −0.92 to −0.15, P = 0.009, d = 0.75; Fig. 4d) and increased between-network integration between the DMN and EN (mean difference, 0.53; t15 = 3.01, 95% CI 0.15 to 0.90, P = 0.01, d = 0.75) and between the DMN and SN (mean difference, 0.55; t15 = 2.89, 95% CI 0.14 to 0.95, P = 0.01, d = 0.72; FDR-corrected) were observed 1 d after psilocybin therapy. An exploratory analysis of the changes in network recruitment and between-network integration of other brain networks is available in Supplementary Fig. 2.

Taken together, these findings indicate a clinically relevant decrease in brain network modularity following psilocybin therapy for TRD. A network cartography analysis suggests that this global change in network organization may be underpinned by a specific decrease in within-DMN connectivity and increase in DMN connectivity with other higher-order networks, including the EN and SN.

### Double-blind randomized controlled trial

#### Psilocybin therapy versus escitalopram for depression

The design of this DB-RCT (Fig. 1b) gave a new opportunity to compare not just the safety and efficacy, but also the mechanisms of action of psilocybin therapy to those of a conventional antidepressant drug, escitalopram. Patients with major depressive disorder (MDD) were randomly allocated to a ‘psilocybin arm’ or ‘escitalopram arm’ (Fig. 1b). Baseline clinical assessment and resting-state fMRI was followed by DD1, when patients received either 25 mg psilocybin (psilocybin arm) or a presumed inactive 1 mg psilocybin dose (escitalopram arm). All patients were informed that they would receive psilocybin but were blind to the dosage. DD2 occurred 3 weeks after DD1 and was a duplicate dosage. Beginning 1 d after DD1, patients took daily capsules for 6 weeks and 1 d in total. For both conditions, one capsule per day was ingested for the first 3 weeks and two capsules per day were ingested thereafter. Capsule content was either inert placebo (microcrystalline cellulose in the psilocybin arm) or 10 mg escitalopram in the escitalopram arm (10 mg daily for the first 3 weeks and 2 × 10 mg (20 mg) daily for the final 22 d). Further details are available in Methods and elsewhere26.

Of the 59 patients with MDD recruited, 29 were randomly allocated to the escitalopram arm. Of those, four discontinued due to adverse reactions to escitalopram, one was lost due to the COVID-19 UK lockdown and three were excluded due to excessive fMRI head motion (Fig. 2b). The remaining 21 patients (mean age, 40.9 years, s.d. = 10.1, 6 female) were included in the escitalopram imaging sample. Thirty patients were randomly allocated to the psilocybin arm. Of those, one was excluded for choosing not to take the daily (placebo) capsules, two did not attend the post-treatment session due to the COVID-19 UK lockdown and five were excluded due to excessive fMRI head motion. The remaining 22 patients (mean age, 44.5 years, s.d. = 11.0, 8 female) were included in the psilocybin imaging sample (Fig. 2b).

The BDI was a primary outcome measure for the open-label trial (MR/J00440/1) and a secondary outcome measure for this DB-RCT (ClinicalTrials.gov identifier NCT03429075); however, this measure proved to be an especially sensitive index of post-psilocybin reductions in symptom severity across the trials26. Between trials, baseline BDI (Fig. 3c) was significantly greater in the open-label TRD trial compared with the DB-RCT MDD trial (mean difference, 6.53 points; t57 = 3.01, 95% CI 2.18 to 10.88, P = .013, d = 0.83). This difference is likely due to TRD being an inclusion criteria in the open-label trial, but not in this DB-RCT.

As described in our previous report26, BDI-measured reductions in depressive symptom severity were significantly greater after psilocybin than escitalopram, indicating superior efficacy of psilocybin therapy versus escitalopram (Fig. 3d). Moreover, we confirmed the statistical significance of this contrast within the smaller neuroimaging sample included in the present analyses after testing for an arm × time point analysis of variance interaction on BDI scores (F3,123, 4.47; P = 0.005). FDR-corrected pairwise comparisons relative to baseline were significantly different at 2 weeks (mean difference, −8.73; t41 = −3.66, 95% CI −13.55 to −3.91, P = 0.002, d = 0.98), 4 weeks (mean difference, −7.79; t41 = −2.69, 95% CI −13.62 to −1.95, P = 0.013, d = 0.77) and at 6 weeks (mean difference, −8.78; t41 = −2.61, 95% CI = −15.58 to −1.97, P = 0.013, d = 0.75), all favoring the psilocybin arm.

#### Decreased brain modularity for psilocybin but not escitalopram

Reconfirming our primary hypothesis (Fig. 5a,b) and replicating analyses on the open-label trial data, brain network modularity was significantly reduced at the trial’s primary end point, 3 weeks after psilocybin therapy (mean difference, −0.39; t21 = −2.20, 95% CI −0.75 to −0.02, P = 0.039, d = 0.47). Moreover, for the psilocybin condition, post-treatment decreases in brain network modularity significantly correlated with improvements in depression symptom severity at this primary end point (r20 = 0.42, P = 0.025, one-tailed).

Notably, there was no significant interaction between treatment arm and scanning session on network modularity (F1,41 = 2.719, P = 0.107); however, there was evidence that the reduction in network modularity and its relationship to depression severity may be specific to the psilocybin arm. Namely, in the escitalopram group (Fig. 5d,e), network modularity did not change from baseline (mean difference, 0.01; t20 = 0.07, 95% CI −0.35 to 0.33, P = 0.95, d = 0.02) and there was no significant correlation between changes in modularity and changes in BDI scores (r19 = 0.08; P = 0.361, one-tailed).

#### Response to psilocybin correlates with network flexibility

The specific changes in network recruitment observed 1 d after psilocybin therapy in the open-label trial were not replicated at 3 weeks in this DB-RCT (Supplementary Information). However, the faster fMRI scanning protocol adopted in the DB-RCT generated twice as much temporal data per scanning session (Methods). This provided the rare opportunity to examine changes in the dynamic flexibility of brain networks following psilocybin therapy.

The metric known as ‘dynamic flexibility’ indexes how often brain regions change their community allegiance over time, during the course of an fMRI scan33,34 (Methods). Reduced functional dynamics have been previously associated with depression symptomology14. In an exploratory analysis, post-psilocybin therapy changes in network flexibility were correlated with changes in BDI score (Fig. 5c). After FDR correction, increased EN dynamic flexibility strongly correlated with greater symptom improvement at the 6-week primary end point for the psilocybin arm (r20 = −0.76, 95% CI −0.90 to −0.50, P = 0.001). Strong correlations that survived FDR correction were also observed when combining regions from the EN with other lateral frontoparietal networks, such as the SN and dorsal attention network (Fig. 5c). Critically, there were no significant correlations between changes in BDI scores and changes in dynamic flexibility in the escitalopram arm (Fig. 5f).

## Discussion

In light of growing evidence for the antidepressant efficacy of psilocybin therapy26, the present findings advance our understanding of its possible underlying brain mechanisms. Across two trials, decreased brain modularity was observed and correlated with improvements in depressive symptomatology. Moreover, this antidepressant action may be specific to psilocybin therapy, as no changes in modularity were observed with the conventional SSRI antidepressant, escitalopram.

Research into the acute brain action of psychedelics has revealed well-replicated changes in global brain function that are somewhat consistent with those observed here (an increased repertoire of inter-regional and between-network functional connectivity (FC)29,30,31). A previous analysis of ours had suggested some contrasting changes in the architecture of spontaneous brain function 1 d following psilocybin treatment for depression relative to what has been observed during the acute psychedelic state itself: spatially expanded DMN FC (1 d after treatment for TRD) versus acute DMN ‘disintegration’25. However, others have reported evidence of increased inter-network FC 1 week and 1 month after psilocybin treatment35, as well as 1 d after ayahuasca, including increases in DMN-SN FC in healthy volunteers36. These findings are consistent with the present study, but here we show robust and reliable evidence that increases to global brain network integration accompanies the antidepressant efficacy of psilocybin therapy.

The present modularity metrics may be more sensitive indices of the antidepressant action of psilocybin than previously applied time-averaged within-network and between-network FC analyses25. Indeed, they may bear relevance to other FC metrics applied to acute-state psychedelic fMRI data29,30 where a general picture of increased global FC and a broadened dynamic state space has emerged28. In this context, the results could be understood as a ‘carryover’ effect resembling brain dynamics associated with the acute action of psychedelics, albeit at an attenuated level and in a specific population (depressed patients). To show robustness to analytical method, we also carried out more traditional mass-univariate analyses and these yielded consistent findings (Supplementary Figs. 3 and 4). However, an advantage of network modularity is its capacity to elegantly summarize global changes in the brain’s functional network organization37.

Previous research on resting-state activity in depression has found heightened network modularity correlating with symptom severity17,38. Additional work implies heightened within-DMN FC and elevated FC between limbic regions such as the amygdala, and high-level cortical regions correlates with ruminative symptoms in depression12,39. Taken together, a model emerges of abnormally modular spontaneous brain function in depression that is effectively remediated by psilocybin therapy. According to various findings, the FC energy landscape or state space in depression can be described as abnormally constricted, paralleling the narrow, internally focused, ruminative quality of mood and cognition in the disorder11. In contrast, psilocybin seems to increase the brain’s ability to visit a broader state space, both acutely and after psilocybin therapy in patients who are depressed, as shown here. Moreover, this ‘liberating’ action of psilocybin is paralleled by subjective reports of ‘emotional release’40,41 as well as subacute increases in behavioral optimism9, cognitive flexibility42 and psychological flexibility after taking a psychedelic drug43. Indeed, heightened emotional responsiveness may be specific to psilocybin therapy versus SSRIs26.

It is plausible that this putative liberating effect of psilocybin on cortical activity occurs via its direct agonist action on cortical 5-HT2A receptors, dysregulating activity in regions rich in their expression. We surmise that chronic escitalopram does not have the same effect on brain modularity due to its more generalized action on the serotonin system and predominant action on inhibitory postsynaptic 5-HT1A receptors, which are richly expressed in limbic circuitry27,44.

Beyond the global decrease in network modularity after psilocybin, we observed functional changes in DMN, EN and SN dynamics that are consistent with neurobiological models of depression45. These high-order transmodal networks house the highest density of 5-HT2A receptors, the principal action site for serotonergic psychedelics22,23. Higher-order networks are implicated in the acute action of psychedelics, where they show reduced modularity and increased communication with regions ordinarily outside of their community limits29,30,31.

The EN and SN have been associated with tasks requiring cognitive flexibility such as learning and task switching18,19,46,47; impaired functioning of these networks have been reported in depression14,17 and other disorders exhibiting cognitive inflexibility such as autism spectrum disorder48 and obsessive–compulsive disorder49. Our results suggest that decreased modularity or increased flexibility of these networks following psilocybin therapy is a key component of its therapeutic mechanism of action. We did not formally assess cognitive flexibility in the clinical trials reported here but we did observe improvements in general cognitive functioning after psilocybin treatment in the DB-RCT, as well as treatment-specific improvements in ‘emotional avoidance’ (an inversion of the related construct ‘psychological flexibility’26).

It should be noted that psychological processes that do not reliably relate to brain modularity changes may have played a role in the main clinical outcomes of this study, and an inability to discount such factors precludes the making of confident inferences that drug alone was the main causal determinant of the imaging outcomes or, indeed, that decreased modularity is sufficient for response to psilocybin therapy. Nevertheless, the changes observed in the neuroimaging data were consistent with previous brain imaging research regarding the acute action of psychedelics and are plausible in light of evidence of elevated modularity and abnormal functioning of higher-order networks in depression12,17,38,39,50.

Successful phase III DB-RCTs will be required to achieve licensing for psilocybin therapy, but pragmatic trials may better address questions regarding treatment practicability, specificity and optimization51. Given the emerging research into psychedelic therapy, it is important for large-scale trials to establish the generalizability, reliability and specificity of psilocybin’s antidepressant response. For example, it is likely that efficacy will depend on symptom severity, depression subtypes and comorbidities, as well as other key pharmacological and extrapharmacological factors52. For brain imaging studies, we would recommend network modularity analyses such as those employed here. fMRI datasets are complex, burdensome and susceptible to noise, contributing to the challenge of detecting reliable biomarkers. Simplifying composite measures, such as network modularity, combined with a research domain, symptoms-based approach to psychological phenomena, may be a particularly productive way forward37,51.

It should be noted that the present study’s findings do not support baseline modularity as a predictor of response to psilocybin therapy. Patients with a range of baseline modularity values showed modularity reductions after treatment with psilocybin; however, the present results do suggest that the early-phase modularity change is predictive of the long-term treatment response to psilocybin therapy.

It is noteworthy to consider the potentially confounding effects of head motion when interpreting fMRI data. Here, a robust fMRI preprocessing pipeline was employed alongside strict head motion criteria for patient inclusion. To examine robustness to motion, an analysis of head motion was conducted and is available in the Supplementary Information. These analyses bolster the present findings, as there was no evidence that head motion differed between sessions or treatment arms or that it correlated with network modularity. The fMRI data were collected with an eyes-closed protocol, which has some advantages; however, it would be compelling if these findings were replicated in data acquired with an eyes-open protocol. In-scanner sleep can be more likely during eyes-closed fMRI, which is a particular disadvantage53. In-scanner sleep cannot be ruled out here. However, the head motion analyses make it unlikely that sleep was a confounding factor. Furthermore, a self-reported visual analog scale of time spent asleep and ‘sleepiness’ were acquired immediately after all scan runs in study 2. An analysis of these data is available in the Supplementary Information. Critically, ratings of in-scanner sleep or sleepiness were low and did not differ between treatment arms or scanning session.

This study’s primary hypothesis was confirmed and replicated despite substantial differences between the design of the two trials. Baseline depression severity was significantly greater in the open-label trial. Furthermore, the open-label trial post-treatment fMRI scan was only 1 d after DD2 and was recorded with a 12-channel head coil and a 2-s repetition time (TR). In contrast, the DB-RCT post-treatment scan was conducted 3 weeks after DD2 and was recorded with a 32-channel head coil and a 1.25-s TR.

Acknowledging these differences between the trial designs serves to strengthen the validity of the main findings, as they were robustly replicated; however, the lack of replication in the finer-grained cartography analyses limits the network-specific inferences. A supplementary analysis (Supplementary Information) did confirm that baseline depression severity correlated with within-DMN connectivity and between-network DMN-EN and DMN-SN connectivity, as has been previously reported12,17,38,39,50; however, in the DB-RCT, we did not replicate the entirety of the changes in network cartography that were observed in the open-label trial. Given that the observed network effects directly follow predictions from the depression literature, it may be that they are more pronounced in more severe cases, such as those included in the open-label TRD trial. Alternatively, it may be that these effects are only detectable in a short-term, subacute phase after psilocybin therapy and not, for example, 3 weeks later. Parsing the relative contribution of baseline severity and time since treatment will be an important feature of future clinical trials with neuroimaging, ideally with larger samples and repeated scanning sessions.

Dynamic analyses can be challenging to conduct. To be sufficiently powered, time series need to be of sufficient length to be split into multiple time windows that are themselves sufficiently long to compute reliable FC measures, and previous research guided our selection of parameters54,55. Collecting sufficient fMRI data in patient cohorts can be challenging, but given the appeal of dynamic analyses, efforts are underway to facilitate and improve them54. It should be noted that a sufficiently broad window of time was used to estimate Pearson correlation FC; however, ongoing work is required to better understand how to capture the most functionally meaningful dynamic data.

With these caveats entered, it should be emphasized that the inferences from both cartography analyses converged on the brain’s higher-order networks. In particular, the DB-RCT analyses showed robust correlations (r~0.8) between increased higher-order network flexibility and psilocybin’s treatment response, and this converges with the open-label trial as well as previous research14.

In summary, depression is a major public health problem associated with huge burden and cost. Here, we identify a robust, reliable and potentially specific biomarker of response to psilocybin therapy for depression. Our results may help to explain why psilocybin therapy holds promise as a new treatment option in psychiatry.

## Methods

### Trial overviews

The trial designs (Fig. 1) and main clinical outcomes of the open-label31 (gtr.ukri.org: MR/J00460X/1) and DB-RCT32 (clinicaltrials.gov: NCT03429075) trials have been previously published. Both trials were conducted at the National Institute for Health Research Imperial Clinical Research Facility and received Imperial College London Sponsorship, NHS research and Imperial college Joint Research and Compliance Office ethical approval, Health Research Authority and Medicines and Healthcare products Regulatory Agency approval. This work was conducted under a UK Home Office Schedule 1 Drug Licence. All participants provided written informed consent. Participants were not financially compensated.

### Participants

For both trials, eligibility required a general practitioner-confirmed diagnosis of unipolar MDD (16+ on the 21-item Hamilton Depression Rating scale). The open-label trial had the additional criteria of TRD, as defined by no improvement despite multiple courses of antidepressant medication (mean = 4.6 ± 2.6 past medications; range, 2–11)39. Patients were asked whether they had previous experience of using psychedelics. In the open-label trial, 25% had previous experience. Similarly, in the DB-RCT, 31% of patients in the psilocybin arm and 24% in the escitalopram arm had previous experience.

Exclusion criteria were immediate family or personal history of psychosis, risky physical health condition (physician-assessed), history of serious suicide attempts, positive pregnancy test and MRI contraindications. The DB-RCT had the additional exclusion criteria of SSRI contraindications or previous escitalopram use. Of note, treatment resistance was neither an inclusion or exclusion criterion in the DB-RCT. All eligible patients undertook telephone screening interviews, provided written informed consent and their mental and physical medical histories were thoroughly evaluated.

### Interventions

Nineteen patients with TRD were recruited to the open-label trial and attended a 1-d pre-treatment baseline session that included eyes-closed resting-state fMRI and clinical assessment (Fig. 1a). This was followed by two psilocybin therapy DDs, separated by 1 week. A low dose of psilocybin (10 mg) was orally ingested on DD1 and followed by a high dose (25 mg) on DD2. The follow-up fMRI and clinical assessment occurred 1 d after DD2. Patients attended an on-site clinical assessment at 1 week after DD2 and completed further clinical assessment electronically at 3 and 6 months. Of the 19 patients with TRD, 16 were retained (mean age, 42.75 years; s.d. = 10.15, 4 female) for the present analysis after 3 were excluded due to excessive fMRI head motion (Fig. 2a).

Of the 59 MDD patients recruited to the DB-RCT, a random number generator allocated 30 to the psilocybin arm and 29 to the escitalopram arm (Fig. 1b). The final imaging samples for this investigation were n = 22 for the psilocybin arm (mean age, 44.5 years, s.d. = 11.0, 8 female) and n = 21 for the escitalopram arm (mean age, 40.9 years, s.d. = 10.1, 6 female) (Fig. 2b). Patients attended a pretreatment baseline eyes-closed resting-state fMRI. DD1 consisted of either 25 mg psilocybin (psilocybin arm) or a presumed negligible 1 mg psilocybin (escitalopram arm) dose. All patients were informed that they would receive psilocybin but were blind to the dosage. DD2 occurred 3 weeks after DD1 and was a duplicate dosage. There was no dosage crossover. Beginning 1 d after DD1, patients took daily capsules for 6 weeks and 1 d in total. For both conditions, one capsule per day was ingested for the first 3 weeks and two thereafter. Capsule content was either inert placebo (microcrystalline cellulose in the psilocybin arm) or escitalopram in the escitalopram arm, 10 mg for the first 3 weeks and 2 × 10 mg (20 mg) total thereafter.

### Measuring depression severity

BDI-1A scores were used to assess depression severity in both studies. This patient-rated measure captures a broader range of symptoms, with an additional focus on the cognitive features of depression, compared with other measures such as the QIDS-SR-16 (ref. 40). BDI was preregistered as a primary outcome measure in the open-label trial (gtr.ukri.org MR/J00460X/1) and was measured at baseline and 1 week, 3 months and 6 months after DD2. For the DB-RCT, BDI was measured at baseline and 2, 4 and 6 weeks after DD1. BDI was a secondary outcome measure for this DB-RCT (ClinicalTrials.gov NCT03429075) and was used here to test for a replication of the effects observed in the open-label trial.

### MRI acquisition

Brain imaging was performed on a 3T Siemens Tim Trio at Invicro. Anatomical images were acquired using the Alzheimer’s Disease Neuroimaging Initiative, Grand Opportunity (ADNI-GO56) recommended MPRAGE parameters (1-mm isotropic voxels; TR, 2,300 ms; TE, 2.98 ms; 160 sagittal slices; 256 × 256 in-plane field of view; flip angle, 9 degrees; bandwidth, 240 Hz per pixel; GRAPPA acceleration, 2).

In both studies, eyes-closed resting-state fMRI data were collected with T2*-weighted echo-planar images with 3-mm isotropic voxels. In study 1, a 12-channel head coil was used to acquire 240 volumes in ~8 min: TR, 2,000 ms; TE, 31 ms; 36 axial slices; flip angle, 80 degrees; bandwidth, 2,298 Hz per pixel; and GRAPPA acceleration, 2). In study 2, a 32-channel head coil was used to acquire 480 volumes in ~10 min: TR, 1,250 ms; TE, 30 ms; 44 axial slices; flip angle, 70 degrees; bandwidth, 2,232 Hz per pixel; and GRAPPA acceleration, 2).

### fMRI data preprocessing

Imaging data were preprocessed via a custom in-house pipeline composed of tools from the FMRIB Software Library57, Analysis of Functional NeuroImages (AFNI)58, Freesurfer59 and Advanced Normalization Tools60 packages. Patients were excluded if either fMRI scan contained >20% of volumes with a framewise displacement >0.5 mm.

Specifically, the following preprocessing stages were performed: (1) removal of the first three volumes; (2) de-spiking (3dDespike, AFNI); (3) slice time correction (3dTshift, AFNI); (4) motion correction (3dvolreg, AFNI) by registering each volume to the volume most similar, in the least-squares sense, to all others; (5) brain extraction (BET, FSL); (6) rigid body registration to anatomical scans (BBR, FSL); (7) nonlinear registration to the 2 mm Montreal Neurological Institute (MNI) brain (Symmetric Normalization, Advanced Normalization Tools); (8) scrubbing, using a framewise displacement threshold of 0.5 mm, scrubbed volumes were replaced with the mean of the neighboring volumes; (9) 6 mm full width at half maximum Gaussian spatial smoothing (3dBlurInMask, AFNI); (10) 0.01 to 0.08 Hz band-pass filtering (3dFourier, AFNI); (11) linear and quadratic de-trending (3dDetrend, AFNI) and (12) voxelwise nuisance regression with the six realignment motion regressors and three tissue signal regressors (Ventricles, Freesurfer, eroded in 2 mm space), draining veins (FSL’s CSF minus Freesurfer’s Ventricles, eroded in 1 mm space) and local white matter (WM) (FSL’s WM minus Freesurfer’s subcortical gray matter structures, eroded in 2 mm space). Regarding local WM regression, AFNI’s 3dLocalstat was used to calculate the mean local WM time series for each voxel, using a 25-mm radius sphere centered on each voxel.

### Functional connectivity

Following the preprocessing, a functional atlas was used to separate the cerebral cortex into 100 regions of interest (ROIs)61. FC between each pair of ROIs was calculated with a Pearson correlation coefficient between each pair of mean signal ‘time courses’ (representing fluctuations in neural activity over time). This resulted in an N × N FC matrix, with each element representing the connectivity strength between a pair of ROIs. Positive values were retained and Fisher-transformed to z scores. This procedure was repeated independently for each patient and scan (baseline and post-treatment).

### Brain network modularity

The community structure or segregation between the brain’s functional networks, was measured by summarizing each FC matrix with a common Louvain-like community detection algorithm62 where the objective is to maximize the extent to which brain areas can be separated into nonoverlapping communities or modules. The modularity quality function score, Q63, tends to be high when the brain exhibits a high segregation between its functional networks (such as strong clusters of FC within brain networks/communities with weak FC to the rest of the brain).

This approach has been commonly applied to fMRI data to characterize how brain function adapts in a number of contexts55. Here, modularity, Q63, was defined in the standard way by:

$$Q = \frac{1}{{2m}}\mathop {\sum }\limits_{ij} \left( {A_{ij} - \gamma \frac{{k_ik_j}}{{2m}}} \right)\delta \left( {c_i,c_j} \right),$$
(1)

where Aij represents the weight of FC (correlation) between ROI i and j, γ is the structural resolution free parameter (set to 1) and $$\frac{{k_ik_j}}{{2m}}$$ is the expected null FC defined with $$k_i = \mathop {\sum}\nolimits_j {A_{ij}}$$ as the total FC across all connections with ROI i ci is the community to which ROI i is assigned, $$\delta \left( {c_i,c_j} \right)$$ is the Kronecker δ function and equals 1 if ROI i and j belong to the same community and 0 otherwise64 and $$m = \frac{1}{2}\mathop {\sum}\nolimits_{ij} {A_{ij}}$$ is the total FC of the network.

To allow valid comparisons between patients and scans, the modularity scores were generated 100 times and the partition with the largest modularity score was normalized by the mean modularity generated from 100 randomly rewired (shuffled) FC matrices65. This common procedure was applied to account for the nondeterministic and near-degenerate partitions (solutions with differing but similar optimality) generated by Louvain algorithms and to account for modularity scores relating to the total sum of FC within the network66. This process was repeated independently for each patient and scan.

### Functional cartography

The community detection procedure generates a community assignment to each ROI. We used these labels to determine the extent to which ROIs were recruited to the functional network that they typically ‘belong to’, as defined by healthy adults (such as DMN regions should reliably form communities with each other).

First, we created an allegiance matrix, P33, which represented the probability that two regions i and j were assigned to the same community across the 100 iterations of the modularity algorithm, defined here as:

$$P_{ij} = \frac{1}{o}\mathop {\sum}\limits_{o = 1}^O a \frac{{k,o}}{{i,j}}$$
(2)

where O = 100 as the number of partitions. For each partition, $$a_{i,j}^{k,o}$$ equals 1 if regions i and j belong to the same community.

Using the allegiance matrix, we then summarized how often ROIs either formed communities with ROIs from the same functional network (network recruitment) or formed communities with ROIs between different networks (between-network integration) across the partitions33. These functional cartography measures were then normalized against the mean values from 1,000 randomly shuffled ROI network assignments to account for differences in the number of regions in each network55. Finally, network recruitment and between-network integration scores were averaged at the network level using seven predefined cortical networks61.

### Dynamic flexibility

The short TR used in the fMRI protocol of study 2 generated approximately twice the number of time points, and this afforded an additional analysis of dynamic flexibility. Multilayer modularity estimation34 was conducted using a N × N × T matrix of 30 volume-sliding windows (37.5 s of real time) with 50% overlap. This window size is typical for estimating dynamic FC with fMRI54. For each patient and scan, multilayer modularity, QML, was estimated 100 times from each N × N × T FC matrix by:

$$Q_{{\mathrm{ML}}} = \frac{1}{{2\mu }}\mathop {\sum }\limits_{ijlr} \left[ {\left( {A_{ijl} - \gamma _l\frac{{k_{il}k_{jl}}}{{2m_l}}} \right)\delta _{lr} + \delta _{ij}\omega _{jlr}} \right]\delta \left( {c_{il},c_{jr}} \right),$$
(3)

where $$\mu = \frac{1}{2}\mathop {\sum}\nolimits_{ijl} {A_{ijl}}$$ is the total FC of the multilayer network, and $$m_l = \frac{1}{2}\mathop {\sum}\nolimits_{ijl} {A_{ijl}}$$ is the total FC of layer l, Aijl is the FC between ROI i and j at layer l, $$\frac{{k_{il}k_{jl}}}{{2m_l}}$$ is the expected null FC at layer l. The two free γ and ω structural and temporal resolution parameters are used to scale the number of communities and strength of inter-layer edges, respectively. As is typical for fMRI modularity analyses, both were set to 1 (refs. 33,55).

The multilayer modularity estimation generates an N × T matrix where each element represents the community assignment of each ROI at each layer (time window). From this, the flexibility metric, f, can be simply calculated as the number of times an ROI changes its community allegiance, given the number of observations33:

$$f_i = 1 - \frac{1}{{T - 1}}\mathop {\sum}\limits_l^{T - 1} \delta \left( {c_{il},c_{jl + 1}} \right),$$
(4)

Flexibility scores close to 0 represent rigid ROIs whose community allegiance is stable across time, scores close to 1 represent flexible ROIs whose community allegiance regularly changes (highly flexible). Network level flexibility scores were defined by the average flexibility of ROIs assigned to the given network.

### Reporting Summary

Further information on research design is available in the Nature Research Reporting Summary linked to this article.