The framework may pass K in different forms (packed or unpacked). Use max(K*2, hidden_dim) to handle both cases.