Division of labour is one of the most prominent features of social insects. The efficient allocation of individuals to different tasks requires dynamic adjustment in response to environmental perturbations. Theoretical models suggest that the colony-level flexibility in responding to external changes and internal perturbation may depend on the within-colony genetic diversity, which is affected by the number of breeding individuals. However, these models have not considered the genetic architecture underlying the propensity of workers to perform the various tasks. Here, we investigated how both within-colony genetic variability (stemming from variation in the number of matings by queens) and the number of genes influencing the stimulus (threshold) for a given task at which workers begin to perform that task jointly influence task allocation efficiency. We used a numerical agent- based model to investigate the situation where workers had to perform either a regulatory task or a foraging task. One hundred generations of artificial selection in populations consisting of 500 colonies revealed that an increased number of matings always improved colony performance, whatever the number of loci encoding the thresholds of the regulatory and foraging tasks. However, the beneficial effect of additional matings was particularly important when the genetic architecture of queens comprised one or a few genes for the foraging task’s threshold. By contrast, a higher number of genes encoding the foraging task reduced colony performance with the detrimental effect being stronger when queens had mated with several males. Finally, the number of genes encoding the threshold for the regulatory task only had a minor effect on colony performance. Overall, our numerical experiments support the importance of mating frequency on efficiency of division of labour and also reveal complex interactions between the number of matings and genetic architecture.