Meta shares surged Thursday as a rosy revenue forecast showed that artificial intelligence was helping the social media giant boost engagement and ad sales.