Implement grouped-query attention by mapping query heads onto fewer key-value heads with validated head divisibility.