Prior expectations can be used to improve perceptual judgments about ambiguous stimuli. However, little is known about if and how these improvements are maintained in dynamic environments in which the quality of appropriate priors changes from one stimulus to the next. Using a novel sound-localization task, we show that changes in stimulus predictability lead to arousal-mediated adjustments in the magnitude of prior-driven biases that optimize perceptual judgments about each stimulus. These adjustments depend on task-dependent changes in the relevance and reliability of prior expectations, which subjects update using both normative and idiosyncratic principles. The resulting variations in biases across task conditions and individuals are reflected in modulations of pupil diameter, such that larger stimulus-evoked pupil responses correspond to smaller biases. These results suggest a critical role for the arousal system in adjusting the strength of perceptual biases with respect to inferred environmental dynamics to optimize perceptual judgements.