Meta is laying off several hundred employees as the company shifts resources toward artificial intelligence investments.