Shoulders are Stability
Remember - your shoulders are for the bench press what your feet are for the squat. They are your base of support, and you want a wide and stable base of support when benching. With this in mind, you need to keep those shoulders pinned down and pulled back as much as possible. If you allow your shoulders to pop off the bench at the top of each rep, you’re adding an artificial, unstable, and inefficient range of motion to the lift. In addition, you now need to re-retract your shoulders before the next rep, and that’s wasted energy that you shouldn’t need to utilize.
You squat with your feet flat on the floor, so bench with your shoulders retracted and firmly attached to the bench.
How to Fix the Problem
First, and assuming that you’re already focused on keeping your shoulders back, you can remind yourself to “finish deliberately” or “lock out with control.” This will often help ensure that you aren’t aggressively causing your shoulders to get out of position.