The number of individuals within a population or community and their body size can be associated with changes in resource supply. While these relationships may provide a key to better understand the role of abiotic vs. biotic constraints in animal communities, little is known about the way size and abundance of organisms change along resource gradients. Here, we studied this interplay in ants, addressing two hypotheses with opposite predictions regarding variation in population densities along resource gradients-the 'productivity hypothesis' and the 'productivity-based thinning hypothesis'. The hypotheses were tested in two functional groups of ground-dwelling ants that are directly primary consumers feeding on seeds: specialized seed-eaters and generalist species. We examined variations in colony density and foraging activity (a size measurement of the forager caste) in six ant assemblages along a steep productivity gradient in a semi-arid region, where precipitation and plant biomass vary 6-fold over a distance of 250km. An increase in the density or foraging activity of ant colonies along productivity gradients is also likely to affect competitive interactions among colonies, and consequently clinal changes in competition intensity were also examined. Ant foraging activity increased with productivity for both functional groups. However, colony density revealed opposing patterns: it increased with productivity for the specialized seed-eaters, but decreased for the generalist species. Competition intensity, evaluated by spatial partitioning of species at food baits and distribution of colonies, was uncorrelated with productivity in the specialized seed-eaters, but decreased with increasing productivity in the generalists. Our results provide support for two contrasting hypotheses regarding the effect of resource availability on the abundance of colonial organisms-the 'productivity hypothesis' for specialized seed-eaters and the 'productivity-based thinning hypothesis' for generalist species. These results also stress the importance of considering the role of functional groups in studies of community structure.