The formation of associative memories requires the strengthening of cortical synapses, which temporarily disrupts the excitation–inhibition (EI) balance. Functional MRI was used to analyse subvoxel neuronal activity patterns in the cortex of individuals who had been trained to associate pairs of stimuli. The neuronal activity patterns produce by paired stimuli showed representational overlap that gradually diminished as EI balance was restored. Local reduction in cortical GABA reinstated the EI imbalance, representational overlap and cortical memory, suggesting that associative memories are stored in cortical ensembles in which there is a balance between excitation and inhibition.