Flaking could be caused by:
1. Wrong paint originally used.
2. Beam wrongly prepared before painting.
3. Damp.
4. Age.
5. Excessive heat applied over time.
6. Chemical reaction with something that's come into contact with the paint.
7. Something I haven't thought of.
Remove flaking paint with a wire brush and/or sandpaper. If steel beam is bare steel, apply primer to prevent rusting and re-paint with suitable paint. If steel beam is rusty, remove rust before applying primer. If beam is already nicely painted or coated underneath the flaking paint, just clean and then paint on top of that surface.
Edit: I specified red oxide primer in my answer before, but it sounds like this might not always be suitable or appropriate. Sorry about that.