A central challenge in psychiatry is to link different levels of explanation: we have a poor understanding of how changes at the synaptic level (in particular drug interventions) lead to changes in cognition and behaviour (where symptoms manifest). I will argue that understanding both symptoms and interventions on an algorithmic level can provide the missing link. As an example, I will examine the role of NMDA receptor dysfunction in psychiatry. I will present work suggesting that blocking NMDA receptors changes how past observations are integrated with new information, using auditory mismatch paradigms as well as perceptual choice tasks. Finally, I will present ideas and ongoing experiments on how this algorithmic motif, when extended into the reward and interoceptive domains, could explain the remarkable clinical profile of the NMDA receptor antagonist ketamine – a drug that serves both as a pharmacological model of psychosis, and as a fast-acting antidepressant.