Associative learning allows animals to establish links between stimuli based on their concomitance. In the case of Pavlovian conditioning, a single stimulus A (the conditional stimulus, CS) is reinforced unambiguously with an unconditional stimulus (US) eliciting an innate response. This conditioning constitutes an ‘elemental’ association to elicit a learnt response from A
+
without US presentation after learning. However, associative learning may involve a ‘complex’ CS composed of several components. In that case, the compound may predict a different outcome than the components taken separately, leading to ambiguity and requiring the animal to perform so-called non-elemental discrimination. Here, we focus on such a non-elemental task, the negative patterning (NP) problem, and provide the first evidence of NP solving in
Drosophila
. We show that
Drosophila
learn to discriminate a simple component (A or B) associated with electric shocks (+) from an odour mixture composed either partly (called ‘feature-negative discrimination’ A
+
versus AB
−
) or entirely (called ‘NP’ A
+
B
+
versus AB
−
) of the shock-associated components. Furthermore, we show that conditioning repetition results in a transition from an elemental to a configural representation of the mixture required to solve the NP task, highlighting the cognitive flexibility of
Drosophila
.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.