
Reversing MD5 Hash Function from 2500-Layer Neural Network in Jane Street CTF Puzzle
A Jane Street machine learning puzzle challenged participants to reverse-engineer a PyTorch model containing 2500 layers and recover an MD5 computation solely from its integer weights. The network output 0 for nearly all inputs, forcing solvers to use mechanistic interpretability instead of gradient-based search. Alex, a graduating student, identified that the final layers performed equality checks on 16-byte values using ReLU activations and crafted linear programming and SAT reductions to simplify the model from two million nodes to 75 thousand. Further analysis revealed the core computation consisted of 32 identical MD5 rounds, with an unintended bug in length encoding for inputs exceeding 32 bytes. The hidden target hash was deliberately chosen to be brute-forceable once the algorithm was identified, and the correct input turned out to be two common English words separated by a space. The exercise demonstrated both the feasibility and the extreme difficulty of extracting algorithmic behavior from large, non-differentiable neural networks.
HabrAug 17, 2026Translated from Russian