That's right, the Attention Layer output is totally deterministic.
The temperature parameter is related to generative tasks (note that this is not the only thing you can do with Attention and the transformers architecture), and it controls how, given the logits (a vector of the same length as the vocabulary $V$, the model samples one token among all the available tokens.
Suppose, for simplicity, that we are doing Causal generation and we have a vector of logits $u$ of length $V$
If you do not sample and take just the most probable token at each time step (i.e the $\arg\max$ of the logits), you always end up with the same generation, given a fixed input.
Otherwise, we can model the distribution of probability over all tokens with a softmax and sample one token from the distribution at each step $t$.
$$\mathbb{P}(x=v_l | x_{1:t-1}) = \frac{\exp(u_l )}{\sum_{l'}\exp(u'_l)} \qquad \text{where}\; v_l = x_{1:t-1}l \;, \forall l \in V$$
The temperature modifies this distribution by warping the previous distribution, multiplying the terms inside the exponential by a factor $t$.
$$\mathbb{P}(x=v_l | x_{1:t-1}) = \frac{\exp(u_l/t)}{\sum_{l'}\exp(u'_l/t)} \qquad \text{where}\; v_l = x_{1:t-1}l \;, \forall l \in V$$
For $t \rightarrow 1$, the distribution gets sharper, as it tends to a indicator function over the maximum token (the $\arg \max$), and for $t = 1$ it is equivalent to the softmax formula above.
If instead you choose $t > 1$, the probability distribution of predicted tokens will flatten, i.e the distribution will tend to a uniform distribution as $t \rightarrow \infty$.
References: https://huggingface.co/blog/how-to-generate