Yeah I never liked the retreat system. Especially if you're the attacker on a siege of a castle or city. If we retreat, we lose 100% of our troops, but keep a lot of the gear. You should keep some troops on a retreat. Or change the name to surrender from retreat.
That really irks me on castle sieges, you should be able to retreat towards the end with 500 troops when you run out of ladders or it's a lost cause...you should be able to tell your 500 remaining men in your siege camp, welp boys, pack it up, we're going home.
If the defenders don't sally out and take your flags, it should be seen as a retreat by the attackers (like the name says) not a surrender/sacrifice of all your troops.
Terrible system that is long due for some TLC.