In general, Warren Buffett has stayed away from tech companies in Berkshire Hathaway's investment portfolio. But one big tech trend has expanded well beyond tech companies: artificial intelligence (AI). AI is everywhere, and if a business isn't using it to improve productivity and reduce costs, it's going to fall behind.

In fact, some of Berkshire's biggest investments are looking to advance AI research, with clear business benefits if they can improve their algorithms and effectively implement new use cases for generative AI. As such, about 40% of Berkshire's $293 billion portfolio is invested in five companies pushing AI forward.

A close up on Warren Buffett.

Image source: The Motley Fool.

1. Apple (21.8% of portfolio value)

Apple (AAPL -0.05%) has been slow to develop generative AI capabilities. After showing off plans for its Apple Intelligence system over a year ago, the company made very slow progress. Meanwhile, other big tech names continue to push new models and capabilities to their platforms, leaving Apple in the dust.

Apple's biggest challenge is maintaining security and privacy for its users. As a result, it's focused on on-device AI. Practically every other AI system relies on remote servers with powerful GPUs loaded with tons of high-bandwidth memory. That makes them much more powerful, but far less private. As a result, Apple's handicapped itself by focusing on capabilities it can run on an iPhone or Mac.

There's still a lot of time for Apple to catch up though. Its ecosystem of products still has very high retention rates, and with an expanding services segment, more and more users are unlikely to give up their iPhone. In fact, that observation is what led Buffett to make his initial investment in Apple. Its strong brand and customer loyalty give it a massive competitive advantage.

Apple is reportedly exploring potential acquisitions that could expand its AI capabilities, including the potential purchase of Perplexity, an AI-powered search engine. With $133 billion in cash and marketable securities on its balance sheet, Apple can afford to make a big acquisition if it needs to.

Apple stock isn't exactly cheap right now, though. The stock currently trades for about 30 times forward earnings expectations. That high price may be why Buffett sold off about two-thirds of Berkshire's stake in the company last year.

2. Amazon (0.8%)

Amazon (AMZN 0.55%) was also slow to catch onto the AI trend relative to its peers in cloud computing. It worked quickly to catch up, though, developing Amazon Bedrock and acquiring a significant stake in Anthropic, ensuring access to leading edge models and a massive customer for Amazon Web Services.

Since mid-2023, Amazon's cloud computing segment, AWS, has reaccelerated its growth, driving strong demand for AI services on its platform. In fact, management says it remains supply constrained and committed to spending about $100 billion on capital expenditures this year, mostly going toward building new data centers.

Meanwhile, Amazon's integrated AI capabilities into its logistics network to ensure inventory is well positioned across its warehouses in the United States. That's enabled it to offer more items with one-day shipping for Prime members and reduce its shipping expenses per unit. As a result, Amazon's retail business has seen strong operating margin improvement over the last few years.

Amazon's decision to sink tons of cash into building new data centers to meet the insatiable demand for AI-related compute has weighed on its free cash flow. As a result, the stock looks expensive relative to its free cash flow over the trailing 12 months. But if and when Amazon takes its foot off the gas with capital spending, it should prove a good value at its current price with strong future free cash flows.

3. American Express (15.8%)

Even a company that's 175 years old can still prove an innovator in AI. American Express (AXP -0.64%) looked to incorporate AI across its business, and it's helping improve its operations.

American Express uses AI to help identify and prevent fraud for its customers. Its algorithms can analyze real-time data and help make a decision whether a transaction is suspicious and needs further confirmation or not.

Amex also uses AI to target offers for potential and existing customers. These help improve its marketing efforts, optimizing customer acquisition costs and retention rates.

Internally, Amex integrated AI into its IT support system, which dramatically reduced the number of tickets requiring human intervention. Its travel concierge team also uses generative AI tools to curate travel recommendations personalized for each customer based on their purchasing habits with Amex.

One of the fastest growing sources of revenue for Amex over the past few years has been the annual fees on its cards. Its ability to continue raising the fees on its products speaks to the strength of its brand and its ability to provide better customer experience and create more enticing offers for its customers.

With the stock trading at 20 times earnings, shares still look relatively attractive. The company is pushing its revenue growth higher led by higher annual fees without losing customers, and that's pushing its margins higher as well. As such, the company's expected to produce double-digit earnings-per-share growth.

4. & 5. Visa (1%) and Mastercard (0.8%)

Visa (V -0.54%) and Mastercard (MA -0.14%) are both using AI in similar ways to improve their payments networks. Like Amex, they've each developed their own machine learning algorithms to help prevent fraudulent transactions. But they're also developing tools for AI that could increase the number of transactions on their payments networks.

Visa and Mastercard are developing systems that will enable AI agents to use credit card credentials to make transactions on behalf of individuals or businesses. By working with AI systems to ensure security, both payments networks are positioning themselves to be at the center of advancements in agentic AI capabilities. For example, you could have AI restock office supplies and cater next week's lunch, and it will simply do it without any further input.

Both payments networks are well positioned, winning the vast majority of electronic payments partnerships with credit card issuing banks. As the two largest payments networks, they exhibit strong economies of scale and produce very high margins. And if AI can push more transactions onto their networks, it could see improved revenue and profits over the next few years.

The two stocks trade for much higher valuations than American Express, at 31 times earnings for Visa and 35 times earnings for the smaller, but faster-growing Mastercard. Those valuations may be a bit high for both companies, as they're expected to grow revenue at a high-single-digit to low-double-digit rate with modest operating margin expansion. While both companies have strong competitive moats thanks to their scale, it might be worth holding off for a better price.