Wererats are fairly iconic monsters for Dungeons & Dragons, but they are different in a number of ways from the other "lycanthropes" listed in the game rules. It occurred to me recently that when they were introduced by the original Dungeon Masters, Gary Gygax and Rob Kuntz, they might have been specifically inspired by the race of rat villains from Fritz Leiber's The Swords of Lankhmar.
There are a few things that might point to this. The ratmen were not among the original lycanthropes of the Dungeons & Dragons game, first appearing in the 1975 Greyhawk supplement.
Moreover, unlike the other D&D lycanthropes (the standard werewolf, wereboar, weretiger, and werebear*) the ratmen are specifically described as having the ability to take three forms: human, animal, and (uniquely) a shape intermediate between the other two. This is described a "rat-like shape, smaller than a man but much larger than a normal rat" in the first edition AD&D Monster Manual; as in the Grayhawk supplement, the wererats in the Monster Manual are illustrated in their intermediate form.
The AD&D wererats are also specifically urban monsters, as "... these sly and evil creatures inhabit subterranean tunnel complexes beneath cities."
All these elements are similar to the villains in Leiber's novel. The rats in the story—or at least their leaders—are intermediate in form between humans and rats. Some of the ratmen (and ratwomen) can pass for humans when they are well covered up, and conversely, the Mouser infiltrates the rats and is able to pass for one of them as long as he remains cloaked and hooded. The rats dwell in a extensive nidus of tunnels underneath Lankhmar itself, from which they venture forth to prey upon humans.
In fact, when Lankhmar was released as an official AD&D setting, the ratmen from The Swords of Lankhmar were explicitly identified as wererats, in spite of the fact that the Lankhmar ratmen were unable to change shape (and required magical potions—the origin of D&D's potion of diminution?—to change between human-sized and rat-sized forms).
The Fafhrd and Gray Mouser stories, as a general matter, were frequently cited as being extremely influential on the development of Dungeons & Dragons. But are there any specific comments from the creators and designers of the game on this specific aspect—the invention of the wererats?
*The werebear is (like the halfling, the type VI demon, and ranger class) another one of the unambiguous Tolkien references in D&D. Some versions of the werebear description point out how these individuals, while solitary, are good aligned and may be willing to assist groups of adventurers—all just like Beorn.