Slower perceptual alternations, a notable perceptual effect observed in psychiatric disorders, can be alleviated by antidepressant therapies that affect serotonin levels in the brain. While these phenomena have been well documented, the underlying neurocognitive mechanisms remain to be elucidated. Our study bridges this gap by employing a computational cognitive approach within a Bayesian predictive coding framework to explore these mechanisms in depression. We fitted a prediction error (PE) model to behavioral data from a binocular rivalry task, uncovering that significantly higher initial prior precision and lower PE led to a slower switch rate in patients with depression. Furthermore, serotonin-targeting antidepressant treatments significantly decreased the prior precision and increased PE, both of which were predictive of improvements in the perceptual alternation rate of depression patients. These findings indicated that the substantially slower perception switch rate in patients with depression was caused by the greater reliance on top-down priors and that serotonin treatment's efficacy was in its recalibration of these priors and enhancement of PE. Our study not only elucidates the cognitive underpinnings of depression, but also suggests computational modeling as a potent tool for integrating cognitive science with clinical psychology, advancing our understanding and treatment of cognitive impairments in depression.