When the ritsuyo system was originally implemented, toraijin scholar monks, who came to Japan from other advanced nations, were exclusively appointed as hogi including the various masters and onmyoji, whereas, qualified persons among secular people (people who have not entered the priesthood or lay people) gained appointments as trainees such as students of astronomy, students of onmyo, and students of reki.
律令制定当初は、方技である各博士や陰陽師には、もっぱら先進各国から来日した渡来人の学僧が任命されていたが、修習生である天文生・陰陽生・暦生には俗人（出家していない人・在家）の人材が登用された。