TL;DR
POPQORN is the first framework to provide certified robustness guarantees for Recurrent Neural Networks (RNNs), including complex architectures like LSTMs and GRUs. By linearizing complex gate interactions and propagating bounds backward through time, it calculates a "safety radius"—a guaranteed zone where no adversarial perturbation can flip the model's prediction.
The Challenge of Verifying RNNs
Deep neural networks are notoriously fragile; tiny, imperceptible changes to an input (adversarial attacks) can cause them to make confident, incorrect predictions. While researchers have developed ways to "certify" the robustness of feed-forward networks (like CNNs), doing the same for RNNs has remained an open challenge.
RNNs present two unique hurdles for verification:
- Feedback Loops: Hidden states at one time step depend on all previous steps, creating a complex, unrolled chain of dependencies.
- Cross-Nonlinearity: In LSTMs and GRUs, different "gates" (like the input and forget gates) are multiplied together. This interaction between two nonlinear functions is much harder to bound than the single-variable activations (like ReLU) found in standard networks.
Without a formal way to quantify this, we cannot truly know if an RNN used in a safety-critical application—such as speech recognition or medical time-series analysis—is actually secure.
Methods: The POPQORN Framework
The authors introduce POPQORN (Propagated-output Puantified Robustness for RNNs). The core idea is to "sandwich" the network's complex nonlinear functions between two linear functions, creating strict upper and lower bounds.
Key technical innovations include:
- Linear Bounding: Approximating activations like
tanhandsigmoidusing linear lines that stay strictly above or below the function within a specific range. - 2D Bounding Planes: To handle "cross-nonlinearity" (e.g., a gate multiplying a state), the authors move from 1D lines to 2D planes. This allows them to bound the product of two variables simultaneously.
- Recursive Propagation: Starting from the output layer, these linear bounds are propagated backward through the network's layers and time steps until they reach the input.
- Binary Search: Because the bounds depend on the size of the input perturbation ($\epsilon$), the algorithm uses a binary search to find the largest possible $\epsilon$ that still guarantees the model won't change its classification.
Key Insights and Applications
The authors evaluated POPQORN across three distinct types of data: standard MNIST, MNIST sequence data (pen-stroke coordinates), and UIUC CogComp QC (an NLP question classification dataset).
Robustness is not uniform across time: One of the most interesting findings is that RNNs are more sensitive to noise at certain time steps than others. In handwriting, for instance, the "middle" of a stroke might be more critical for recognition than the very beginning.
Identifying "Sensitive Words" in NLP: In NLP tasks, POPQORN can pinpoint "robustness bottlenecks." For example, in the question "What is the fourth highest mountain in the world?", the word "mountain" has a much smaller certified bound than "the." This means a tiny shift in the embedding of "mountain" is much more likely to confuse the model than a shift in less critical words.
The Cost of Complexity: The paper demonstrates a clear trade-off: as you add more layers or hidden neurons to an RNN, the certified robustness bounds generally decrease, making the model theoretically "easier" to attack.
Results and Limitations
POPQORN successfully provides the first certified lower bounds for LSTMs and GRUs. While previous methods like CLEVER provided estimates, they offered no mathematical guarantees. As expected, the certified bounds provided by POPQORN are smaller than the distortions found by actual attacks (like C&W), because POPQORN guarantees safety against any possible attack within that radius, not just a specific one.
While the implementation is optimized for GPUs using PyTorch, certifying LSTMs remains computationally heavier than vanilla RNNs. Furthermore, the linear approximations can be "loose," meaning the actual robustness of the model might be higher than the certified bound POPQORN provides. Future work will likely focus on tightening these bounds and extending the framework from "many-to-one" classification to "many-to-many" tasks like machine translation.
Summary updated