O Yes yes the AI has a lot of formulas. You do not have to loose so many units! The AI priorities damaged units. Move in with a couple of fresh melee, and have a damaged unit that fortifies in preferably rough terrain with uppgrades. The AI will shoot at this unit. There are lots more you can do, for example take the most damaged unit and move it behind mountain or something else. Then only the city can shoot at it, not the ranged unit in his city, this makes the bombardment less extreme on one single unit. Move in and move out a lot. Just try to gain XP early, not cities or such.
Military tradition is a absolut must in this challenge! It is tre strongest policy in the whole game normally, and in this challenge it is even much better (needed I would say). Melee units start out weak. But later they have very very strong uppgrades, much better than ranged units ever get. So as the game move on you will not loose those much uppgraded melee units much. They will have 100 %+ defence vs ranged etc.