This will happen in the back swing for a few reasons:

The above image is one that I see all too often. Look at the player’s shoulders. Anytime a player’s shoulders are that flat, I assure you, the club is off plane and the spine has straightened. You see, the shoulders can only turn on a plane that is perpendicular to the thoracic spine. So your key is not to think of keeping your head down, but rather, keeping your shoulders on plane. If you do so, your spine will remain in the same angle as it was at address.
Now you may find that in so doing you are very restricted. This goes to mobility. You must have a level of flexibility to move to the top of the swing while maintaining posture. Do you have it? If not, do not panic. There are some simple stretching routines that you can do in order to regain this mobility. Check out www.mytpi.com for stretching exercises or professionals certified to help you.

Above we see a player that has maintained good posture as he moved to the top of the swing. Because the upper spine stayed in the same angle, his shoulders are on plane and his head did not rise during the first part of the swing.
Next time I will discuss maintaining posture in the forward swing.