it isnt until after you get the mission to go inside the institute that you have to make a choice... after that your forced to pick a side.
The quest will tell you to talk to your allies (and it is at that point that you make your final choice)
You can go quite a decent amount further than when you initially enter the institute before being forced to make your final choice. The choice that you make in order to enter the Institute does not matter as far as your final faction decision goes. You can go up to a quest called "Mass Fusion" before having to start removing faction choices. You will be told explicitly by the game during Mass Fusion when your choice will make another faction hostile. Up to that point, you can continue doing storyline quests with different factions without worrying about making them angry, even if it seems like it would. The factions are quite dense/trusting.