# Interaction-aware agent-based simulation of customer trajectories in retail stores with transformer architectures

**Authors:** Taizo Horikomi, Takayuki Mizuno

PMC · DOI: 10.1038/s41598-025-22885-4 · Scientific Reports · 2025-11-06

## TL;DR

This paper introduces a Transformer model that simulates customer movement in retail stores by learning from real data, capturing interactions and adaptive behaviors.

## Contribution

The novel asymmetric loss masking scheme allows learning focal customer behavior while using neighbors as context.

## Key findings

- The model reproduces adaptive behaviors like rerouting and slowing down without predefined rules.
- Simulations replicate real-world spatial density and congestion effects observed in retail stores.

## Abstract

We propose a Transformer-based generative model that learns socially responsive customer trajectories in retail stores directly from data. Each trajectory is represented as a sequence of symbolic tokens that encode not only the self-location of the focal customer but also the positions of their nearest neighbors at each timestep. This interaction-aware encoding enables the model to reproduce adaptive behaviors—such as slowing down, rerouting, and early disengagement—without predefined rules. To ensure that only the focal customer’s behavior is learned while using neighbors as context, we introduce an asymmetric loss masking scheme that excludes non-focal tokens from prediction targets. The model is trained from scratch using high-resolution indoor positioning data and validated through large-scale agent-based simulations under varying crowding levels. In these simulations, each agent is equipped with a Transformer module that predicts its next step based on local spatial context, enabling the system to evolve through decentralized, data-driven decision-making. The model replicates spatial density patterns, dwell time distributions, and congestion-induced speed reductions observed in real stores. This model offers a scalable and interpretable approach to trajectory generation in indoor commercial environments.

## Full-text entities

- **Diseases:** confusion (MESH:D003221)
- **Species:** Homo sapiens (human, species) [taxon 9606]

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/PMC12592343/full.md

## Figures

8 figures with captions in the complete paper: https://tomesphere.com/paper/PMC12592343/full.md

## References

13 references — full list in the complete paper: https://tomesphere.com/paper/PMC12592343/full.md

---
Source: https://tomesphere.com/paper/PMC12592343