Mapping of attention mechanisms to a generalized Potts model | Synapse