On Zero-Initialized Attention: Optimal Prompt and Gating Factor Estimation