Barely 18 months ago, Meta Platforms (META 0.43%) was in crisis. Its stock price suffered a peak-to-trough decline of 76% between 2021 and 2022 (bottoming at around $90 a share). The social media giant also lost its prized $1 trillion-plus valuation. Investors were concerned about Meta's outsized spending on developing a metaverse while its flagship social networks -- Facebook, Instagram, and WhatsApp -- suffered declining advertising revenue.

In 2023, CEO Mark Zuckerberg launched an initiative to right the ship by having the company focus on a "year of efficiency." He slashed jobs, cut costs across the board, and turned the company's attention to further developing its artificial intelligence (AI) initiatives to improve the user experience on the company's core platforms.

The results were nothing short of spectacular. Not only did Meta's revenue and earnings soar throughout 2023, but its stock also logged the second-largest gain in the entire S&P 500 index for the year.

Meta officially reclaimed its $1 trillion-plus valuation last month, and its stock price just surged another 20% following the release of its financial report for the fourth quarter of 2023.

Facebook and Instagram are benefiting from AI

Cutting costs is one thing, but Meta also had to find a way to reverse its shrinking revenue from 2022. High inflation and rising interest rates forced businesses to cut back on their advertising spending, and although conditions have improved since then, AI is playing a role in Meta's recent financial success.

The company spent a large part of 2023 optimizing its existing AI models to improve engagement on Facebook and Instagram. AI learns what content users enjoy viewing and feeds them more of it in the hopes they will spend an increasing amount of time on the platforms. For example, AI is responsible for delivering more than 40% of all the content you see on Instagram, even if it isn't from accounts you follow. In other words, Meta now prioritizes entertainment value and relevance as opposed to personal connections.

The more time users spend on Facebook and Instagram, the more opportunities Meta has to feed them ads, which leads to more revenue. Plus, Meta has designed a suite of AI-powered tools for businesses, which helps them craft more engaging ad content to boost conversions. The more sales a business generates from Meta's audience, the more money it is likely to spend on ads.

Llama is rapidly advancing, with Nvidia's help

The other piece to Meta's AI strategy is Llama, the company's open-source large language model (LLM), which will be the foundation for a whole range of AI software applications. The open-source approach means Llama is heavily scrutinized by every developer using it to build AI applications, which provides Meta with a high volume of valuable feedback it wouldn't otherwise receive if it kept the LLM under wraps.

Speaking of which, Zuckerberg says Meta will acquire 350,000 of Nvidia's industry-leading H100 data center graphics processors (GPUs) by the end of this year, which will cost an estimated $9 billion. That will accelerate Llama's future development, helping Meta churn out reliable AI applications more quickly. Llama 2 is the most recent version, with Llama 3 currently in training.

The social media giant released a virtual assistant called Meta AI to American users via the Messenger app late last year, and it's capable of answering questions, making recommendations, and even generating images. A larger, more complex LLM will improve the breadth and proficiency of Meta AI's capabilities.

Then there is AI Studio, which allows businesses to develop their own AI chatbot unique to their brand. Zuckerberg's vision is to empower every business with a full-time assistant to handle customer queries around the clock, which will create new sales opportunities and reduce staffing costs.

Three friends taking a smiling selfie with a smartphone.

Image source: Getty Images.

Meta's financial growth surged in 2023

Meta's efforts to cut costs and improve the social media experience for users and advertisers are shining through in its financial results. The company delivered a record-high $40.1 billion in revenue in the fourth quarter of 2023, marking a year-over-year increase of 24.7%. That was the fastest pace of growth since late 2021.

Meta had 67,317 employees at the end of 2023, which was a 22% reduction from the same time in 2022. Combined with a decrease in marketing spending, Meta's Q4 operating costs were down by 7.9% year over year. Soaring revenue with falling costs equals one thing: surging profits.

As a result, Meta's fourth-quarter net income more than tripled year over year to $14 billion, which translated into $5.33 in earnings per share.

The Q4 results capped off a spectacular 2023, with full-year revenue coming in at $134.9 billion alongside $14.87 in earnings per share. Both were company records.

Why Meta stock will stay in the $1 trillion club this time

Meta's stock price is now up over 513% from its low point in November 2022, but because its financial results have improved so much, it's still reasonably priced. Based on the company's $14.87 in 2023 EPS and its current stock price of $462, it trades at a price-to-earnings (P/E) ratio of 31.1.

That's marginally cheaper than the Nasdaq-100 technology index, which sports a P/E ratio of 31.4. In other words, Meta is still trading at a small discount to its big-tech peers.

Meta stock looks even cheaper on a forward basis. Wall Street's consensus estimate is for the company to deliver $17.60 EPS in 2024, which places its stock at a forward P/E ratio of 26.2. One analyst thinks Meta could deliver as much as $23.27 in earnings per share, which would translate to a forward P/E of just 19.9.

If further share price gains aren't enough, investors will now get paid for holding Meta stock. The company declared a quarterly dividend for the first time, paying out $0.50 per share. Assuming that figure remains constant, Meta's annual dividend yield will be around 0.4%, which is quite modest. However, the company is also buying back its own stock hand over fist -- it had $30.9 billion remaining under its existing share repurchase program, but it just added another $50 billion.

Meta has transitioned into a mature company with enough resources and willpower to take a leadership position in AI, all the while returning billions of dollars to shareholders. Combined with its attractive valuation, I think Meta will remain in the $1 trillion club for the long term this time.