Neural responses in association brain areas during cognitive tasks are heterogeneous, and the widespread assumption is that this heterogeneity reflects complex dynamics involved in cognition. However, the complexity may arise from a fundamentally different coding principle: the collective dynamics of a neural population encode simple cognitive variables, while individual neurons have diverse tuning to the cognitive variable, similar to tuning curves of sensory neurons to external stimuli. We developed an approach to simultaneously infer neural population dynamics and tuning functions of single neurons to the latent population state. Applied to spike data recorded from primate premotor cortex during decision-making, our model revealed that populations of neurons encoded the same dynamic variable predicting choices, and heterogeneous firing rates resulted from the diverse tuning of single neurons to this decision variable. The inferred dynamics indicated an attractor mechanism for decision computation. Our results reveal a unifying geometric principle for neural encoding of sensory and dynamic cognitive variables.