A key challenge for any animal (or sampling technique) is to avoid wasting time by searching for resources (information) in places already found to be unprofitable. In biology, this challenge is particularly strong when the organism is a central place forager—returning to a nest between foraging bouts—because it is destined repeatedly to cover much the same ground. This problem will be particularly acute if many individuals forage from the same central place, as in social insects such as the ants. Foraging (sampling) performance may be greatly enhanced by coordinating movement trajectories such that each ant (walker) visits separate parts of the surrounding (unknown) space. We find experimental evidence for an externalized spatial memory in Temnothorax albipennis ants: chemical markers (either pheromones or cues such as cuticular hydrocarbon footprints) that are used by nest-mates to mark explored space. We show these markers could be used by the ants to scout the space surrounding their nest more efficiently through indirect coordination. We also develop a simple model of this marking behaviour that can be applied in the context of Markov chain Monte Carlo methods (Baddeley et al. 2019 J. R. Soc. Interface 16, 20190162 (doi:10.1098/rsif.2019.0162)). This substantially enhances the performance of standard methods like the Metropolis–Hastings algorithm in sampling from sparse probability distributions (such as those confronted by the ants) with only a little additional computational cost. Our Bayesian framework for superorganismal behaviour motivates the evolution of exploratory mechanisms such as trail marking in terms of enhanced collective information processing.