%0 Journal Article %T Use of social thermoregulation fluctuates with mast seeding and reproduction in a pulsed resource consumer. %A Ruf T %A Bieber C %J Oecologia %V 192 %N 4 %D Apr 2020 %M 32166391 %F 3.298 %R 10.1007/s00442-020-04627-7 %X Edible dormice (Glis glis) can remain entirely solitary but frequently share sleeping sites with conspecifics in groups of up to 16 adults and yearlings. Here, we analysed grouping behaviour of 4564 marked individuals, captured in a 13-year study in nest boxes in a deciduous forest. We aimed to clarify (i) whether social thermoregulation is the primary cause for group formation and (ii) which factors affect group size and composition. Dormice temporarily formed both mixed and single-sex groups in response to acute cold ambient temperatures, especially those individuals with small body mass. Thus, thermoregulatory huddling appears to be the driving force for group formation in this species. Huddling was avoided-except for conditions of severe cold load-in years of full mast seeding, which is associated with reproduction and high foraging activity. Almost all females remained solitary during reproduction and lactation. Hence, entire populations of dormice switched between predominantly solitary lives in reproductive years to social behaviour in non-reproductive years. Non-social behaviour pointed to costs of huddling in terms of competition for local food resources even when food is generally abundant. The impact of competition was mitigated by a sex ratio that was biased towards males, which avoids sharing of food resources with related females that have extremely high energy demands during lactation. Importantly, dormice preferentially huddled in male-biased groups with litter mates from previous years. The fraction of related individuals increased with group size. Hence, group composition partly offsets the costs of shared food resources via indirect fitness benefits.