The mass troop bonus works for both defense and attack. We cannot disclose the exact details of the formula, but in general we can say that the more units you send, the less you will lose.