RNN Architecture Learning with Sparse Regularization
Paper · 2019 · Jesse Dodge, Roy Schwartz, Hao Peng et al.
Summary
A recurrent network for reading reviews can devote many parameters to patterns that contribute little to its decisions. The difficulty is deciding what to remove. A small weight may be easy to discard, but it can be hard to tell whether deleting that weight eliminates any meaningful piece of the computation. Dodge and colleagues work with rational recurrent neural networks, in which each hidden unit can be understood as a weighted finite-state automaton. Each automaton follows paths through a sequence of words and assigns scores to possible matches. Its states give the authors identifiable parts of the network to keep or remove.
The authors use group lasso, a penalty that makes it costly to retain the weights belonging to a state. A group contains the parameters for moving into that state and for staying there while consuming another word. The authors begin with automata that can detect patterns of several lengths. They fit the network with the penalty, remove states whose parameter groups have become sufficiently small, and resume training with the penalty turned off. This procedure can shorten some automata and discard others entirely. The task data thus help determine both the number of hidden units and the lengths of the patterns they can represent.
The experiments cover binary sentiment classification on Amazon reviews. They use fixed GloVe word vectors across the review datasets and also test fixed contextual vectors from BERT on kitchen reviews. In four out of five experimental comparisons, the heavily regularized networks improve test accuracy by between 1–2% in absolute terms over unregularized networks built from unigram patterns. At weaker regularization strengths, the learned structures deliver similar or better accuracy than the best unregularized baselines in four out of five comparisons. These results concern accuracy relative to the number of automaton transitions, which tracks the number of trainable weights in the recurrent part.
The smaller networks also make it possible to inspect every hidden unit. The paper describes networks that retain as few as three automata after more than 90% of the weights have been pruned. In an example trained on the original mixture of reviews, phrases that score highly reveal recognizable expressions of sentiment, including variants of “not worth,” alongside a less coherent collection of sentiment-bearing words. The authors release their implementation. The contribution is a way to learn a compact recurrent structure from task data, together with a way to inspect what its surviving units respond to.
Deep dive: RNN Architecture Learning with Sparse Regularization
See how group lasso learns which states to keep in a recurrent text classifier and how much accuracy survives when the network shrinks. · about 34 minutes to read
The problem and its context
What counts as a removable part of a network?
The paper asks how to reduce the size of a neural text classifier while preserving its ability to make decisions on unseen inputs. A large network can be convenient to train because it gives the optimization procedure many parameters to work with. Once the network is in use, those parameters occupy memory, and the operations that use them can increase runtime. The introduction places these costs in a broader discussion about the resources required by neural approaches to language, including the potential environmental costs of greater computation. Energy and Policy Considerations for Deep Learning in NLP and Green AI
A parameter count tells an engineer how much trainable material a network contains. It leaves open a different question about what useful pieces the engineer could remove. Recurrent networks process a sequence by carrying a hidden state from one position to the next. In an LSTM or a gated recurrent unit, the authors observe, the organization of parameters does not immediately suggest a fine-grained set of parts to discard. Layers are recognizable units, but choosing whether to keep a layer gives relatively coarse control. A researcher who wants to shrink the computation within a layer needs a grouping that has a clear consequence when removed. The introduction cites the GRU through Learning Phrase Representations using RNN Encoder–Decoder for Statistical Machine Translation.
There was already a precedent in feature-based natural language processing. A system based on hand-specified features can associate a collection of weights with a common type of evidence. A structured sparsity penalty encourages entire collections to become unnecessary together. The paper points to earlier work that used this approach to reduce the size of structured predictors while preserving performance. Transferring the idea to neural networks requires first deciding what a collection means. If the members have little in common except that they occupy nearby positions in a weight array, discarding the collection may have no straightforward interpretation. Natural language processing
The recurrent architecture in this paper supplies that interpretation. A rational recurrent unit computes the score of a weighted finite-state automaton over the input it has processed. An automaton is a graph in which states record progress through a pattern and transitions specify how a word can advance or preserve that progress. The weights on transitions give the network a way to express varying degrees of fit. A group of trainable parameters can therefore correspond to the operations that let an automaton reach a particular stage of a pattern. Removing that group changes the pattern the unit can represent.
Where architecture choices enter
The authors build on earlier work that connected several recurrent architectures to rational recurrences and interpreted some of their units as soft patterns. A soft pattern behaves like a phrase template whose parts can accept different words with different scores. The earlier finite-state interpretation is important because the present paper inherits its structure. The authors can begin with a machine that has a known set of paths and ask which sections to keep. They can also inspect the surviving paths in terms of phrases in the input, using a visualization procedure developed in earlier work.
The number of automata and the lengths of their paths would ordinarily be choices made before training. Those choices govern different aspects of the architecture. A collection with more automata can supply more distinct features to the classifier. A collection with longer automata gives individual features the capacity to score patterns with more steps. Assigning the same length to all units is a simple starting point. Allowing different lengths introduces more possible combinations, and the training loss for a fixed architecture ordinarily offers no direct way to change that combination.
The paper places its approach alongside earlier work on learning automata and grammars, where questions about machine size and structure also arise. Its specific question is how to let supervised training for a classification task shape an existing family of automata. There is no requirement that each surviving unit recover a formally named linguistic category. Its job is to supply a feature useful to the review classifier. The finite-state design gives that feature a readable structure even though its transition parameters are estimated from examples.
Architecture search offers another way to choose the shape of a neural network. A search procedure can train different candidate architectures and select among them. The introduction notes that some neural architecture searches have used several GPU years. That comparison motivates a narrower question about whether the task can choose widths and pattern lengths during ordinary parameter estimation. The proposed procedure restricts the space of possible structures to those obtainable by removing parts of an initial rational recurrent network. Within that space, structure selection and weight estimation can share the same training run. Neural Architecture Search with Reinforcement Learning
Earlier compression work also gives the authors two points of comparison for the scale of a pruning decision. Some approaches inspect individual connections and choose which weights to eliminate. Others place penalties on larger structures in a network. Here the relevant decision is at the level of a state within a hidden unit. It is smaller than the decision to keep an entire layer, and its consequences can still be described in terms of a complete operation. Earlier studies of structured sparsity provide the precedent for applying a penalty jointly to weights. The finite-state organization determines where Dodge and colleagues apply it. Learning Structured Sparsity in Deep Neural Networks and Group sparse regularization for deep neural networks
Why review classification is a suitable test
The classification task gives the authors an outcome against which to judge the size reduction. A review is assigned one of two sentiment labels, so prediction quality can be measured by the share of held-out reviews classified correctly. The network represents each review by the scores of its automata. If some units or pattern stages can be removed while accuracy holds up, the experiment can show how a classifier behaves when it has fewer learned transition functions. It also gives the visual analysis a concrete question. A reader can examine a surviving automaton and ask whether the phrases it scores highly express evidence that might matter to a review's sentiment. Text classification and Sentiment & emotion
The paper's choice of a linear classifier matters here. The layer above the automata takes their scores as features and assigns a weight to each. This gives the recurrent part a clear role. It turns a sequence of words into a small set of numbers that the classifier can use. The authors can then vary the amount of trainable machinery used to produce those numbers and compare that choice across systems with the same general prediction design. The experiment is about selecting the recurrent structure within that design.
The method, step by step
How an automaton reads a phrase
Start with a single hidden unit. Its automaton has a start state and a chain of subsequent states. It reads a sequence of input vectors, each representing a word at a position in the review. A transition along the chain advances the machine to its next state. Each such transition has its own function for evaluating the current vector. In familiar phrase terms, an early transition might respond to a negation and a later transition might respond to a word whose meaning is altered by it. The exact preferences come from the learned weights. The illustration explains what the transitions can do as a sequence.
The paper starts from a 5-state automaton. Its first state is q₀ and its last is q₄. A path must consume at least four tokens to move from the start to the last state. This is the sense in which the full chain can capture a soft 4-gram. A conventional n-gram is a sequence of a specified length. In the automaton, weights determine how well words fit each position of the pattern, and a path can include intervening words because the graph also has self-loops.
An accepting or final state is a state at which a path is allowed to contribute to the output score. The authors make q₁, q₂, and q₃ final as well as q₄. Accordingly, a path does not need to use the whole chain to contribute, and the recurrent unit can combine patterns of different lengths. This design also makes a shortened chain usable. If pruning leaves only the earlier states accessible, an earlier state can still supply an accepting endpoint. During development, the authors found the arrangement with several final states more stable than using q₄ alone.
A self-loop consumes a word and returns to the same state. At the start, the self-loop has weight 1. This lets a path wait before beginning a match without reducing its weight for the preceding words. At the other states, the self-loop score comes from a sigmoid applied to a function of the input vector. Its range is between 0 and 1, so a path that uses a loop at one of these states is downweighted. Loops give the automaton a way to score a pattern whose important words are separated. They also let a completed pattern carry a path to the end of the sequence, with intervening words affecting how much weight the match retains.
This arrangement makes two aspects of a path worth keeping distinct. Advancing along the chain uses another learned stage of the pattern. Looping in place lengthens the span of text that the path consumes without adding a stage. When the paper talks about the length of an automaton, it is the length of the main path that matters. A short main path may still cover a phrase with a gap, and a long main path may contribute to an output through one of its earlier accepting states.
How the recurrence computes the scores
The network uses Forward dynamic programming. At each position it carries the accumulated score for each state. To update a state, it can reuse the previous score of that state for paths that take a self-loop. It can also use the previous score of its predecessor for paths that advance. The update multiplies each accumulated score by the corresponding transition weight on the current word and adds the contributions. That produces a total over possible paths without keeping a separate record of every way of matching the phrase. For a state after the start, the update implied by the graph has this form.
αⱼ(t) = αⱼ₋₁(t−1) uⱼ(xₜ) + αⱼ(t−1) sⱼ(xₜ)
The index j names a state after the start, and t names the current input position. The expression αⱼ(t) is the accumulated score at state j after processing through position t. The expression αⱼ₋₁(t−1) is the score at the preceding state before reading the current input, and αⱼ(t−1) is the previous score at state j itself. The vector xₜ represents the word at position t. The function uⱼ assigns a weight to the transition into state j from the previous state. The function sⱼ assigns a weight to the self-loop on state j. The products extend old paths by a transition, and the plus sign adds the scores for the two ways of arriving at the state at this position. The start state has its own loop of weight 1.
The update can be applied repeatedly as words enter the network. A path that starts matching early and a path that starts matching late can both contribute to an accepting state, provided each traverses the transitions it needs. Each path's weight is the product of its transition weights. The automaton's scoring procedure adds path contributions, with the final states allowing shorter as well as longer matches to enter the score. The paper describes this as the plus-times semiring. In practical terms, multiplication extends a path and addition combines paths. Both operations matter when interpreting a unit, because a large document score can arise from the accumulation of many paths.
The authors use the term rational RNN for a recurrent neural network whose hidden coordinates admit this kind of automaton interpretation. The state scores inside an automaton support the recurrence. The overall score computed by that automaton supplies a hidden coordinate. Those are two different levels of state. Removing an internal state typically shortens an automaton while leaving the corresponding hidden coordinate available. Removing an entire automaton eliminates a coordinate of the recurrent representation.
Where the penalty acts
The parameters of one group are those that belong to a single non-starting state in a single automaton. More precisely, the group contains the parameters that define the transition from the preceding state and those that define the self-loop on the state itself. Both operations contribute to reaching that state at the current position. The subsequent forward transition belongs to the group for its own destination. This convention partitions the relevant parameters into nonoverlapping groups. The fixed start loop and the word vectors are outside this partition.
The grouping is what connects a continuous training objective to a discrete architecture. Shrinking a few coordinates of a transition function leaves the rest of that function available. Shrinking the parameters for both ways of reaching a state makes the whole state a candidate for deletion. For the main chain in the paper, each non-starting state contributes such a group. Shorter paths and fewer hidden units can therefore emerge from the same operation at different points in the network.
The training objective combines binary classification log loss with a group lasso penalty. Log loss scores the probability assigned to the observed sentiment label, so it can guide training even when a change in probability leaves the predicted class unchanged. Group lasso adds the Euclidean norms of the selected parameter groups. Written in terms of the groups described by the paper, the objective is as follows.
J(θ) = Llog(θ) + λ ∑g∈G ‖θg‖₂
The symbol J denotes the objective minimized in the regularized fit. The symbol θ denotes the trainable parameters, and Llog is the classification log loss computed on the training data. The coefficient λ is the strength of the group penalty. The set G contains the state groups, and g indexes a group in G. The vector θg collects the parameters assigned to group g. The notation ‖θg‖₂ denotes its Euclidean norm, the square root of the sum of its squared components. The summation adds that norm across the groups. Parameters outside G can be trained through the classification loss if they are trainable in the experiment. The input embeddings are held fixed.
A larger penalty gives the network a stronger reason to let a group shrink unless it helps the classification objective. Within the log loss, a feature remains valuable to the extent that it helps predict the training labels in combination with the other features. The penalty also enters optimization before the architecture has been chosen. Training can change the relative contribution of several units while some of their states approach zero. There is no separate classification score assigned to each state to decide its fate.
The penalty treats the group as a single quantity for the purpose of measuring its size. A group with a substantial remaining parameter can still have a substantial norm even if the other parameters are small. A near-zero norm indicates that the parameters in that group are collectively small. This is what makes a norm threshold correspond to a decision about the operations defined by an entire group, instead of a list of decisions about individual weights.
How small groups become a smaller architecture
After the regularized fit has converged, the authors measure the norm of every state group. They remove a state when its group's norm is below a threshold. The rule operates on the learned parameters after the first fit. It gives the method a definite point at which near-zero weights become an absent part of the graph.
‖θg‖₂ < ε
The vector θg is the parameter group for the state under consideration. The norm ‖θg‖₂ is the same Euclidean norm used by the regularizer. The less-than sign gives the criterion for removal, and ε is the threshold. In the experiments, the authors use 0.1 for ε. They selected it in preliminary validation experiments, aiming to remove the groups that had converged near zero while retaining the others.
The distinction between shrinking and deleting is important for self-loops. A loop uses a sigmoid to produce a weight. The procedure removes the graph component when its group satisfies the norm rule. It does not interpret small input parameters to a sigmoid as a direct instruction to make a path disappear. Explicitly deleting the state also gives the next training phase a smaller set of parameters to estimate.
A chain introduces a dependency among deletion decisions. If a middle state disappears, the later states depend on a route that has been cut. The grouping rule does not impose an order on the norms along the chain. There is therefore no guarantee that a state closer to the end will be selected for pruning before an earlier state. In the experiments the authors found that pruning did proceed from the end. In that case the surviving states form an accessible prefix of the original chain, and the length of that prefix describes the resulting unit. When every group in an automaton is removed, there is no remaining pattern feature from that unit.
The authors tried optimization approaches intended to give exact zeros during training. They report that those approaches were unstable in their experiments, in spite of earlier work on such methods in non-convex settings. Their final procedure uses the observed separation between very small group norms and the rest, followed by the explicit thresholding step. With the smaller architecture in place, they continue training under the ordinary classification objective. This fine-tuning stage allows the remaining parameters to adjust to the reduced collection of paths without continued pressure from the group penalty. Fine-tuning
How the units produce a review prediction
A wider rational RNN runs d separately parameterized automata in parallel, where d is the starting number of hidden coordinates. They all read the same input sequence. Their state updates have no direct cross-coordinate transformation. The start architecture considered in the method therefore has 4d groups, with four groups for each automaton. The same per-state penalty and norm rule apply to every chain. The resulting chains can have different lengths, and the number of automata can fall below d.
The state computations are separate, but the end task connects their usefulness. The authors concatenate the automaton scores into a vector and give that vector to a linear binary classifier. Its log loss depends on the scores jointly. If separate automata provide evidence for the same reviews, the training objective can respond to their combined contribution. Structural separability means that changing the length of one chain does not require changing the recurrence of its neighbors. The downstream classifier still learns from the feature set as a whole.
The authors test one recurrent layer. They describe the method as applicable to multiple layers, but the procedure they evaluate uses automaton scores directly as the recurrent representation on which the classifier operates. It starts with a family of permitted structures: a collection of chains that can be shortened or removed. Within that family, the strength of the regularizer is the main control over compactness. The ingredients supplied by the researcher include the starting architecture, the task loss and the cutoff. The training data influence which chains and states survive at a given penalty strength.
Learning a smaller rational recurrent classifier
The steps in order.
For a given regularization strength, the authors describe this as two training runs. The first fits the larger network with the penalty and provides the evidence for choosing a structure. The next estimates parameters for that structure by continuing training without the penalty. The experiment repeats the procedure at different regularization strengths to trace out the accuracy and size tradeoff. The authors make the implementation publicly available.
Experiments and results
The review datasets and input representations
The authors use the Amazon binary sentiment dataset associated with earlier work on domain adaptation. It contains reviews across 22 product categories. The experiment uses a standard collection called original mix, which draws from multiple categories. It also examines kitchen, dvd, and books separately, following earlier text categorization work. The separate categories do not share reviews with one another, although their reviews can also appear in original mix. Their sizes differ substantially, and kitchen is the smallest of the datasets used in the experiments. Biographies, Bollywood, Boom-boxes and Blenders and Effective Use of Word Order for Text Categorization with Convolutional Neural Networks
These datasets let the procedure run under different amounts of supervision and on different collections of reviews. A learned pattern has the same formal structure in each case, but the evidence available for fitting its transitions changes. Results across the separate categories are comparisons across different review collections. The original mix provides a further setting in which the classifier encounters a mixture of product domains.
The input representation changes in a separate set of runs. The GloVe condition uses GloVe.6B.300d, with a vector associated with a word type. The BERT condition uses BERT large, whose contextual representation can vary with the occurrence of a word in a review. Both representations are frozen. As a consequence, nearly all learnable parameters belong to the automata. The comparison can therefore use the size of the recurrent structure as a guide to how many trainable parameters the classifier uses. The frozen vectors can still affect the kinds of patterns the automata learn. Word embeddings
The authors run the GloVe condition on original mix and on each of the separate categories. They restrict the BERT condition to kitchen because of memory constraints. This yields five combinations of dataset and input representation for the accuracy and size comparison. The kitchen runs provide results with both kinds of input. The wider comparison across review categories is available with GloVe.
What the baselines control
The comparison uses rational RNNs on both sides. The baselines use no group lasso and have their structures set before training. Each starts with the same number of automata as the corresponding network that will undergo pruning. The starting count is 24 with GloVe and 12 with BERT. The baseline comparisons consequently address length choices within the same architecture family and at the same initial width. The regularized network can change both properties when it prunes states.
The authors construct five baseline structures for each input representation. In four, all automata have the same main-path length. The settings use 1, 2, 3, and 4 main-path transitions per automaton, corresponding to 2–5 states when the start state is included. This gives a series of fixed-length alternatives, ranging from a collection of unigram units to a collection in which every unit has the full chain. A fixed-length baseline can still use self-loops and the permitted accepting states. Its graph is fixed even though optimization can give little weight to some paths.
The remaining baseline gives the classifier a mixture of lengths without asking the training loss to choose how many to retain. In the GloVe setting it uses 6 automata of each length, for 60 main-path transitions overall. With BERT it uses 3 of each length, for 30. The mixed baseline helps distinguish the flexibility of learning a particular collection from the simpler decision to supply several lengths. It lets the fixed architectures include heterogeneous units alongside the uniform alternatives.
Each transition has its own trainable parameters, so the transition count tracks the size of the trainable recurrent part. A fixed-length baseline has the count specified by its architecture. In the penalized condition the count is observed after pruning and can vary with the fitted weights. The comparison is therefore between a fixed structural budget and the size that emerges under a particular penalty, with test accuracy measured for each trained classifier.
Reading accuracy against network size
The main plot shows test classification accuracy against the total number of automaton transitions. A point higher on the plot represents more correctly classified reviews. A point farther to the left uses fewer transitions. Reading the axes together is essential. The question is whether a small learned arrangement can make better use of its transitions than a similarly compact fixed arrangement, and whether a learned arrangement can approach the best performance supplied by the larger baselines.
For the baseline curve, the authors vary the structures directly. For the learned curve, they vary the strength of the group lasso penalty. The plotted vertical bars represent one standard deviation in accuracy. Horizontal bars on the learned structures also show one standard deviation in the transition count. Those bars matter because choosing a penalty strength leaves exact size to training and pruning. With a fixed baseline graph the number of transitions is already determined.
The unregularized baselines tend to become more accurate as the authors give them more transitions. This provides a useful check on the comparison. More structure can help the classifier, and selecting a smaller architecture involves deciding where its limited capacity is best spent. At strong regularization, the learned structures substantially outperform the unigram baselines in four out of five comparisons, with gains in test classification accuracy between 1–2% in absolute terms. This is the part of the experiment where the difference between selecting structure and fixing it is most pronounced. The unigram baseline allocates a short pattern to each unit. A learned network can allocate its capacity unevenly, keeping a longer path where it remains useful and eliminating some units altogether.
At reduced penalty strengths, the gains over the baselines are smaller. In four out of five comparisons, the less strongly regularized networks achieve test accuracy similar to or better than the best unregularized baseline. The authors describe the learned structures as offering a better tradeoff overall. The two comparisons address different questions. One asks whether the strongest pruning settings are competitive with the simplest baseline. The other asks whether learned structures can come close to the strongest baseline when the penalty leaves more capacity available.
The paper also describes an individual original-mix classifier whose entire recurrent layer can be inspected. It contains three automata with 8 main-path transitions altogether. Its test classification accuracy is 88%, which the authors report as 0.6% absolute below the average of the five networks associated with its comparison in the main figure. The example is a particular fitted network chosen for inspection. Its accuracy and transition count establish the scale of the example directly. The broader results are the comparisons across penalty strengths and fixed structures.
Main-path transitions in original-mix sentiment classifiers with GloVe
The learned structure selected for inspection uses fewer transitions than any of the fixed baseline structures.
The numbers
| System or setting | main-path transitions |
|---|---|
| Fixed unigram baseline | 24 |
| Fixed bigram baseline | 48 |
| Fixed mixed-length baseline | 60 |
| Fixed trigram baseline | 72 |
| Fixed 4-gram baseline | 96 |
| Learned structure selected for inspection (this paper) | 8 |
The chart isolates the size measurement for the highlighted classifier and the GloVe baseline architectures. The “lower” direction applies to the count of main-path transitions. Accuracy is a separate outcome, and the paper uses its accuracy-versus-size curves to judge the tradeoff. This distinction is especially important when reading the very small example. A feature inventory can be small enough to display in full and still have a different accuracy from the average of the repeated runs.
The paper refers to a stronger result from prior work on this review task. That work reported 92.7% classification accuracy with a 2-layer rational network using between 100–300 hidden units. The classifiers in this study use a single layer and are capped at 24 hidden units. The authors mention the prior result to place their smaller classifiers in context and expressly caution against comparing the scores directly. The main baseline question is how best to allocate a constrained recurrent architecture, with frozen representations and a common classifier design.
What the ablations show
Varying the strength of the penalty
The paper's main controls are the penalty sweep and the family of unregularized architectures. It also offers a finding about accepting states and a qualitative inspection of surviving units. These comparisons answer questions about how the method behaves at different sizes, which allocations are competitive, and what the smaller networks appear to have learned. The paper does not present a factorial ablation that independently switches the penalty, pruning and continued training on and off.
The sweep shows that increasing the strength of the group penalty generally produces more compact classifiers after thresholding. This is evidence that the regularizer supplies an effective size control in this architecture. The initial width and maximum chain length are held at their starting values while the penalty changes. The structural differences come from which states meet the deletion criterion. A reader can thus attribute the movement along the learned curve to the procedure used to induce sparsity, rather than to a new collection of manually specified lengths at every point.
A given regularization strength can still lead to different retained sizes. The horizontal variability in the results reflects this. The procedure controls the cost of retaining groups and then applies a cutoff, so the resulting transition count depends on the values that the groups reach in training. In the baselines, a researcher selects the counts directly. The sweep shows that the penalty is useful for exploring the size range, while the two curves represent different ways of arriving at a given region of that range.
The changing accuracy gap is also informative. The strongly regularized settings are the ones for which improvements over the unigram baseline are most pronounced. At the larger settings, the fixed baselines already have room for more and longer patterns, and the advantage of choosing where to keep those patterns is generally smaller. This is consistent with the paper's interpretation that allocation matters most when the transition budget is tight. The comparison does not pinpoint which specific choices of width and length account for the difference in each dataset.
Testing fixed length and mixed length
The uniform baselines reveal the behavior of different preset lengths within the same general classifier. Because all units in each of these baselines have the same main-path length, increasing that length makes the structural change easy to identify. It also increases the number of trainable transition parameters. The resulting accuracy trend cannot separate the effects of adding more weights from those of enabling longer main paths. It establishes how a straightforward way of spending additional capacity performs.
The mixed-length baseline supplies a different control. It allows available capacity to cover multiple lengths while giving each length an equal allocation. That arrangement is heterogeneous before seeing the training data. The learned architecture can instead keep some lengths more frequently than others and shrink its total number of units. Including the mixed baseline makes the comparison more informative than a comparison with uniform systems alone. A favorable learned result is measured against a set of fixed choices that already includes one simple way of building in diversity.
The comparison leaves multiple explanations for performance open. A learned classifier can retain an advantageous mix of long and short chains. Its regularized training trajectory can also differ from that of a network that is small from the beginning. Continued training after pruning gives the survivors another opportunity to adapt. The experiment tests the combined procedure. It gives no separate estimate of how a network with the same final graph would perform if that graph were fixed beforehand and its parameters trained afresh.
Accepting states and reachable states
The paper reports that using q₁, q₂, and q₃ as accepting states alongside q₄ was more stable than relying on q₄ alone. This is a design comparison about where the automaton can accept a match. With the last state as the sole endpoint, a path must traverse the full chain before it can count as a match. Several endpoints let training use partial traversals as accepted patterns from the outset. The authors give a qualitative judgment about stability. They do not attach an accuracy gain or a variability estimate to this comparison.
The authors also check what happened when state groups were removed. In all their experiments, deleted states came from the end of the chain. That observation matters because the norm threshold is applied to individual groups and contains no explicit rule to enforce an intact prefix. If an earlier group vanished while a later group survived, the later state would be unreachable. On these runs the learned cuts had the expected structural effect of shortening the chain. This is an empirical observation about the trained networks, and the authors distinguish it from a guarantee about future fits.
These observations address different aspects of the graph. The accepting-state comparison concerns the paths that can contribute during training and after pruning. The reachability observation concerns the order in which the groups actually dropped out. Taken together, they explain why the surviving networks in the paper can be described by a count of automata and by a main-path length for each one. The final structure in these experiments is a collection of working shorter chains with endpoints that already had a scoring role in the larger network.
Inspecting what the surviving units score
The paper uses sparse networks to make the earlier visualization procedure feasible for a whole recurrent layer. For an automaton B, the authors search through phrases in the training corpus and find the paths with the highest and lowest scores for B. They then display the words those paths use at each main-path transition, along with indications of intervening self-loops and the end-of-document token. The result is a set of representative phrases that helps a reader infer what a unit responds to. Interpretability
The distinction between a document score and the examples in the display is consequential. In the classifier, the automaton combines the scores of paths through a document. In the display, the authors seek an extreme path, either a maximum or a minimum. An extreme case is a real path scored by the feature, so it can reveal a recognizable preference. It does not capture how the scores of all the other paths combine in a review. The highest-scoring path for a unit is therefore evidence about the unit's behavior under a particular input, instead of an accounting of the full recurrent score.
The original-mix example contains three automata. The authors show the 4 highest and lowest scoring phrases for each. One of the units has high-scoring examples organized around “not worth,” with different words completing the expression near the boundary of the review. Another favors phrases with words such as “miserable” and “returned.” These examples give a reader some reason to group the high-scoring paths by meaning, even though the feature was learned as a set of transition functions. The examples also show how a pattern can permit variation in what appears at a particular step.
The remaining unit has less consistent phrases. Its examples still contain sentiment-bearing words, including “bad,” “horrible,” and “best.” The authors suggest that training may have produced a feature responding to a collection of individual cues more than to a single coherent phrase. They describe it functionally as closer to a unigram pattern than a trigram. This is a useful check on the interpretation of graph size. A retained chain of a given length has the capacity to score a pattern of that length, but an inspection of its strongest paths can reveal a simpler effective behavior.
The lower-scoring examples have a role because the score from each automaton enters a weighted linear classifier. It is meaningful to examine which paths the automaton scores at the other extreme as well as which it scores highly. The sign of an automaton's response and the sign of its classifier weight concern different stages of the computation. A reader can use the examples to understand the response of the feature, then consider the classifier's weighting to understand what that response contributes to the decision.
The authors include a further visualization for a network using BERT embeddings, with four automata and 11 main-path transitions. This shows that the unit-level inspection can be applied when the inputs are contextual vectors. The words displayed still let the reader see which transitions an extreme path took through a review. In that setting, a transition's response to a word can depend on that word's context through the input vector. The resulting examples remain examples of scored paths, and they need not exhaust the contextual conditions that affect a transition.
Why some matches appear near the end
In the original-mix example, two of the three patterns favor expressions near the end of a review. The authors give two explanations that can operate together. The review data may concentrate decisive sentiment near the end, for instance when a writer closes with an overall assessment. The automaton also has a built-in preference that can favor later matches. Its start loop is free in the sense that it has weight 1. Waiting before a match therefore carries no discount at that state. The last loop has a sigmoid weight between 0 and 1. If a path matches the phrase early, it can be discounted as it consumes the rest of the review.
This mechanism makes the visual finding intelligible. For comparable sequences of match weights, a path with more trailing loops can get a smaller weight. The paper proposes fixing the last self-loop at 1 as well if a researcher wants to change this behavior. It does not report a run that changes the loop and measures the effect on phrase position or classification accuracy. The visualization identifies the positional tendency, and the graph explains how such a tendency could arise even if the training data also favor late evidence.
Limitations
Limits the authors identify
The starting point is a family of recurrent networks with a particular connection to weighted finite-state automata. The authors argue that the approach can be applied to multilayer rational RNNs, while the reported implementation and experiments use a single recurrent layer. The earlier, larger rational network mentioned in the paper is a contextual result. Its depth and hidden width differ from those of the classifiers here, and the authors say their results are not directly comparable. The strongest evidence is the experiment against rational baselines within the chosen size range.
There is a specific limitation to the pruning guarantee. The method assigns a norm to each state group and deletes according to that norm. A chain has a strict reachability order, but the deletion criterion has no matching order constraint. In the reported experiments the pruned states formed suffixes. The procedure itself allows a cut in the middle to render a later state inaccessible. This matters when transferring the approach to a different training setting, since the useful size of a surviving graph depends on which of its states can actually be reached.
The authors also describe two practical constraints on the experiment. Optimization methods designed to produce exact zeros proved unstable in their trials, so they used thresholding after convergence. The adopted threshold of 0.1 was tuned lightly on validation data. The paper's result is consequently about a specific procedure for separating very small groups from the remaining ones. Additionally, memory constraints limited the BERT experiment to kitchen reviews. The frozen contextual input condition has a narrower empirical basis than the GloVe condition.
The authors qualify their interpretability claims through the visualization procedure itself. The extreme path used for a display differs from the sum of paths used in prediction. Some units yield recognizable phrases, while others are harder to characterize. The authors explicitly entertain more than one explanation for the preference for end-of-review evidence. Their discussion shows why a visually clear pattern can suggest an account of the network's behavior, while group structure, word preferences and position in the review can all affect the result.
Limits visible in the experimental setup
Transition count is closely connected to trainable recurrent size here because the transitions are independently parameterized. A change in that count is direct evidence about how much learned machinery remains in the automata. It is a proxy for system resources. The experiments report classification accuracy and structural size, so the paper's desired outcomes of faster execution and lower memory use remain motivations for further measurement. Frozen embeddings still participate in the computation, and their costs are outside the transition count. The BERT memory constraint illustrates why the size of the recurrent classifier and the cost of its input representation are separate quantities.
The two training stages describe the cost of producing a particular sparse architecture at a particular regularization strength. Drawing the full tradeoff curve requires running the procedure at several strengths. The paper motivates this approach by explaining how it can reduce the need to try separate width and length settings in advance. It does not measure total search cost against a separately implemented neural architecture search procedure. The comparison with earlier reports of expensive searches describes why the authors seek a narrower method. It gives no empirical speed ratio for choosing architectures.
The starting graph also limits what the method can discover. Its operations remove state groups from chains that already exist. The available patterns come from that graph and its accepting states. There is no mechanism in the reported method for adding a branch, inserting a new state, or inventing a different kind of connection. This restricted space is central to the method's tractability and to the interpretation of the results. The paper demonstrates structure selection within this rational architecture, and extending the same idea to another architecture would require its own meaningful parameter groups.
The datasets vary within Amazon sentiment classification. That gives information about the procedure on several review collections and under different amounts of training data. The original mix overlaps with the separate categories, so the settings are not wholly independent tests on disjoint corpora. Accuracy measures aggregate success on the test reviews. The study does not establish how the pruned structures behave in a task requiring a substantially different kind of evidence, or how their errors are distributed among particular classes of reviews.
There is also a limit to what the baseline comparison can establish about causation. The regularized networks differ from their baselines in the way the architecture is chosen and in how the weights are trained. The accuracy comparisons support the full sequence of penalized fitting, pruning and continued training. They do not identify how much accuracy is attributable to each stage. The paper's comparison is most useful for deciding whether the combined procedure can yield a competitive classifier at a small size. A more granular causal account would require matched conditions for the individual stages.
Finally, the displayed phrases are drawn from the training corpus. They show what kinds of examples activate or depress the automata's scores among the paths available there. They do not by themselves establish that the same preferences will be as clear on other review collections. Nor does an extreme path directly show what would happen if a phrase were removed from a particular review. The sparse network gives the reader a tractable number of features to examine, and the visualization provides examples for those features. A complete explanation of an individual prediction would also have to account for the other paths and units contributing to its score.
What came after
The later citing work on matching predictor complexity to instance complexity takes up a related question about where capacity is needed. Dodge and colleagues choose a single compact recurrent structure for a classification setting. The later work's stated subject is matching the complexity of the predictor to the complexity of the particular instance. This shifts the unit of allocation from the trained classifier as a whole to the input it has to handle. The connection is the question of how much predictive machinery a task requires, with the later title framing that question at the level of individual inputs. The citation establishes the link between the works, while the title does not establish that the later system reuses the rational recurrence or its state-pruning procedure. The Right Tool for the Job
The later work on pruning neural machine translation takes up the more direct connection to group lasso. It applies the penalty in machine translation and frames the pruning objective around speed. In Dodge and colleagues' experiments, a group has a precise automaton meaning and compactness is evaluated by transition count alongside classification accuracy. The translation work's stated contribution places the same type of penalty in a different task and makes execution speed its explicit goal. Its title establishes the use of group lasso for pruning and the intended efficiency outcome. It does not specify the parameter groups, how speed was measured, or the outcome of that measurement. Pruning Neural Machine Translation for Speed Using Group Lasso
Cite
Cite as Jesse Dodge, Roy Schwartz, Hao Peng and Noah A. Smith. 2019. RNN Architecture Learning with Sparse Regularization. Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP).
@inproceedings{dodge2019rnn,
title = {{RNN Architecture Learning with Sparse Regularization}},
author = {Jesse Dodge, Roy Schwartz, Hao Peng and Noah A. Smith},
booktitle = {Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP)},
year = {2019},
doi = {10.18653/v1/d19-1110},
url = {https://doi.org/10.18653/v1/d19-1110}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/dodge-2019-rnn-architecture-learning-sparse-regularization/