In previous versions i found that even undead creatures can be pacified and made to be non-aggresive due to the resolution to brawls, a dwarf in a long lost save about the 42.06 mark punched a undead jaguar to a pulp, but stopped short of killing it, and it slinked away off back into the map edge without future hassle through my settlement. The same thing has also happened with GCS who come in guns blazing, got beaten up then silently slink through the fortress totally ignored until it made it to its destination and left from the top over-world map.
Brawls & sanctioned only violence cause this kind of behaviour i believe.
Trolls and troglodytes also have emotional intelligence to remember and react to threats.
Kill a trog effortlessly with a militia and they'll never bother you again as long as 1 trogg witnessed it and ran, they instead run away in future, wheras let them kill a civvie in a brave charge and get cocky and they'll harrass you time and time again, the groups memorise this, and you can abuse it to tie them to chains, kill their kin while they watch then pit them to release, cavern trolls will up and run away when they see a dwarf after that (requires 2 trolls minimum and escaping troll successfully getting of the map before a new troll moves in), while still making charges for your workshops avoiding confrontation (put a militia guard outside and they'll skitter around, the guards wont react if you dont sanction future hostile trolls to be killed, to a stalemate).