This is why the people arguing that the loser should have to pay the winner's costs as a deterrent against frivolous lawsuits have it completely backwards.
Edit: The downside is that it would also prevent poor plaintiffs from suing richer ones. But that is already generally the case. It's probably best to judge on a case by case basis.
Alternatively, you could cap the amount the looser pays to what they themselves payed, devising some sort of scheme to prevent exploits around lawyer-on-retainer/permanently-hired-lawyer on a large-entity's side.