Meta is planning major layoffs affecting up to 20% of its workforce as the company invests heavily in generative AI infrastructure.