While the overall S&P 500 is up 19% year to date, a lot of those gains have come from just a handful of large tech stocks dubbed the "Magnificent Seven." These are Apple, Alphabet, Microsoft, Amazon, Meta Platforms, Tesla, and Nvidia.

All of these companies have the ability to benefit from artificial intelligence, especially Nvidia and the large cloud-infrastructure platforms Microsoft, Amazon, and Alphabet. And since the tech sector was starting from a low point entering the year, it's perhaps not surprising these seven stocks have flourished.

But there are plenty more stocks to buy beyond these seven that will also benefit handily from AI. With many still trading below their all-time highs, they're great targets for continued AI gains in 2024.

Micron Technology

Memory manufacturer Micron Technology (MU 2.92%) just preannounced its fiscal first-quarter revenue and earnings above prior guidance, showing that the memory industry is on the cusp of recovery. However, the stock received a somewhat muted reaction to the positive news, as Micron had already rallied off its lows this year.

Still, Micron is the only U.S.-based manufacturer of DRAM (dynamic random access memory). And it still sits well below its all-time highs, leaving room for upside in 2024.

Micron is a notoriously cyclical stock, as memory prices can swing wildly based on supply and demand. That usually means the bigger the boom, the bigger the eventual bust, and vice versa.

In 2022, the memory industry entered one of its worst busts ever, as PC and smartphone demand evaporated in the wake of the pandemic and amid higher interest rates. Moreover, China, a large consumer, entered a slump from which it hasn't recovered.

With such a big downturn, all major producers of DRAM and NAND (a type of flash memory) have greatly scaled back production capacity. That supply discipline is now running into improving demand, helped along by the high-growth AI sector applications that weren't present in prior cycles.

The result? Memory prices are improving faster than expected. For the quarter, Micron now predicts $4.7 billion in revenue, above the high end of its prior guidance of $4.2 billion to $4.6 billion. Micron now sees adjusted (non-GAAP) gross margin around 0%, which shows that it's still just in the first stages of recovery. But that's 4 percentage points better than its prior guidance.

Memory cycles tend to be intense on the way up and the way down, and this upcoming "up" cycle could be a big one. Virtually all memory suppliers have cut back on production by about 30%. But the thing is, most have repurposed their old equipment from other production lines to the latest leading-edge technology. Leading technology requires more manufacturing steps, so that same amount of equipment actually produces fewer wafers.

The gist of this is that even if demand snaps back, memory suppliers won't be able to just "turn on" supply, since those machines have already been repurposed. That could mean demand outstrips supply for 2024, leading to surging profitability.

Moreover, in early 2024, Micron is set to begin shipping HBM3E, its first high-bandwidth memory (HBM) product, with best-in-class specs for AI applications. That means that even among memory suppliers, Micron could outperform next year.

An icon depicting a human head with the letters AI.

Image source: Getty Images.

UiPath

Automation software firm UiPath (PATH 0.26%) rocketed more than 25% higher the day after its recent blowout earnings report, but like many SaaS (software-as-a-service) stocks, it still sits far below its 2021 levels.

Software stocks tend to trade at somewhat high valuations compared to those in other sectors. But UiPath is perhaps more reasonably priced than many, and also has a larger amount of cash in proportion to its market cap. Moreover, UiPAth is a great candidate to benefit from AI compared with other software companies.

UiPath's software platform identifies menial or repetitive tasks that its customers could automate, and then those customers use UiPath's software to do so. That's already an application involving big data and machine learning, and it should only improve with the advent of generative AI. And while not quite as seductive as some other types of AI applications, it's one that can make a big difference for any business's cost base.

In the third quarter, UiPath's revenue accelerated to 24% growth, 5 percentage points better than the 19% growth in the prior quarter, and management also gave strong forward guidance.

After a long slump in software growth following the pandemic, it appears businesses may be turning back to investing in their digital transformation again. And if long-term interest rates continue coming down as they have since mid-October, that could be another tailwind for high-multiple software stocks like UiPath in 2024.

ONTO Revenue (Quarterly) Chart

ONTO Revenue (Quarterly) data by YCharts

Onto Innovation

Not only will AI applications require more of Micron's memory, but new chip structures that tie HBM to graphics processing units (GPUs) and new "chiplet" architectures will require much more advanced packaging as well.

Onto Innovation (ONTO 4.08%) has arguably an ideal portfolio for the AI age. Not only does it sell process control equipment for leading-edge chipmaking, but it also sells process control equipment for advanced packaging. Process control equipment monitors chip surfaces, transistors, and connections for defects and imperfections, and process control has to be done after each step in the chipmaking process before moving onto the next one.

However, the new type of chipmaking consisting of "chiplets," currently in production at Advanced Micro Devices with its MI300 and Intel in its own upcoming processors, will be a hypergrowth market. Chiplets consist of the stitching together of smaller sub-chips optimized for specific functions into a larger "superchip," requiring many more packaging connections.

Onto is one of only a couple players in advanced packaging process control. And management believes the total number of chiplet packages will grow a stunning 80% per year through 2030. That will produce growth of about 18 times today's nascent chiplet market by that time.

So while Onto may look expensive at 44 times trailing earnings, like Micron, Onto is coming out of the broader industry slump. Last quarter, while revenue was down 19% year over year, it was up quarter over quarter; Onto's Dragonfly advanced packaging systems grew a whopping 50% quarter over quarter. Moreover, Onto also announced new large orders for those Dragonfly systems, which will hit its financial results in the final quarter of 2023 and through 2024, as AI packaging demand accelerates.

Like Micron, Onto is in an industry trough, but one whose trajectory is improving quarter over quarter. And AI tailwinds could propel its revenue and earnings well past their prior peaks.