Artificial intelligence was said to be “driving good results” as Meta announced a profit of $5.7bn for the first quarter of this year.