Updating beliefs in changing environments can be achieved either by gradually adapting expectations or by identifying a hidden structure composed of separate states, and inferring which state fits observations best. Previous studies have found that a state inference mechanism might be associated with relapse phenomena, such as return of fear, that commonly represent a major obstacle in clinical treatment of anxiety disorders. Here, we tested whether variability in trait anxiety among healthy individuals is associated with a tendency towards inferring a hidden structure of an aversive environment, as opposed to learning gradually from observations. In a Pavlovian probabilistic aversive learning paradigm, participants had to follow changes in cue-associated shock contingencies by providing probability ratings on each trial. In three sessions, the contingencies switched between high and a low levels of shock probability (60/40%, 75/25% or 90/10%). High trait anxiety was associated with steeper behavioral switches after contingency reversals, and more accurate probability ratings overall. To elucidate the computational mechanisms behind these behavioral patterns, we compared a 1-state model, which reflects gradual updating, with a novel state-inference model (n-state). High trait anxiety was associated with improved fit of the state inference model (n-state) compared to the gradual model (1-state) in the session characterized by the largest shock contingency changes (90/10). This finding provides evidence that trait anxiety variations among health adults are associated with tendency to infer hidden causes that generate the observed aversive outcomes. This was particularly evident in environments with larger contingency changes and less outcome uncertainty. This association may contribute to relapse phenomena observed among high trait anxious individuals.