Neuronal ensembles are coactive groups of cortical neurons, found in spontaneous and evoked activity, that can mediate perception and behavior. To understand the mechanisms that lead to the formation of ensembles, we co-activated layer 2/3 pyramidal neurons in brain slices from mouse visual cortex, in animals of both sexes, replicating in vitro an optogenetic protocol to generate ensembles in vivo. Using whole-cell and perforated patch-clamp pair recordings we found that, after optogenetic or electrical stimulation, coactivated neurons increased their correlated activity, a hallmark of ensemble formation. Coactivated neurons showed small biphasic changes in presynaptic plasticity, with an initial depression followed by a potentiation after a recovery period. Optogenetic and electrical stimulation also induced significant increases in frequency and amplitude of spontaneous EPSPs, even after single-cell stimulation. In addition, we observed unexpected strong and persistent increases in neuronal excitability after stimulation, with increases in membrane resistance and reductions in spike threshold. A pharmacological agent that blocks changes in membrane resistance reverted this effect. These significant increases in excitability can explain the observed biphasic synaptic plasticity. We conclude that cell-intrinsic changes in excitability are involved in the formation of neuronal ensembles. We propose an 'iceberg' model, by which increased neuronal excitability makes subthreshold connections suprathreshold, enhancing the effect of already existing synapses, and generating a new neuronal ensemble.In the brain, groups of neurons that are activated together – also known as neuronal ensembles – are the basic units that underpin perception and behavior. Yet, exactly how these coactive circuits are established remains under investigation. In 1949, Canadian psychologist Donald Hebb proposed that, when brains learn something new, the neurons which are activated together connect to form ensembles, and their connections become stronger each time this specific piece of knowledge is recalled. This idea that ‘neurons that fire together, wire together’ can explain how memories are acquired and recalled, by strengthening their wiring. However, recent studies have questioned whether strengthening connections is the only mechanism by which neural ensembles can be created. Changes in the excitability of neurons (how easily they are to fire and become activated) may also play a role. In other words, ensembles could emerge because certain neurons become more excitable and fire more readily. To solve this conundrum, Alejandre-García et al. examined both hypotheses in the same system. Neurons in slices of the mouse visual cortex were stimulated electrically or optically, via a technique that controls neural activity with light. The activity of individual neurons and their connections was then measured with electrodes. Spontaneous activity among connected neurons increased after stimulation, indicative of the formation of neuronal ensembles. Connected neurons also showed small changes in the strength of their connections, which first decreased and then rebounded after an initial recovery period. Intriguingly, cells also showed unexpected strong and persistent increases in neuronal excitability after stimulation, such that neurons fired more readily to the same stimulus. In other words, neurons maintained a cellular memory of having been stimulated. The authors conclude that ensembles form because connected neurons become more excitable, which in turn, may strengthen connections of the circuit at a later stage. These results provide fresh insights about the neural circuits underpinning learning and memory. In time, the findings could also help to understand disorders such as Alzheimer’s disease and schizophrenia, which are characterised by memory impairments and disordered thinking.