Summary of morphological dataFull size tableWe also discovered that in several Frieseomelitta species, guards are not only larger but also constitute a distinct color morph (Fig. 1d, f, g; Supplementary Fig. 2a). The degree of melanization differed significantly between guards and foragers (F. varia, linear mixed-effects (LMEs), t-value = 13.45, df = 81, P < 0.001, DI = 1.7; F. flavicornis, t-value = 8.84, df = 71, P < 0.001, DI = 1.5; F. longipes, t-value = 11.5, df = 23, P < 0.001, DI = 1.85). We measured cuticle thickness (i.e., sclerotization) in the clypeal area using transmission electron microscopy but found no difference between guards and foragers (LME, t-value = 1.57, df = 6, P = 0.16).We found negative allometry between body weight and head width in 9 of 24 tested species (Table 1). In other words, larger workers have relatively smaller heads. There was no association between negative allometry and having larger guards (Pagel's method24 for correlated evolution: likelihood ratio = 0.06, P = 0.97) (Table 1), indicating that negative allometry in stingless bees is not linked to the morphological differentiation between defence workers and foragers.Testing hypotheses explaining worker differentiationOur data allowed us to examine hypotheses that might explain inter-specific variation in the degree of worker differentiation in stingless bees. The developmental constraints hypothesis predicts a positive correlation between the variance in worker size and queen-worker dimorphism13, because an early queen-worker caste determination (and, therefore, greater Q-W dimorphism) provides more time for worker larvae to develop along different developmental pathways13,25. We performed a phylogenetically controlled analysis and found strong support for this prediction (GLS; t-value = 4.47, df = 10, P = 0.0012; Fig. 2a). Queen-worker dimorphism (i.e., relative size difference) explained more than 60% of the variation in worker diversity between species.Figure 2Factors explaining differences between species in worker diversity. a Relationship between queen-worker dimorphism (log-transformed) and worker diversity (log-transformed standard deviation of head width) (N = 12 species). The phylogeny is based on ref. 18 and a generalized least squares model (GLS) assuming Brownian motion was applied. The best fit line is based on a linear regression through the origin based on phylogenetically independent contrasts (PICs). Queen-worker dimorphism explained 63% of the variation in worker size variation between species. b Relationship between colony size (log-transformed) and worker diversity (log-transformed standard deviation of head width) (N = 27 species). A GLS model revealed no relationship between colony size and worker diversityFull size imageThe size-complexity hypothesis predicts that species with larger colony sizes have a more specialized division of labor and a more diverse workforce3,26,27,28. However, we found no relationship between colony size and worker size variation in our 28 species of stingless bees (GLS: t-value = 0.25, df = 26, P = 0.80) (Fig. 2b). We then tested if species with a significant difference in forager and guard size have larger colonies than species without, but we found no difference in colony size (GLS: t-value = 0.11, df = 26, P = 0.92).Phylogenetic analysisA reconstruction of the evolutionary history of worker differentiation suggests that the common ancestor of