This paper analyzes social group formation when agents are subject to peer effects within groups increasing human capital and instantaneous utility. When agents are heterogeneous on two dimensions, ability and social skills, and monetary payments are not feasible the model predicts segregation at the top and at the bottom of the attribute space and bunching for heterogeneous intermediate types. Groups may be heterogeneous in taste types and more heterogeneous types are more likely to participate. The equilibrium allocation does not induce cost-efficient human capital accumulation. Introducing ability tracking may produce beneficial results despite decreasing differences in human capital production.