NEW YORK For decades, people have been getting rid of cockroaches by setting out bait mixed with poison. But in the late 1980s, in an apartment test kitchen in Florida, something went very wrong.

A killer product stopped working. Cockroach populations there kept rising. Mystified researchers tested and discarded theory after theory until they finally hit on the explanation: In a remarkably rapid display of evolution at work, many of the cockroaches had lost their sweet tooth, rejecting the corn syrup meant to attract them.

In as little as five years, the sugar-rejecting trait had become so widespread that the bait had been rendered useless.

Get Breaking News Delivered to Your Inbox

"Cockroaches are highly adaptive, and they're doing pretty well in the arms race with us," said North Carolina State University entomologist Jules Silverman, discoverer of the glucose aversion in that Florida kitchen during a bait test.

The findings illustrate the evolutionary prowess that has helped make cockroaches so hard to stamp out that it is jokingly suggested they could survive nuclear war.

In a study published Thursday in the journal Science, Silverman and other researchers explain the workings of the genetic mutation that gave some roaches a competitive advantage that enabled them to survive and multiply.

The key is certain neurons that signal the brain about foods.

In normal cockroaches, glucose excites neurons that tell the brain "Sweet!" In the mutant insects, glucose activates neurons that say "Sweet!" and ones that say "Yuck!" The "Yuck!" neurons dampen the signal from the others, so the brain gets the message the taste is awful. This unusual nerve activity appeared in glucose-hating cockroaches collected from Puerto Rico as well as descendants of the Florida insects.

The research focused on the German cockroach, a small kind that can hitch a ride into your home in a grocery bag, not that big lunk known as the American cockroach. Such finicky eating habits have also been seen in these smaller roaches in Southern California, Cincinnati, Indiana, South Korea and Russia. Scientists are now looking to see if other kinds of cockroaches show aversion to glucose.

The new work is nifty science. But does it explain why you can't get rid of the little buggers in your kitchen?

Probably not, said Coby Schal, another study author at North Carolina State.

Tests show that the glucose-hating cockroaches are happy to eat most types of bait these days, suggesting that manufacturers have removed the glucose or masked it, he said. (Bait ingredients are a trade secret.) What's more, the researchers found glucose-hating cockroaches in only seven of 19 populations they sampled from various locations.

Frankly, if the bait you put out isn't working, it's probably because you're using it incorrectly, suggested Schal, who said he consults to the pesticide industry free of charge.

Still, he said, the new work has potential to help many consumers. By studying how cockroaches evolve to evade our poisons, scientists may find clues to designing bait that the pests cannot resist.

It's not clear when the Florida cockroaches first encountered bait with glucose or how quickly they ditched their taste for the sugar, he said. But he said it's reasonable to estimate that it took maybe only five years for that glucose aversion to spread to so many cockroaches that the bait was no longer effective. That's about 25 generations of German cockroaches, which can reproduce about one to three months after they're born, Schal said.

The glucose aversion may have arisen in an individual cockroach in response to bait. Or it may have already been present in just a few individuals when the arrival of the bait suddenly gave them an advantage for surviving and reproducing. Their offspring would inherit the trait and increasingly replace other cockroaches.

Michael Scharf, an entomologist at Purdue University who studies urban pests but wasn't involved in the new work, noted that since the 1950s, cockroaches have shown they can also evolve resistance to insecticides. He agreed the latest results should help scientists develop better products to control roaches.