In A Game of Thrones/A Song of Ice and Fire there are is an order of secular scholastics called Maesters whose purpose is to serve the government in the matters of their experience. They wear chains with metals to signify their experience.
Gold - money and accounting Silver - medicine and healing Iron - warcraft Black iron - ravenry Lead - poison Copper - history Bronze - astronomy Steel - construction Electrum - astrology Pale steel - smithing Valyrian steel - "the higher mysteries" (i.e. magic)
Was there anything like this in human societies before the advent of public universities?
Not particularly, no - or at least not in the West.
Before the universities got going in the twelfth century, learning was dominated by monasteries and wandering "masters". The latter had no formal certification - who would give it to them? - although they required episcopal permission to set up shop. They attracted students through their reputation, and often their students could attract other students, etc. forming what we might call a "school", the most famous of which is probably the one centered around Anselm of Laon (at Laon) around the year 1100.
The university itself is the product of several of these masters forming a corporate body. Indeed, that's what universitas means - a community or corporate body. At this point, academic ranks began to be formalized, as did a regular course of study, with all students starting as bachelors of the arts, and some progressing on to the lofty heights of master of theology. Various schools developed specialties; one went to Paris for theology and Bologna for law, for example. Note that at this point the title of doctor was not frequently given and there was no regularized way of attaining it.
As the university systems formalized, all sorts of sartorial methods developed for signifying one's academic rank, most unique to particular universities. Hoods, hood length, stripes on the sleeves, large sleeves, sleeve lengths, and the like are all vestiges of these methods you can still find when everyone puts on their wizard's robes for commencement today.