Foreshocks may provide valuable information on the nucleation process of large earthquakes. The 2021 Ms 6.4 Yangbi, Yunnan, China, earthquake was preceded by abundant foreshocks in the ∼75 hours leading up to the mainshock. To understand the space-time evolution of the foreshock sequence and its relationship to the mainshock nucleation, we built a high-precision earthquake catalog using a machine-learning phase picker—EQTransformer and the template matching method. The source parameters of 17 large foreshocks and the mainshock were derived to analyze their interaction. Observed “back-and-forth” spatial patterns of seismicity and intermittent episodes of foreshocks without an accelerating pattern do not favor hypotheses of pre-slip in the nucleation region of the mainshock. The ruptured patches of most large foreshocks were adjacent to one another with little overlap, and the mainshock eventually initiated near the edge of the foreshocks' ruptured area where there had been a local increase in shear stress. These observations are consistent with a triggered cascade of stress transfer, where previous foreshocks load adjacent fault patches to rupture as additional foreshocks, and eventually the mainshock.