We consider the generalization problem for a perceptron with binary synapses, implementing the Stochastic BeliefPropagationInspired (SBPI) learning algorithm which we proposed earlier, and perform a meanfield calculation to obtain a differential equation which describes the behaviour of the device in the limit of a large number of synapses N. We show that the solving time of SBPI is of order $N\sqrt{\log N}$ , while the similar, wellknown clipped perceptron (CP) algorithm does not converge to a solution at all in the time frame we considered. The analysis gives some insight into the ongoing process and shows that, in this context, the SBPI algorithm is equivalent to a new, simpler algorithm, which only differs from the CP algorithm by the addition of a stochastic, unsupervised metaplastic reinforcement process, whose rate of application must be less than $\sqrt{2/(\pi N)}$ for the learning to be achieved effectively. The analytical results are confirmed by simulations.
