32 independent transformer blocks › Attention
Attention weights
×tensorscores · 187
Normalized weights over the allowed key positions for each query.
- shape
- [B batch, 32 q heads, 1 queries, 1001 keys]
Codemodel.py 187
scores = F.softmax(scores.float(), dim=-1).type_as(xq)Sources1
Contextual evidence
Softmax normalizes the last score axis in float32 and restores the query dtype.
attn-softmax · meta-llama/llama3 / llama/model.py
Pinned revision a0940f9cf706 ↗ · lines 187–187
Read code excerpt
scores = F.softmax(scores.float(), dim=-1).type_as(xq)