NeuralState

A typestate analysis for statically detecting deep-learning API misuses before model training or execution.

First author IEEE TSE 2026 Journal-first at FSE 2026 Typestate analysis

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.

Problem

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.

Approach

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.

Results

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.

Why it matters

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).

References

2026

  1. Typestate-based Fault Localization of API Usage Violations in a Deep Learning Program
    Fraol Batole, Ruchira Manke, Robert Dyer, and 2 more authors
    IEEE Transactions on Software Engineering, Jan 2026
    Journal-First presentation at FSE’2026 (Published in IEEE Transactions on Software Engineering)