NeuralState
A typestate analysis for statically detecting deep-learning API misuses before model training or execution.
NeuralState applies typestate analysis to deep-learning programs. It models valid API-state transitions for framework objects and statically reports programs that drive those objects into illegal states before a training run begins.
Deep-learning APIs often require calls to occur in a valid sequence, not merely with valid argument types. Violations can escape conventional type checking and appear only during expensive runtime execution.
NeuralState specifies valid state transitions for framework API objects and statically checks whether a program induces an invalid transition. The analysis reports both the offending call and the violated transition.
On NLBench, NeuralState achieved 100% precision and 74% recall. On ExternalBench, it achieved 100% precision and 67.5% recall, with relative recall gains of 19.4% and 107% over NeuraLint.
The result shows that typestate analysis can provide static guarantees for deep-learning code, a setting where many API errors otherwise remain latent until runtime.
Read the full journal paper (Batole et al., 2026).