It seems to be kind of random for me... I just finished a DS playthrough and my companions seemed to be either AT mastery or a hairsbreadth away, and it changed many times, even if I never got any LS points! I even got fed up at one point and went into KSE, only to find that at 100% inf and max dark alignment, my NPCs had something like 10 alignment, even after I tried to change it! (I did it properly and it DID register, but after a while it just... went back.)
I think there may be a slight glitch in companion masteries...