Note: this is NOT a duplicate of this question as that question asks whether the process will create better soldiers or not, while in my setting it is already accepted by the empire that it WILL create better soldiers. Also, the question is asking more about a modern setting.
In my (medieval, magic, pre-gunpowder) setting, families, especially poor families, in a certain Empire can give up their child to Imperial Military Orphanages in exchange for a lot of money and Imperial residences in specific cases. The families earn a lot of prestige if their child does well (in case they choose to reveal themselves; a lot of parents choose not to tell their children who they are, that way they gain the money and prestige of being child donors while not having to deal with a child who hates them since he was discarded.) Noblemen often give up secondary and later male children to disinherit them and avoid succession disputes. Children are also confiscated as punishment.
These children are taken very young; many are not even weaned and so the Empire employs many wet nurses for this purposes. Around 2 - 18 months old, the average being 8-9 month old children. (Younger children, but those that HAVE been weaned, pay more than older ones. 8-9 months is the most profitable.)
Obviously you can't start training 1 year old for military. Once registered at orphanages, these children are sent to foster families that have 6-7 children (all foster) each for mental development and teaching of basic language and arithmetic skills, until they reach a specific age at which they are sent for long periods of time to orphanages-cum-training centers, where they stay till they are around 16-18 and are trained to join the Empire's elite forces. They see their foster families only a few times a year, and, depending on what their biological parents chose, may never see them again.
But what is the best age at which they should be sent to military orphanages? How young or old should the Empire start training these children to create the best, most indoctrinated, yet still functioning human soldiers?
The only historical estimate I know of is 5 years of age, from the fact that 5-8 was the age children in ancient India were sent to Gurukuls, but that is still radically different as the only purpose of this program is to create war machines, and though they are taught arithmetic, language, reading and writing, history, religion and magical theory, there is a great focus on combat skills and training with only magic (and to some extent religion) being additional subjects with more than cursory focus to them.