Meta is also investing heavily to attract and retain top AI researchers and engineers as a talent war between tech firms intensifies.