?
If I may quote Napoleon himself, according to Louis Antoine Fauvelet de Bourrienne's Memoirs of Napoleon Bonaparte (chapter 23), in which he uses the first-hand account of General Jean Rapp, who was present at the occasion:
Your officers may return to Austria, but the soldiers must be prisoners. Tell him he must decide quickly, for I have no time to lose. The longer he delays the worse will his situation become. [...] Let Mack clearly understand that he has no alternative but to surrender on my terms.
His words to Prince Maurice of Lichtenstein, who was sent to the French army headquarters as a negotiator for General Mack.
The next day the 17 generals of the garrison in Ulm, headed by General Mack, were allowed to leave after a short talk by Napoleon himself.
As for the common soldiers, we can take a look at Napoleon's own words again. Quoted from the 8th bulletin de la Grande Armée, a propaganda news bulletin he regularly published during his campaigns:
In fifteen days we have finished our campaign. What we proposed to do has been done. We have chased the Austrian troops from Bavaria, and resored our ally to the sovereignty of his dominions.
That army, which with so much presumption and imprudence marched upon our frontiers, is annihilated.
[...]
Of a hundred thousand men who composed that army, sixty thousand are prisoners; they will supply our conscripts in the labour of husbandry.
Two hundred pieces of cannon, ninety flags, and all their generals, are in our power. Not more than fifteen thousand have escaped.
The prisoners would most likely be divided into several groups due to their sheer size and sent to French garrison cities behind the front. Useful labour was always welcome and prisoners who had learned a craft had good chances of being employed to work for the French for a low wage but wage nevertheless. Officers often even were allowed to move relatively free in the city on their word as a gentleman.
I can't point to any specific things though, unfortunately, and I can't even say when they were released, although it seems likely that they begun with it soon after signing the peace treaty with Austria.