Modern examples include the Zerg from _StarCraft_, Tyranids from _Warhammer 40,000_; the aliens from _Alien_ (1979) are also central examples and seem like the immediate antecedent for most modern takes. But it seems very unlikely that the earliest example was 1979, given the obvious historical fiction analogues, chief among them the Eighth Plague of Israel.

I'm hardly the first to ask the question; previous inadequate answers I've seen include Triffids (1951), less organized and less 'hungry', and the Eddorians/Boskone from _Lensman_ (1937-1948), which are much *more* organized but almost entirely missing the element of bestial hunger.

The one answer I've seen that might be adequate is _Starship Troopers_ (1959); it's been a long time since I read it and I don't remember how the Bugs are depicted, whether they're more like an empire or a swarm, and if it's the latter this is possibly the first central example. But they're often described as being metaphors for communism, where I'd expect the earliest swarms to be pure beasts or metaphors for more Mongol-type steppe nomads. So I suspect that there are older variants than the 50s, but I'm not sure where to look for them. Do these exist?