[Paper Review] Input Switched Affine Networks: An RNN Architecture Designed for Interpretability
This paper introduces Input Switched Affine Networks (ISAN), a recurrent neural network architecture that uses input-dependent affine transformations without nonlinearities to enable full interpretability. The model achieves competitive performance on language modeling tasks while allowing exact linear analysis of input contributions, complete reverse-engineering of solutions, and significant computational efficiency through pre-computable affine compositions.
There exist many problem domains where the interpretability of neural network models is essential for deployment. Here we introduce a recurrent architecture composed of input-switched affine transformations - in other words an RNN without any explicit nonlinearities, but with input-dependent recurrent weights. This simple form allows the RNN to be analyzed via straightforward linear methods: we can exactly characterize the linear contribution of each input to the model predictions; we can use a change-of-basis to disentangle input, output, and computational hidden unit subspaces; we can fully reverse-engineer the architecture's solution to a simple task. Despite this ease of interpretation, the input switched affine network achieves reasonable performance on a text modeling tasks, and allows greater computational efficiency than networks with standard nonlinearities.
Motivation & Objective
- To design a recurrent neural network architecture with inherent interpretability for critical applications where model decisions must be understood.
- To enable exact linear analysis of how each input contributes to model outputs, avoiding reliance on post-hoc interpretation methods.
- To maintain reasonable performance on language modeling tasks while eliminating nonlinearities that obscure model dynamics.
- To achieve computational efficiency through pre-computable affine transformations of input sequences.
- To demonstrate that complex dynamical behaviors, such as counting nested parentheses, can be fully reverse-engineered in a linear system.
Proposed method
- The ISAN uses input-switched affine transformations: at each time step, the input selects a specific transition matrix and bias vector from a set of learned parameters.
- The hidden state evolves via a linear, time-varying update: $\mathbf{h}_t = \mathbf{W}_x \mathbf{h}_{t-1} + \mathbf{b}_x$, where $\mathbf{W}_x$ and $\mathbf{b}_x$ are selected based on the input $x$.
- The output is computed via a linear readout: $\mathbf{y}_t = \mathbf{W}_{\text{readout}} \mathbf{h}_t + \mathbf{b}_{\text{readout}}$, followed by a softmax for classification.
- The model enables exact decomposition of input contributions using change-of-basis transformations to disentangle input, output, and hidden state subspaces.
- The composition of affine transformations over sequences is itself affine, allowing pre-computation of transformations for entire input strings to accelerate inference.
- The architecture supports full reverse-engineering of solutions, as demonstrated on a multiple parentheses counting task where the dynamics are analytically reconstructed.
Experimental results
Research questions
- RQ1Can a recurrent network without explicit nonlinearities still achieve competitive performance on language modeling tasks?
- RQ2To what extent can input contributions to model outputs be exactly decomposed and analyzed using linear algebra?
- RQ3Can the internal dynamics of a recurrent model be fully reverse-engineered, especially for tasks requiring memory or counting?
- RQ4How does input-switched affine dynamics compare to standard RNNs in terms of computational efficiency and memory usage?
- RQ5Can pre-computation of affine transformations for input sequences lead to significant speedups in inference?
Key findings
- The ISAN achieves performance comparable to LSTMs on the Text8 dataset with the same number of maximum parameters, demonstrating strong modeling capacity despite its linearity.
- The model enables exact characterization of the linear contribution of each input to the final prediction, allowing full interpretability of input influence.
- Through change-of-basis transformations, the ISAN disentangles input, output, and hidden state subspaces, revealing clear structural roles for each component.
- On a multiple parentheses counting task, the ISAN's solution was completely reverse-engineered, showing that the network's internal dynamics can be analytically understood.
- The ISAN achieves a theoretical speedup of $O(K)$ in computation and $O(\sqrt{K})$ in memory usage compared to non-switched architectures, where $K$ is the number of input symbols.
- Pre-computing affine transformations for common input sequences allows inference cost per sequence to be reduced to roughly the cost of a single character update, enabling massive speedups for repeated or long sequences.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.