Shares of major tech companies have fallen in the US and Japan over fears about the valuations of firms linked to AI.