The adaptive benefits of individual specialization and how learning abilities correlate with task performance are still far from being well-understood. Red wood ants are characterized by their huge colonies and deep professional specialization. We hypothesized that red wood ants Formica aquilonia form aversive learning after having negative encounters with hoverfly larvae differently, depending on their task specialization. We tested this hypothesis, first, by examining whether hunters and aphid milkers learn differently to avoid the nuisance of contacts with syrphid larvae, and, second, by analyzing the difference between learning in "field" and laboratory-reared (naïve) foragers. During the first interaction with the syrphid larva in their lives the naïve foragers showed a significantly higher level of aggressiveness than the members of a natural colony. Naïve foragers applied the "mortal grip," "prolonged bites," and "nibbling" toward the enemy with a significantly higher frequency, whereas members of both "field" groups behaved more carefully and tried to avoid encounters with the larva. The aphid milkers, who had a negative experience of interaction with the larva, being "glued" with its viscous secretion, behaved much less aggressively in the follow-up experiments after 10 min and even 3 days, thus exhibiting the shaping of both short- and long-term memories. However, both "field" hunters and naïve foragers demonstrated no signs of aversive learning. These data provide some new insights into the relationship between task specialization and learning performance in ants. Given our previous results, we speculate that scouts and aphid milkers are the most cognitively gifted specialists in red wood ants, whereas hunters and guards are rather brave than smart.