After a year of big layoffs, job cuts at the tech industry’s largest companies trickled into the first month of 2024.

Google started the year with layoffs of several hundred employees and a promise of more cuts to come. Amazon followed by trimming hundreds of jobs in its Prime Video department. Meta quietly thinned out middle management. Microsoft also cut 1.900 jobs in its video game division.

The layoffs continued even as sales and profits jumped and share prices spiked. That disconnect, tech insiders and analysts say, is reflective of an industry facing two big challenges: coming to terms with frenetic work force expansion during the pandemic while also making an aggressive move into building artificial intelligence.

Now, instead of hiring thousands of people every quarter, the companies are spending billions to build A.I. technology that they believe could one day be worth trillions.

Mark Zuckerberg, the chief executive of Meta, said in a call with analysts last week that his company had to lay off employees and control costs “so we can invest in these long-term, ambitious visions around A.I.” He added that he had come to realize that “we operate better as a leaner company.”

From the end of 2019 to 2023, tech companies scrambled to keep up with an explosion of consumer demand, as people stuck at home splurged on new computers and spent much more time online. Apple, Amazon, Meta, Microsoft and Alphabet, Google’s parent company, added a total of more than 900,000 jobs.