Natural selection at all levels requires heritable phenotypic variation among units. At the group level, variation is often increased by reproduction coupled with limited dispersal, which forms the basis of kin selection and traditional group selection models. Assortative interactions are another possible mechanism for creating variation among groups that has received less attention. We present a series of models in which altruism is a continuously varying trait and individuals are free to choose their associates, based on information that is acquired through experience, observation, or cultural transmission. Assortative interactions can generate highly nonrandom variation among groups, favoring the evolution of altruism and other group-level adaptations among genealogically unrelated individuals. Altruism can evolve even when the initial phenotypic variation in altruism is not heritable, a form of genetic assimilation. The importance of assortative interactions depends in part on cognitive abilities that...