Attention is a handful of matrix operations: dot products, a softmax and a weighted sum. Written out for a few tokens, each step is small enough to inspect by eye.
You will see what goes wrong without the scale factor, compute the weights robustly, and mix the values with them.