It's a smell I've recognized since childhood. Popular Science reports on the ability to detect or recognize the odor(s).
The most common type of ant that people find in their homes on the East Coast and in the Midwest is called the odorous house ant, and when squished, it releases a pheromone that smells like blue cheese. This odorous chemical belongs to a group of chemical compounds called methyl ketones...But that’s far from the only smelly compound ants produce. Some species, including carpenter ants, spray formic acid, a caustic chemical that smells a lot like vinegar, when they feel threatened. (Some people think that the ability to smell formic acid is genetic, like asparagus, and that might be why some people are more sensitive to this particular ant smell than others.) Citronella ants are named for the distinctive citrusy scent they often produce, and trap-jaw ants release a chocolatey smell when squished. When ants die of natural causes, they also release oleic acid, so dead ants “smell a little something like olive oil,” Penick says.
Doesn't smell like blue cheese to me. Smells like "you just dug into an ant nest."