South Korea’s wealthiest investors sold a combined $1.2 billion of Samsung Electronics and SK Hynix shares in the third quarter. They cashed in gains and managed risk amid concerns about an artificial intelligence bubble.

Foreign investors also sold shares, net selling 20.3 trillion won ($15.1 billion) on the main Kospi market over the past month. SK Hynix and Samsung accounted for most of the outflow.

The selling has been attributed to profit-taking after semiconductor stocks performed strongly earlier in the year. Some analysts remain positive on SK Hynix’s long-term outlook, citing its role as a primary supplier of high-bandwidth memory (HBM) to AI-chip leader Nvidia. That role could make the company’s business less cyclical in the future.