Associative learning enables the adaptive adjustment of behavioral decisions based on acquired, predicted outcomes. The valence of what is learned is influenced not only by the learned stimuli and their temporal relations, but also by prior experiences and internal states. In this study, we used the fruit flyDrosophila melanogasterto demonstrate that neuronal circuits involved in associative olfactory learning undergo restructuring during extended periods of low-caloric food intake. Specifically, we observed a decrease in the connections between specific dopaminergic neurons (DANs) and Kenyon cells at distinct compartments of the mushroom body. This structural synaptic plasticity was contingent upon the presence of allatostatin A receptors in specific DANs and could be mimicked optogenetically by expressing a light-activated adenylate cyclase in exactly these DANs. Importantly, we found that this rearrangement in synaptic connections influenced aversive, punishment-induced olfactory learning but did not impact appetitive, reward-based learning. Whether induced by prolonged low-caloric conditions or optogenetic manipulation of cAMP levels, this synaptic rearrangement resulted in a reduction of aversive associative learning. Consequently, the balance between positive and negative reinforcing signals shifted, diminishing the ability to learn to avoid odor cues signaling negative outcomes. These results exemplify how a neuronal circuit required for learning and memory undergoes structural plasticity dependent on prior experiences of the nutritional value of food.