Neural networks that claim to sort numbers by following insertion sort have mostly been faking it.
Researchers studying neural algorithmic reasoning looked at a baseline model trained on the CLRS30 benchmark, which teaches networks to mimic classic algorithms like insertion sort using both final answers and step-by-step hints. They found the hint objective was barely being optimized, with hint accuracy staying low even when the final sorted output came out correct. Worse, many of the model's intermediate representations could already be decoded into a fully sorted list before the reference algorithm would have finished running, a sign the network had learned a shortcut to the answer rather than the procedure. In response, the team built Discrete Neural Insertion Sort, a model that represents the list as a chain, separates value swaps from control-flow decisions, and snaps its internal state back to discrete values after every processing step.
Trained only on 16-item lists, the new model sorted 64-item and 128-item lists with perfect accuracy, real evidence of generalizing an algorithm rather than memorizing a benchmark shape. An ablation test found the architecture alone wasn't enough: without explicit supervision of the algorithm's global inner-loop state, the model failed even on lists the length it was trained on. That is a useful warning for anyone building so-called reasoning models: correct outputs and even intermediate hints can still hide a network that never learned the underlying process.
Sorting is a toy problem, but the diagnosis travels: benchmarks that grade only the destination, not the route, will keep rewarding models for finding clever detours instead of doing the work.