Well, I can only guess that it is random but the system seems to have a higher chance to upgrade one thing to another (e.g. material seems to be preferred to number or exec). My rule of thumb is: if I want the quantitiy to go up, it's guaranteed to be the material, which then renders the whole bod useless for what I need it for. I have never heard anybody saying that you can influence which parameter is being upped or that you can foresee it and maybe move on to another NPC to try again. But then, if one could guarantee a certain outcome, it would make it a bit too easy I guess...