Cooperative groups can increase fitness either by helping kin or interacting with unlike individuals to produce social heterosis. They cannot, however, simultaneously maximize both benefits. This tradeoff between nepotism and diversity is modeled using Hamilton's rule (rb-c > 0), by allowing benefit and cost to be dynamic functions of relatedness (i.e., social heterosis predicts b and c depend on r). Simulations show that evolutionary outcomes tend to maximize either nepotism (with high genetic relatedness), or social heterosis (with low relatedness) rather than produce an intermediate outcome. Although genetic diversity can arise through multiple mating, a second possible mechanism-the exchanging of individuals across groups-is similarly effective. Such worker "drifting" is common in many species of social Hymenoptera and may be a form of indirect reciprocity. Drifting individuals increase an unrelated group's productivity by enhancing its genetic diversity, with this effect being reciprocated by other unrelated drifters entering their natal group. The benefits from social heterosis and indirect reciprocity are robust against cheating and show that it is possible to evolve stable cooperation between individuals that are genetically distant or unrelated. As drifting becomes more prevalent colony boundaries may become weakly discriminated, which may predispose toward the evolution of unicoloniality in some species.