I will admit that there are races in which I think I left some time or places on the table because I looked up at the guys around me and thought that I should not be running with them and rather than dropping them, I kind of mentally deferred to them. It is a tough balancing act.
I try to accomplish finding that balance by listening to my body as much as I can. I like to try to run at least one of my long training intervals by feel rather than by watch. I also tend to implement an informal rule of not allowing myself to slow down over the course of my intervals sessions so that if I run my first mile repeat at 4:55 when I believe I am in 5:03 per mile shape, I commit to 4:55s for the remainder of my workout (both as penance for messing up the initial interval and in an effort to see if my fitness has improved more quickly than I had anticipated). I also try to race on a fairly regular basis so that I can test my fitness and drop my workout times if the other things mentioned above have not already dropped them. Unfortunately, the frequent racing approach doesn't always work for me because I often end up in no man's land during local races, in which case I focus on feel and effort, but that rarely results in me popping a big race running solo.
At the end of the day, like I said, it is a balancing act. I carry that balancing act out by way of experience and knowing my body and listening to the cues I am being given.
I think less experienced runners tend to think "well, I only kept up with the lead guys for the first 1200 of the first mile interval, but next time maybe I will make it the whole mile, and then the time after that I will make it part way through the second interval." I think this is wrong headed thinking. When the disparity is that big, you end up losing out on the physiological benefit of the workout (even the later slower intervals won't add much because you are so worn out from the first interval's effort) and you have lost a week of opportunity to improve, meaning you are falling even further behind the guys you are trying to keep up with.