In my opinion the best solution would be to remove the +4 attack and remove light_spear altogether and use anti-cav bonuses, . The problem is that light_spear gives a significant penalty against sword infantry and a significant bonus against cavalry, although the exact numbers are uncertain. So no matter what the attack and defense of a spear unit is statted to it will always have a huge difference in performance between fighting sword infantry and cavalry. If a light_spear unit is statted to fight equally with sword infantry it will absolutely destroy cavalry, and if it is statted to fight equally with cavalry it will lose miserably to sword infantry.

If anti-cav bonuses can be given in different amounts that is even better. The range of a spear is a certainly an advantage against cavalry but it isn't the only advantage. As Watchman has pointed out multiple times before, the most crucial point is that the infantry are trained and determined to stand and fight in close formation. So some trash skirmisher that just happens to use a very short spear as a melee weapon would get no bonus or only a small one. Dense spear infantry like hoplitai or triarii would get a moderate bonus. And eastern spear infantry like Sparabara that actually are specialized against cavalry would get a high bonus, which would make up in part for their abysmal stats.

The advantage of this system is that it allows spearmen to have their attack standardized with the sword infantry, which will prevent less experienced players from constantly jumping to the conclusion that spearmen are too strong against sword infantry, when in fact they are quite equal.