is a survival of the ancient East Asia
n word for "teacher".
Although the modern Chinese form xiansheng means something like "Mister", in earlier times the Chinese term had the same sense as Japanese sensei. It appears often in Classical Chinese texts and is translatable as "Master"; it referred to someone who was an acknowledged expert in some field of learning that involved apprenticeship and long-term self-cultivation by the student.
Xiansheng/sensei literally means "one born before", but I think that is not the real sense of the term. The second syllable sheng was a common suffix for scholars and students in ancient China, and the compound xiansheng actually means something like "elder scholar" or loosely "one who has been a student before me". This is a serious point; it is deeply bound up with the East Asian tradition of displaying humility when in doubt. The great Tang dynasty writer Han Yu asserted that the qualification for being a teacher was not greater age than the student, nor greater overall knowledge, but merely "prior" (xian) understanding of the subject of instruction:
Suppose someone is born before me;
their learning of the Tao
will, of course, be ahead of me,
and I will take them as my teacher, following them.
Suppose someone is born after me;
if their learning of the Tao
is also ahead of me,
then I will take them as my teacher, following them.
In my taking a teacher of the Tao,
why, what good is it to know whether they were born before or after me?
there is no high or low rank,
there is no elder or younger.
Where Tao is
there the teacher is.
In Taiwanese, as in many southern Chinese dialects, the equivalent term (Taiwanese sin-seN) means "doctor" (usually a doctor of traditional Chinese medicine) or geomancer. Both medicine and geomancy are fields traditionally taught only through apprenticeship. In these southern Chinese languages, the local equivalent of xiansheng is usually also a regular word for "teacher".
As in many other aspects of traditional culture that appear in both the Chinese and Japanese modern languages, Japanese (the recipient of borrowing) preserves the more ancient usage, and Chinese (the source of the borrowing) has developed newer usages. That situation is often observed in cultural borrowings.