How AI Got Here · Part 4 of 5
Same network, same data, different answer
In Part 3 I described the network I built for my dissertation at Pace. HMAX, a model of how the visual cortex processes what we see (Riesenhuber & Poggio, 1999), turned an image of a letter into a short list of features, and a small trained network then had to say which letter it was. On six straight-line letters it worked. On all 26 it mostly didn’t. Test accuracy averaged about 21%, because most training runs never learned anything (Nikelshpur, 2014).
Some runs did work. The same model, on the same data, could reach reasonable training and test scores, but only some of the time. The one thing that changed from run to run was the set of random weights it started from.
Why it happens
Training starts from random weights, and the algorithm adjusts them a little at a time to reduce the error. You can picture the error as a landscape with many valleys. Back-propagation works its way downhill from wherever it starts and settles into a valley near its starting point, a local optimum. That local optimum is not necessarily the global optimum, the best the network can do, and it is not necessarily anywhere close to it. Which one a run ends up in depends on where it started.
The usual fix was to train many times and keep the best run. That costs time, and it makes studies hard to compare. When one network beats another, you can’t always tell whether the method was better or the starting weights were luckier.
Borrowing from biology
I was interested in biologically inspired optimization algorithms as a natural complement to machine learning. If a problem, or part of one, is structurally similar to a problem biology has already solved, can we borrow biology’s solution? I didn’t go straight to particle swarms. I was looking into genetic algorithms and ant colony optimization. Then I read Swarm Intelligence, Kennedy and Eberhart’s book on particle swarms (Kennedy, Eberhart & Shi, 2001), and I fell for the elegance of PSO. Through all of it, Dr. Tappert’s guidance was impeccable.
James Kennedy and Russell Eberhart had introduced particle swarm optimization in 1995. They wrote that the method “was discovered through simulation of a simplified social model” and linked it to “bird flocking, fish schooling, and swarming theory” (Kennedy & Eberhart, 1995). Each particle is a candidate solution, in my case one full set of network weights. The particles move around, and each one is pulled toward the best spot it has found so far and the best spot its neighbors have found. In that first paper they already reported that a swarm “could train NN weights as effectively as the usual error backpropagation method.”
I gave the swarm a smaller role. It looked for a good set of starting weights, and then regular training took over, using the Levenberg–Marquardt method that Martin Hagan and Mohammad Menhaj had adapted for training neural networks (Hagan & Menhaj, 1994). Part of the appeal was practical: a swarm is light, quick and easy to implement, while back-propagation is resource-hungry and takes a relatively long time to train.
It helped. With the hand-built line detectors from Part 3 in front of the network, the swarm step brought the mean validation error on 26 letters down from 0.28 to 0.05. With HMAX in front, the six-letter network matched the 94% mean accuracy of a support vector machine, which I used as the baseline (Nikelshpur, 2014).
The setting that made the difference
My experiments focused on one PSO parameter, maximum velocity, which caps how far a particle can move in one step. I tried seven values, from 5% to 50%, on eleven network sizes from 1 to 50 hidden neurons, and ran each combination ten times, 770 trials in all.
Accuracy went up with network size and leveled off at around 30 hidden neurons. Consistency depended on the velocity limit. The lower the limit, the smaller the spread in test results from run to run (Spearman r = .37, p < .001), and the big, unstable runs only showed up when the limit was 20% or higher (Nikelshpur, 2014).
To make sure this wasn’t something about letters, I repeated the experiment on a completely different problem: spotting impostors by the way they type a password, using Kevin Killourhy and Roy Maxion’s data from 51 typists (Killourhy & Maxion, 2009). Over 765 trials, the velocity limit was again tied to the error (r = .74) and to how much the error varied between runs (r = .77) (Nikelshpur, 2014).
My conclusion in the dissertation was that with the limit at 15% or lower, every run came close to the best result the network could reach, so you no longer had to train it over and over.
Where the swarm fell short
On 26 letters, the best mean test accuracy in the main experiment was about 60%, while the support vector machine in the pilot reached 64%. In the password study, a lower training error didn’t lead to better impostor detection, and my error rate there, about .29, was worse than the .161 Killourhy and Maxion reported. I saw the swarm step as cheap, but I never measured its cost against simply retraining a few times from random weights. And the networks were small. The largest had about 2,400 weights (by comparison, the network that won the ImageNet competition in 2012 had about 60 million) (Krizhevsky, Sutskever & Hinton, 2012; Nikelshpur, 2014).
The work showed that, at the sizes I tested, a low velocity limit made the same network give nearly the same near-optimal answer from one run to the next, close to the best result I saw that network reach.
How the field solved it
Meanwhile, the field was finding cheaper answers to the same problem. In 2010, Xavier Glorot and Yoshua Bengio had asked why training deep networks from random starting weights so often went badly, and proposed a better way to set those weights (Glorot & Bengio, 2010). In early 2015, Sergey Ioffe and Christian Szegedy at Google introduced batch normalization, which made training far less sensitive to the starting point; in their words, it let researchers “be less careful about initialization” (Ioffe & Szegedy, 2015). Around the same time came the Adam optimizer and a starting-weight rule tuned for the deeper networks the field was moving to (Kingma & Ba, 2015; He et al., 2015). None of these searched for a good start the way a swarm does. They made the start matter less, and they worked on networks with millions of weights.
Why it still matters
Looking back, the question may matter more than the method. I measured how much the results varied from one run to the next, not only how good the best run was. A few years later, that kind of question moved closer to the center of the field. In 2018, a group of researchers showed how hard it was to reproduce results in deep reinforcement learning, partly because of variance built into the methods themselves, and proposed guidelines for more reproducible research (Henderson et al., 2018).
Today the same question is back, at a far larger scale. Ask one of today’s AI models the same question twice and you can get two different answers. Part of that is by design: these models pick each word with a measure of randomness. But even with that randomness turned off, the answers can still change. In 2025, Horace He and his colleagues at Thinking Machines Lab sent the same prompt to one large language model 1,000 times with the randomness turned off and got 80 different completions. The cause they found was not in the model itself but in how the servers group requests from many users at once (He & Thinking Machines Lab, 2025).
The causes are different from 2014, but the question for anyone putting AI to work is the one I asked then: if the same system can give different answers, which one do you trust, and how do you know?
Next week, in Part 5: how neural networks learned language and what made today’s AI possible.
References
Cheirdaris, S., Nikelshpur, D., Tappert, C., Cipully, A., Rodriguez, R., Yalamanchi, R., Damon, A., Pierce-Jones, S., & Zucker, R. (2011). A character recognition study using a biologically plausible neural network of the mammalian visual system. Proceedings of Student-Faculty Research Day, CSIS, Pace University, D2.1–D2.10.
Glorot, X., & Bengio, Y. (2010). Understanding the difficulty of training deep feedforward neural networks. Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics (AISTATS), PMLR 9. https://proceedings.mlr.press/v9/glorot10a.html
Hagan, M. T., & Menhaj, M. B. (1994). Training feedforward networks with the Marquardt algorithm. IEEE Transactions on Neural Networks, 5(6), 989–993. https://doi.org/10.1109/72.329697
He, H., & Thinking Machines Lab. (2025, September 10). Defeating nondeterminism in LLM inference. Thinking Machines Lab. https://thinkingmachines.ai/blog/defeating-nondeterminism-in-llm-inference/
He, K., Zhang, X., Ren, S., & Sun, J. (2015). Delving deep into rectifiers: Surpassing human-level performance on ImageNet classification. Proceedings of the IEEE International Conference on Computer Vision (ICCV). https://arxiv.org/abs/1502.01852
Henderson, P., Islam, R., Bachman, P., Pineau, J., Precup, D., & Meger, D. (2018). Deep reinforcement learning that matters. Proceedings of the AAAI Conference on Artificial Intelligence, 32. https://arxiv.org/abs/1709.06560
Ioffe, S., & Szegedy, C. (2015). Batch normalization: Accelerating deep network training by reducing internal covariate shift. Proceedings of the 32nd International Conference on Machine Learning (ICML), PMLR 37. https://arxiv.org/abs/1502.03167
Kennedy, J., & Eberhart, R. (1995). Particle swarm optimization. Proceedings of ICNN’95, International Conference on Neural Networks, 4, 1942–1948.
Kennedy, J., Eberhart, R. C., & Shi, Y. (2001). Swarm intelligence. Morgan Kaufmann.
Killourhy, K. S., & Maxion, R. A. (2009). Comparing anomaly-detection algorithms for keystroke dynamics. IEEE/IFIP International Conference on Dependable Systems & Networks (DSN 2009).
Kingma, D. P., & Ba, J. (2015). Adam: A method for stochastic optimization. International Conference on Learning Representations (ICLR). https://arxiv.org/abs/1412.6980
Krizhevsky, A., Sutskever, I., & Hinton, G. E. (2012). ImageNet classification with deep convolutional neural networks. Advances in Neural Information Processing Systems 25 (NIPS 2012).
Nikelshpur, D. O. (2014). Achieving consistent near-optimal pattern recognition accuracy using particle swarm optimization to pre-train artificial neural networks [Doctoral dissertation, Pace University]. ProQuest (3584999).
Riesenhuber, M., & Poggio, T. (1999). Hierarchical models of object recognition in cortex. Nature Neuroscience, 2(11), 1019–1025.
Thinking about putting AI to work?
We design and build AI and custom software for organizations of every size, grounded in how the technology actually works.
Book an introductory callRead the series from the start: Part 1: The machine that learned from its mistakes · Part 2: Four rows in a truth table · Part 3: The edge of a glass slide