When synthesizing glyphosate under basic conditions it is best to do it in a non-aqueous medium (eg. triethylamine in methanol). In this medium glycine reacts with paraformaldehyde to form a dihydroxymethylglycine intermediate. This intermediate is not isolated and reacts, immediately, with dimethyl phosphite at reflux to form N-hydroxymethyl-glyphosate-phospho-dimethyl ester. This is then hydrolysed, under acidic conditions, to produce the glyphosate-phospho-dimethyl ester and after further hydrolysis glyphosate is formed.
This method produces glyphosate in high purity (97-99%) and at a reasonable yield (65-78%). The only drawback about this reaction is that copious amounts of dischloromethyl ether and methyl chloride are formed during this reaction; neither of which are at all pleasant.
The existence of the intermediates, such as N-hydroxymethyl-glyphosate-phospho-dimethyl ester, is yet to be proven experimentally, but has been often postulated. If the reaction is run at below 60 degrees centigrade and carefully monitoring the disappearance of phosphite, by 31P N.M.R., an interesting oxazophospholidine intermediate (see below) is seen to form cleanly, by 31P N.M.R. (17.7ppm), and can be isolated as it's triethylamine salt. This salt can then be hydrolysed under acidic conditions to form glyphosate. We can speculate that the carboxyl group in the dihydroxymethylglycine intermediate should be ionized thus retarding reaction at the carboxylate centre favouring cyclisation at the phosphorous centre.