Enhanced multi-head attention with RoPE, scalable softmax, and KV caching
Source:R/layers.R
multihead_attention.RdEnhanced multi-head attention with RoPE, scalable softmax, and KV caching
Arguments
- embed_dim
Integer. Model dimension (total size of each attention head combined).
- num_heads
Integer. Number of attention heads.
- dropout
Numeric. Dropout probability applied to attention weights (default:
0.0).- ssmax
Logical or character. Type of scalable softmax to use:
FALSEor"none": No scaling appliedTRUEor"qassmax-mlp-elementwise": Elementwise query-aware scalingOther strings: specific scalable softmax type (default:
FALSE)