Deep neural networks (DNNs) have proved to be remarkably successful in various domains, in particular for implementing complex functions and performing sophisticated tasks. However, their vulnerability to adversarial noise undermines their reliability for safety‐critical tasks. Despite attempts to improve the robustness using algorithmic approaches, an effective hardware implementation is still lacking. Here an artificial probabilistic neuron device is proposed based on arrays of coupled nanomagnets, referred to as artificial spin ices, which return a nonlinear function with built‐in stochasticity in response to an ultrafast laser‐induced excitation. By exploiting solid‐state ionic gating, the magnetic coupling is electrically modulated, as a result of the magnetic anisotropy‐mediated competition of the symmetric exchange interaction and Dzyaloshinskii‐Moriya interaction, and hence tune the stochastic property of the neuron device at run‐time. Stochastic DNNs are then constructed with an output layer comprising several of probabilistic neuron devices. Compared to conventional DNNs, the stochastic DNNs exhibit an order of magnitude greater resistance to adversarial noise, providing a significant improvement in robustness. This approach opens the way to more secure and reliable DNNs, enabling broader uses in real‐world applications.