For instance, Q could generally be attracted to the "bad boy/bad girl" type. If Q understood where that motivation came from, Q could re-train him/herself to stay away from that unhealthy type. Actually, I think just the self-awareness itself bursts the particular bubble of attraction--when you see something for what it really is, your perspective changes.
I have heard about the bad-boy attraction and about various explanations of the root cause, but I wonder if anybody has ever come up with the right answer. I have my own theory that might fit some of these cases.