(CNN)Summer is approaching in the northern hemisphere, heralding the return of that great scourge of al fresco diners everywhere: the wasp.
Now, a new study out of the University of Michigan reveals that the striped critters aren't just pesky -- they're smart.
The research found that wasps can use a form of logical reasoning to infer unknown relationships from known relationships, according to a press release.
Essentially this means they can work out that if is X is greater than Y, and Y is greater than Z, X is greater than Z -- an ability that was thought to be a key human trait for thousands of years.
In recent decades, however, scientists have shown that vertebrate animals such as birds, monkeys and fish also have this ability, known as transitive inference (TI).
And Elizabeth Tibbetts, an evolutionary biologist at the University of Michigan, has found the first evidence of TI in an invertebrate animal -- namely the paper wasp.
The insects, which are found around the world, are known for making distinctive nests out of chewed wood mixed with saliva that look like paper.
While the paper wasp's sting is toxic to humans, it is less painful than those of other wasp species.
A previous study investigated TI in honeybees, which failed the test, with their small nervous system thought to be a possible explanation.
Paper wasps have a similar-sized nervous system to honeybees, and both insects have brains about the same size as a grain of rice.
However paper wasps show more complex social behaviors.
Tibbetts was intrigued to discover whether these behaviors had any bearing on TI, and investigated by training wasps to discriminate between different pairs of colors.
She found the wasps quickly and accurately learned the pairs, and were later able to use what they had learned to organize a hierarchy of colors when confronted with new pairs of colors.
"This study adds to a growing body of evidence that the miniature nervous systems of insects do not limit sophisticated behaviors," Tibbetts said in the release.
"We're not saying that wasps used logical deduction to solve this problem, but they seem to use known relationships to make inferences about unknown relationships."
Tibbetts believes the explanation may lie in the differing social behaviors of paper wasps and honey bees.
While a honeybee colony has a single queen and multiple female workers of equal rank, paper wasp colonies are home to multiple reproductive females, called foundresses, which compete for dominance.
In such a situation, TI would help wasps make quick deductions about social interactions.
This means they can build and manipulate an implicit hierarchy, helping them to live in the colony, the press release said.
"Our findings suggest that the capacity for complex behavior may be shaped by the social environment in which behaviors are beneficial, rather than being strictly limited by brain size," said Tibbetts, who has been researching wasp behavior for 20 years.
Gavin Broad, Principal Curator in Charge (Insects) at the Natural History Museum in London, agrees with these conclusions.