 His father Yuan Yi (元怡) was a son of Tuoba Zhen (拓拔楨) the Prince of Nan'an, a brother of Emperor Wencheng and son of Tuoba Huang, Emperor Taiwu's crown prince.Tuoba Zhen's line was dishonored after Tuoba Zhen participated in a plot against Emperor Xiaowen's sinicization regime, but Yuan Yi's older brother Yuan Ying (元英) was eventually created the Prince of Zhongshan after he achieved much in the battlefield.Yuan Yi himself was said to be corrupt and violent when serving as the commanding general of the garrison at remote Shanshan (鄯善, in modern Turpan, Xinjiang), and who fled and hid after accusations of such corruption was made against him, dying while in flight sometime between 512 and 515.