Science fiction is becoming reality before our eyes. And there's no area where changes are happening faster than in artificial intelligence (AI). OpenAI's ChatGPT has taken the world by storm. But it's just one of several recent major AI developments.

Investors are understandably looking to profit from what many people view as a massive AI boom that could go on for years. There could be some opportunities, though, that might be overlooked. One surprising stock could be one of AI's biggest winners.

AI's beneficiaries

Most lists of the top AI stocks will include obvious candidates. Microsoft has made a huge splash with its ChatGPT integration and major investment in OpenAI. Alphabet has long ranked among the leaders in AI. So have Amazon and IBM.

Nvidia is another key player in AI. The company's graphics processing units (GPUs) are ideal for handling the intense workloads associated with AI apps. 

All of these tech giants will likely enjoy strong growth as the adoption of AI soars. However, there's another angle that investors shouldn't ignore.

Goldman Sachs predicts that 300 billion jobs worldwide could be automated using generative AI by 2030. The Wall Street firm also estimates that two-thirds of U.S. jobs could be partially automated by AI. The resulting increased labor productivity could boost global gross domestic product (GDP) by 7%. 

Many companies could see their profits skyrocket as technology enables them to drastically reduce costs. This should especially apply to large employers with strong track records of technological innovation. Walmart (WMT 0.57%) fits this description to a T.

You can't spell retail without "AI"

Walmart ranks as the biggest nongovernment employer in the world. As of Jan. 31, the discount retailer employed 2.1 million workers. It's also well known for its early adoption of technology.

The company has used AI for years. Many of its regional distribution centers feature fully autonomous vehicles developed by Symbotic. (Walmart also owns a significant stake in Symbotic.) AI helps the retail giant predict consumer demand, manage its supply chain, help customers search for products on its web site and app, and allow customers to "try on" clothes online virtually.

Walmart projects that 65% of its stores will be serviced by automation in some way by the end of 2026. But that percentage and the extent of automation will almost certainly increase a lot over the longer term. 

It's not hard to envision AI transforming nearly every facet of Walmart's operations in the future. Self-driving trucks delivering products to distribution centers and then on to stores. Robots stocking shelves. AI systems allowing in-store customers to shop and automatically pay for items without checking out at all. Fully autonomous drones delivering products directly to customers' homes. AI handling customer service, accounting, and more.

Buy Walmart stock?

Walmart's profit margin is small -- only 1.9%. The adoption of AI could realistically boost that margin significantly. Even a modest reduction in costs would make a big difference in the company's bottom line.

Should you buy Walmart because of its AI opportunity? Yes and no. I do think that Walmart will be one of the biggest winners from using AI. The company already has a great head start. It's committed to leveraging technology to the hilt. 

However, I don't see AI as the primary reason to buy Walmart stock right now. There are other reasons to buy it, though. Persistently high inflation makes the company's discounted products more attractive than ever. Walmart is gaining market share with its grocery business. It's also rapidly becoming a leader in digital advertising.

Walmart isn't and won't be an AI stock like Microsoft, Alphabet, Amazon, IBM and Nvidia. But for investors seeking to profit from the AI boom, it provides a way to zig while others zag.