Swarming locusts not only look different and act differently to solitary locusts, they also have much larger brains.
This is according to scientists at the University of Cambridge who captured images of the results of dramatic changes inside the insects' heads.
The team described how the same locust could switch between a "solitary" and "gregarious" (swarming) phase.
They described their findings in Proceedings of the Royal Society B.
"Normally locusts would avoid close contact with each other," explained Dr Swidbert Ott of the UK's University of Cambridge. "It's only when they are forced to be in close contact that they change dramatically."
This is a survival mechanism. It occurs when the insects run out of food and are forced together onto any remaining patches of vegetation.
"So they have to travel in this massive swarm to find the new patches," said Dr Ott.
Working with colonies of gregarious locusts, Dr Ott and his Cambridge colleague Dr Stephen Rogers, converted some of them into the solitary phase by keeping them in isolation for three generations.
"Solitarious locusts are a real pain to keep," he revealed. "You can't keep them together or they will change, so every one is kept like a race horse in its little stable - we have about 100 individual boxes with all the supplies they need."
At the end of this three-generation breeding programme, the scientists imaged and measured the insects' brains.
They discovered that the brains of gregarious locusts were 30% larger.
"You find that brain regions specifically to do with things like learning and memory are massively enlarged in the gregarious ones," explained Dr Ott.
He said that this difference, although surprising, did make evolutionary sense.
"Inside the swarm, they're swamped with information.
"The higher bits of the brain that deal with complexity allow them to make sense of the mayhem going on around them."
Dr Ott and his team had previously shown that a signalling chemical in the brain, called serotonin, was crucial in this sudden change in the insects' behaviour - causing a solitary creature to become part of this frenzied swarm.
When this sudden behavioural change happens, the locusts also (much more gradually) change in colour and even body shape.
"People used to think that the two phases were actually two different species," said Dr Ott.
He concluded: "Being inside these swarms is really a messy business - it's driven by hunger and the need to figure out where to find new food.
"These insects even turn to cannibalism - if you're not quick enough you turn into lunch, so the [big] brain gives them the edge in a cut throat situation."