He was said to be poor and unable to make a living from selling bread, and so he served as a servant at the household of the general Gao Yuanli (高元禮) in Heng Prefecture (恆州, roughly modern Shijiazhuang, Hebei).
In 690, he was accused of inappropriate conduct, and the prefect of Heng Prefecture, Pei Zhen, was set to sentence him to caning.
A local official advised him to make a secret report to Wu Zetian, who was then empress dowager and regent over her son Emperor Ruizong, and he did so, accusing Pei and Emperor Ruizong's granduncle Li Yuanming (李元名) the Prince of Shu of plotting treason together.
(The xiezhi was a mythical one-horned animal that was intelligent, and whenever it saw two people fighting, it would use its horn to hit the wrong side.)
In 692 (by which time Wu Zetian had seized the throne from Emperor Ruizong and established her own Zhou dynasty), a number of officials—the chancellors Ren Zhigu, Di Renjie, and Pei Xingben, along with other officials Pei Xuanli (裴宣禮), Lu Xian (盧獻), Wei Yuanzhong, and Li Sizhen (李嗣真) -- were accused of treason.
Wei sarcastically stated, "I am so unlucky that it is like having fallen from a donkey with my feet stuck to the stirrup, and being dragged by the beast."