Structured Perceptron with Inexact Search
Paper · 2012 · Liang Huang, Suphan Fayong and Yang Guo
Summary
A system can give the wrong answer even when the scoring rule it learned would have preferred the right one. This happens when finding an answer requires making a sequence of decisions. A search procedure may discard a promising beginning to save work, then return the best answer it can construct from what remains. The structured perceptron ordinarily learns by raising the score of the reference answer and lowering the score of the returned answer. That correction has a clear purpose when the returned answer really does score at least as high as the reference. With approximate search, a wrong answer alone no longer tells the learner whether it has found such a case.
The paper shows that the structured perceptron can retain its convergence guarantee with inexact search. The learner needs to update on a violation, meaning that an incorrect candidate scores at least as high as the corresponding reference candidate. The comparison may concern an entire answer or two equally long beginnings of answers. Under a separation condition for the comparisons the learner is allowed to make, the authors recover the classical bound on the number of updates. They also show how the usual full-answer correction can repeat indefinitely under greedy search, even when a set of weights exists that ranks the correct complete answer above every alternative.
The framework explains why early update, an existing training heuristic, works. It compares candidates at the step where the search first discards the reference, while the ranking that caused its removal is still visible. A variant of LaSO also fits the framework by resuming search from the reference after a correction. The authors introduce alternatives that look further along the search. Among these, max-violation chooses the point where the leading incorrect candidate has the greatest score advantage over the reference. It can use evidence from later decisions while still requiring a valid comparison.
The experiments test part-of-speech tagging and incremental dependency parsing on the Penn Treebank. For tagging, early update with a beam of 4 gives the highest reported development and test accuracies, 97.22 and 97.35. The authors identify the test accuracy as the best reported on that benchmark at the time. Max-violation comes close with a smaller beam and a shorter training run. For parsing with a beam of 8, max-violation reaches a held-out score of 92.25 in 10 iterations and 4.6 hours, while early update reaches 92.24 in 38 iterations and 15.4 hours. The ordinary full update fares especially poorly on parsing, where invalid corrections remain frequent. The results pair a condition for trusting an update with evidence about when meeting that condition matters most.
Interesting ideas
- I1.
en/src/parse.rstraining loop: the parser uses beam 8 with early update. Add max-violation as an update option, and measure LAS on EWT test and the number of iterations to the held-out peak. Two identical runs before any claim; the choice is made on the two-fold check. - I2. Invalid-update counter: count the updates where the gold prefix has already fallen out of the beam, per epoch, in the
en parse-evaltraining log. The paper finds that invalid updates predict bad learning, and in parsing they stay near 50% at the standard update. - I3.
en/src/ptag.rs: test beam sizes 1, 2, 4 and 8 with early and max-violation updates. The paper's tagging result suggests that a small beam with the max-violation update matches a larger beam with early update, which would cut tagger training time.
How Mova uses it
math/src/steps.rs(Model::run) — the arithmetic word-problem solver builds expression trees with a beam-search perceptron trained with early update by default.- Max-violation is implemented as an option (
MATH_MAXVIOL=1): the gold action prefix is scored alongside the beam, and the update happens at the step where "best beam state minus gold prefix" is largest, instead of the first step where gold falls out of the beam.
Effectiveness in Mova
Measured on SVAMP (architecture notes, table of ideas from papers): max-violation lowered accuracy from 57,3% to 56,0%, so it stays off by default and early update remains the training regime.
Deep dive: Structured Perceptron with Inexact Search
Structured Perceptron with Inexact Search shows when beam search supports convergent training and how max-violation speeds it up. · about 39 minutes to read
The problem and its context
Scoring an answer and finding it
In structured prediction, the answer has parts whose choices affect one another. A tagger assigns a grammatical category to each word in a sentence, and the plausibility of a category can depend on nearby categories. A parser constructs a sentence analysis through successive decisions, and each decision changes the analyses that can follow. A training example supplies a reference for the whole output. To learn from that example, the system needs a way to decide which other outputs its current weights favor.
A linear scoring rule is straightforward to apply once a candidate is in hand. It describes the candidate and the input with a vector of features, then weights those features to produce a score. Finding the highest-scoring candidate is a separate computational problem. The number of possible answers can grow rapidly with the length of the input. An algorithm can sometimes get around this growth by combining equivalent partial answers, provided the scoring rule gives it a sound basis for doing so. When scores depend on a broader history, fewer histories can safely be treated as equivalent. The authors place incremental parsing, bottom-up parsing and machine translation among the settings that motivate approximate search. Their examples include Online Learning of Approximate Dependency Parsing Algorithms.
Beam search limits the work by keeping a shortlist of partial answers at each step. It extends the candidates on that list, scores the extensions and retains only a fixed number of the best. The size of this list is the beam width. With greedy search, there is room for only one candidate, so every decision commits the search to a single history. A wider list preserves more possibilities, but a discarded history still cannot return by ordinary continuation. A candidate that would have had a strong score after later choices can therefore disappear while only its beginning is available to score.
The paper places this difficulty in the context of several discriminative approaches to structured prediction, including conditional random fields, the structured perceptron and methods based on margins. These approaches had already been applied to problems such as sequence labeling and parsing. Their theoretical arguments typically relied on finding the best answer under the current scoring rule. Approximation was common because of the cost of that step. The question the authors ask is whether the learner can change its rule for making corrections so that approximate search can still support a convergence argument.
Why a wrong prediction can give the wrong training signal
The standard structured perceptron compares two feature vectors. One comes from the training answer and the other from the answer chosen by the search. The algorithm adds the reference vector and subtracts the chosen answer's vector. In effect, the weights move towards the features of the reference and away from those of its rival. When the search is exact and returns a wrong answer, the rival must have scored at least as high as the reference. This is true even if the wrong answer was selected only because the scores tied. Finding the best answer thus gives the learner evidence of a ranking problem whenever a correction is called for.
Approximate search changes the meaning of the same observation. A wrong answer may still outrank the reference, in which case the ordinary correction has the same justification. But a wrong answer can also win among the candidates the search happened to reach, while its complete score is lower than the reference's. Training has access to the reference and can score it directly even if the search never reached it. The score comparison then shows that the final prediction and the final ranking tell different stories. The prediction failed somewhere in the search, but the two complete outputs do not exhibit the ranking problem that the ordinary correction assumes.
That distinction is particularly important for a correction made repeatedly. A premature commitment can steer the search into a different part of the space on each pass through the data. Corrections on the resulting complete answers can keep moving the weights without fixing the ordering of the short prefixes that determined which branch the search took. The paper's greedy counterexample makes this possibility concrete using a tag sequence and a feature representation small enough to follow by hand.
What early update had already changed
Incremental Parsing with the Perceptron Algorithm had introduced early update for a beam-search parser. During training, the search can be checked against the known reference at every step. If the reference disappears, early update compares its current prefix with a competing prefix and moves on to the next example. As long as the reference has survived to the preceding step, the search has to consider its next extension. The cutoff therefore reveals something about how that extension was ranked right when it was lost.
The paper describes early update as more effective than ordinary perceptron corrections in earlier work and points to its use in subsequent incremental parsers, including A Tale of Two Parsers. It also describes a practical cost. A reference can be discarded near the beginning of a sentence, leaving the learner with a short training comparison and no use of the remaining decisions on that pass. The authors cite runs requiring 15–40 iterations with early update, compared with 5–10 for the ordinary perceptron in the work they discuss. Those ranges come from earlier reports and motivate the question of how much of an example a valid correction can use.
The authors also distinguish their approach from work on approximations that enlarge the candidate space. A relaxation can make room for additional candidates outside the original set. A beam, by pruning, usually does the reverse and explores only part of the original set. The paper recognizes a common idea across these settings: one can formulate training around a more demanding family of comparisons than the original full-output problem. Here that family arises by asking the scorer to distinguish reference prefixes from competing prefixes. The authors also discuss related work on structural support vector machines and identify a connection between their choice of violation and large-margin training. Their convergence result concerns perceptron corrections.
The method, step by step
Start with a comparison the learner can inspect
Imagine that the learner is processing a sentence whose correct tags are known. At each search step, it can score the reference up to that point and compare it with the strongest candidate still available. If an incorrect candidate ties or beats the reference, the learner has found a violation. It can change the weights using the features of just those two candidates. Their prefixes have the same length, so the comparison asks how well each candidate explains the same amount of progress through the input.
Different update rules answer different questions about these comparisons. Early update asks when the reference is first lost. Hybrid update asks whether the complete answers already give a valid correction and uses early update if they do not. Latest update seeks the longest prefix with a violation. Max-violation asks where the scores most strongly favor the competitor. The search procedure can be the same in all of these cases. What changes is when the learner looks at its trajectory and which pair of candidates it uses to move the weights.
Training with a violation-fixing perceptron
The steps in order.
Write down the score and the correction
The training data consist of inputs paired with their reference outputs.
D = {(x⁽ᵗ⁾, y⁽ᵗ⁾) : t = 1, …, n}
Here D is the dataset, t indexes a training example, and n is the number of examples. The input x⁽ᵗ⁾ is paired with its reference structure y⁽ᵗ⁾. The ellipsis covers the intervening example indices. For a single example, the paper writes x and y without the index.
score(x, s; w) = w · Φ(x, s)
In this expression, score is the real-valued score of candidate s for input x under weight vector w. The feature map Φ turns the input and candidate into a vector, and · is the dot product. Each weight multiplies the corresponding feature value, and the dot product adds those contributions. When the learner compares prefixes, s stands for a partial structure and Φ describes the features available for that structure.
EXACT(x, w) = argmaxₛ∈Y(x) w · Φ(x, s)
Here Y(x) is the set of legal complete structures for x. The operator argmax selects a maximizing candidate s from that set, and ∈ denotes membership. EXACT returns a best candidate under w, while Φ and · define its score as above. A tie can permit more than one best answer. What the proof needs from an exact search is that the candidate actually selected scores at least as high as every legal alternative, including the reference.
ΔΦ(x, y, z) = Φ(x, y) − Φ(x, z)
The symbol ΔΦ is the reference-minus-rival feature difference. In the full comparison, x is the input, y is its reference output and z is a competing output. The minus sign denotes vector subtraction. The same expression works when the last two arguments are equally long partial structures. Features shared with the same values cancel out. The correction acts through the features on which the candidates differ.
w ← w + ΔΦ(x, y, z)
The arrow means that the weights are replaced by the vector on the right. The current w receives the difference ΔΦ between the reference and rival feature vectors for x. In the standard algorithm, the learner finds z by exact search, applies the correction when z differs from y, and visits the training examples repeatedly. In a prefix update, it supplies the chosen pair of prefixes in place of the full outputs. The way feature differences enter the weights stays the same.
Specify which mistakes count
The paper uses a confusion set to define the comparisons the learner is allowed to make. In ordinary structured perceptron training, all wrong full answers for an example are admissible competitors.
For each pair (x, y) in D, Cˢ(D) contains exactly the triples (x, y, z) formed by taking any z in Y(x) other than y.
The superscript s in Cˢ denotes the standard confusion set built from dataset D. The pair (x, y) must be a training example, and z must be a legal full output in Y(x). The set difference ∖ {y} removes the reference from the competitors. This set describes possible comparisons even when the learner would never encounter many of them in a particular run.
S = ⟨D, Φ, C⟩
The paper calls S a training scenario. The angle brackets collect the dataset D, the feature map Φ and the confusion set C. Fixing the data alone leaves the scenario unspecified. Changing the features changes the available ways to separate the competitors, and changing the confusion set changes which separations the weights must achieve. The standard scenario uses Cˢ(D). Greedy and beam updates will give C other meanings.
w · ΔΦ(x, y, z) ≤ 0
For a triple already in C, this is the test for a violation under w. The dot product with ΔΦ is the reference score minus the rival score for input x. The sign ≤ includes a tie at 0. The arguments y and z in this test can stand for a reference prefix and a rival prefix when the scenario allows partial comparisons. A candidate need only tie or beat the reference in this comparison. Whether it also beats all other candidates is irrelevant to the sign.
u · ΔΦ(x, y, z) ≥ δ > 0
For separability, the inequality must hold for every triple (x, y, z) in C using the same vector u. The vector u has unit Euclidean length and represents an ideal separator, with the score difference against every rival bounded below by the positive margin δ. The symbol ≥ includes equality with that margin, and > requires the margin to be positive. The algorithm need not know u. Its existence gives the proof a fixed direction in which each admissible correction makes progress.
δ(S) = max‖u‖=1 min₍ₓ,ᵧ,𝓏₎∈C u · ΔΦ(x, y, z)
Here δ(S) is the largest margin available in scenario S. The expression ‖u‖ = 1 restricts the outer maximum to unit vectors. The inner minimum takes the score gap on the hardest comparison for a given u, considering each (x, y, z) in C. The outer maximum picks the direction with the strongest such worst-case gap. The definition helps explain why switching from complete outputs to prefixes can change the theory even when the training sentences and the feature map are fixed.
R(S) = max₍ₓ,ᵧ,𝓏₎∈C ‖ΔΦ(x, y, z)‖
The diameter R(S) is the largest Euclidean length of a reference-minus-rival feature difference in C. The norm ‖ · ‖ measures the length of that difference. The maximum runs over the possible comparison triples for the scenario S. The margin describes how favorably one unit vector can orient all of the corrections. The diameter limits the size of each move the perceptron is allowed to make.
Why any valid correction can support convergence
The proof follows the weight vector in two ways. The first tracks its progress along the separating direction. Beginning from zero, every update adds a feature difference that has a positive projection along u. After repeated updates, those gains accumulate. For the argument below, k counts completed updates and wₖ is the vector after those updates.
u · wₖ ≥ kδ(S)
The left side is the projection of wₖ along the unit separator u. The right side multiplies the completed update count k by the margin δ(S). Each correction is drawn from C, so the definition of the margin gives at least that much progress every time. Since u has unit length, the length of wₖ is at least as large as the projection. This part depends on admissibility and separability.
The second part considers the length of the weight vector when the learner adds a feature difference. For a particular comparison, write the difference as d.
‖w + d‖² = ‖w‖² + ‖d‖² + 2 w · d
Here w is the vector just before an update, d is its chosen feature difference and ‖ · ‖² is squared Euclidean length. The final term is twice the dot product of the current weights with the correction. If the triple is a violation, w · d is nonpositive. The increase in squared length is therefore at most the squared length of d, which is bounded by the squared diameter of the scenario. An invalid comparison can make that last term positive. The proof then loses its control on the rate of growth.
k²δ²(S) ≤ ‖wₖ‖² ≤ kR²(S)
The left inequality comes from the accumulated projection after k updates. The right inequality comes from adding the per-update limit on squared length, beginning with a zero vector. δ²(S) and R²(S) denote the squared margin and squared diameter of S. The two inequalities force the number of updates to remain finite for a positive margin and a finite diameter.
err(S) ≤ R²(S) / δ²(S)
Here err(S) counts updates in the training scenario. The slash divides the squared diameter by the squared margin. It is the same form of bound as in the classical proof. Different confusion sets can lead to different margins and diameters, so the shared expression does not give a common numerical update limit for every rule. The proof credits exact search with a specific role: it supplies the nonpositive dot product whenever its chosen answer is wrong. A different search and selection procedure can fill that role by returning a violation directly.
The generalized framework separates the rule that finds a violation from the rule that changes the weights. Its local version goes through examples in turn and asks for a violation for the current input. If one is found, it updates the weights on that comparison and proceeds to the next example. The global version can pick a violation anywhere in the dataset, including another one on the same input. In the general convergence theorem, these finders are supposed to return a violation when one exists in the relevant search for a comparison. This requirement matters for interpreting termination. Bounding the number of corrections is one thing. Concluding that there is no remaining violation in the declared confusion set requires a suitable way to establish its absence.
There is also a direct way to see what a valid move does to the comparison it selects.
(w + d) · d = w · d + ‖d‖²
The vector d is the reference-minus-rival difference and w + d is the updated weight vector. The score gap for that pair increases by the squared length ‖d‖². A single correction can leave a previously negative gap negative, and the same weight change can alter other score gaps. The convergence argument handles those interactions by following the entire update sequence through its separator and length bounds.
How greedy search can keep making the wrong correction
The paper's counterexample uses the sentence “fruit flies fly .” The reference assigns N N V ., where N marks a noun, V a verb and the period its own tag. The first and final positions have fixed choices. The middle words can each take either noun or verb tags. There are two feature counts, one for a noun followed by another noun and one for a verb followed by the period. Complete scoring can reward the reference for combining those patterns, but the reward for a verb before the period is unavailable when the greedy search decides on the verb itself.
Beginning at weights (0, 0), the greedy search first returns NNN . in the paper's trace. The reference-minus-rival feature difference is (−1, +1), and the dot product with the current weights is 0. The new weights are (−1, 1). Now the noun-to-noun feature carries a negative weight. The next greedy result is NVN .. Its correction has feature difference (+1, +1) and a current dot product of 0, giving weights (0, 2). Both corrections so far qualify because the complete comparisons tie.
On the next visits, the same types of greedy outputs recur, but the dot product in the table is 2 at each of the next two updates. The reference already ranks above the returned complete candidate. The updates still take place because the ordinary rule reacts to an incorrect output without checking the sign. The trace proceeds through (−1, 3) and (0, 4). It displays the alternating pattern that produces the infinite run. The feature for a verb before the period keeps gaining weight, even though its contribution arrives after the search has made the decision that would allow it to use that feature.
The paper gives (1, 2) as weights that separate the complete answer from its full competitors. The example therefore starts with a problem for which complete scoring can succeed. Its failure lies in using approximate predictions as if they were evidence about complete rankings. The proof of the standard bound has no way to absorb the repeated positive dot products, and the greedy search supplies no opportunity to recover a prefix it has already discarded. Looking at the first wrong action changes the comparison to one that the procedure actually made.
Find the first wrong action in greedy search
An incremental search constructs a structure by appending actions. For tagging, an action is the next tag. A greedy procedure scores all extensions of the single history it is following and keeps the best extension.
NEXT(x, z) = {z ∘ a : a ∈ Yᵢ(x)}, with i = |z| + 1
Here z is the current prefix, |z| is its length, and i is the next position. Yᵢ(x) is the set of actions for that position on input x, and a is an action from that set. The symbol ∘ appends a to z. NEXT returns the one-step extensions the search can compare.
BEST(x, z, w) = argmaxᵣ∈NEXT(x,z) w · Φ(x, r)
The function BEST chooses an extension r with the highest score among NEXT(x, z). The input is x, the history to extend is z, and w gives the current weights. The feature map Φ describes each extension, and argmax selects one with a maximal dot product. Starting from the empty history, greedy search replaces its current prefix with this choice at each position and returns the result at the end.
With early update, the learner stops as soon as this extension takes the wrong action. Up to that point, its history agrees with the reference. Both the chosen extension and the reference extension are therefore successors of the same prefix. Since the search compared them when it chose the wrong one, the wrong extension must have a score at least as high as the reference. The update uses this pair and ends the visit to the example. If every chosen action is correct, the procedure reaches the end without a correction.
Cᵍ(D) = {(x, y[1:i], z[1:i]) : (x, y, z) ∈ Cˢ(D), 1 ≤ i ≤ |y|, y[1:i−1] = z[1:i−1], yᵢ ≠ zᵢ}
The superscript g marks the greedy confusion set. The notation y[1:i] and z[1:i] denotes prefixes ending at position i, and |y| is the length of the reference sequence. The equality of the prefixes ending at i−1 requires agreement before the last action. The symbols yᵢ and zᵢ are the two actions at position i, and ≠ requires them to differ. With i at the first position, the histories before it are empty. The condition using Cˢ(D) starts from a reference and a wrong legal full structure whose prefixes can supply this comparison.
Greedy separability asks for one direction that prefers the reference extension to every admissible wrong extension of the reference history. This makes the assumption fit the place where greedy decisions are made. A separator of complete answers may get much of its advantage from features that only become available late. The conditions for greedy early update require a usable score gap at the earlier decision itself. The paper obtains a finite-update guarantee for this scenario by showing that every greedy early comparison belongs to Cᵍ(D) and satisfies the violation test.
Find the first lost reference in a beam
Beam search keeps a list of competing histories. At a step boundary, the search pools the extensions of the previous beam's candidates, ranks those extensions and retains the highest-scoring distinct entries up to the beam width. The paper permits distinctness to be defined using equivalence classes. For trigram tagging, sequences of the same length with the same final two tags can be grouped because the tag history that matters for extension is shared. In the incremental parser, the useful state can include selected information about the last trees on the stack. Which information is needed depends on the features used.
Bᵢ = argtopₖ {w · Φ(x, r) : r ∈ ⋃_{z∈Bᵢ₋₁} NEXT(x, z)}
Here Bᵢ is the beam at step i and Bᵢ₋₁ is the preceding beam. The union ⋃ pools the extensions r of every prefix z in the preceding beam. The operator argtopₖ returns the candidates associated with the highest scores, in descending order, with at most k distinct entries. It returns those candidates themselves. The dot product gives the score of each candidate for input x under w. The beam starts with the empty prefix, and the ordinary decoder returns the highest-ranked entry in the last beam.
When equivalent states are merged, the search still needs to determine whether the actual reference history survived. The paper describes either storing the full partial sequence or tracing the pointers that record how the retained representative was reached. In tagging, the presence of the reference's latest tags identifies a state, but earlier tags may differ along the route to it. Checking the continuation from the preceding reference state can distinguish a retained reference path from a different path represented by the same state. This matters because the update is based on the path the search retained.
Cᵇ(D) = {(x, y[1:i], z[1:i]) : (x, y, z) ∈ Cˢ(D), 1 ≤ i ≤ |y|, y[1:i] ≠ z[1:i]}
The superscript b marks the beam confusion set. It contains comparisons for training inputs x between the reference prefix y[1:i] and a different candidate prefix z[1:i]. The two prefixes end at the same position i, which can range through the full length |y|. Unlike in the greedy confusion set, the competitor can have departed from the reference at an earlier position. A beam can preserve just such a competitor alongside the reference until their scores determine which history continues.
The beam set includes greedy comparisons and full-output comparisons. Any greedy competitor that differs only in the last step is also a differing prefix. Any wrong full answer is a differing prefix taken at the final step. If a unit vector can separate all beam comparisons, it can therefore separate all of the comparisons in each of the other sets. The reverse conclusion does not follow from the containments. The beam condition asks a common weight vector to maintain margins across both complete and partial histories, including histories that may never become rivals in a particular run.
Early update checks the reference after each beam expansion. If the reference has just disappeared, the learner compares its prefix with the leader of the current beam. Since the reference was present on the previous step, its next prefix was eligible when the new beam was formed. Being pruned, or displaced by a representative with an equal or better score, establishes the comparison the procedure needs. The leader is at least as high-scoring as that reference prefix. If the reference remains in the beam through the end but another complete answer leads, the resulting full comparison is valid for the same reason. When the reference leads at the end, the learner can finish that visit without an update.
Choose a different point on the same search path
Early update guarantees a usable comparison at the point where a reference first leaves the beam, but that point is only one possibility. The search can continue with the surviving candidates while the learner scores the matching reference prefixes separately. Later comparisons may still be violations. They may also favor the reference, even though the search cannot follow its path anymore. The authors use that distinction to design rules that examine more of an example.
Hybrid update starts by asking whether the two complete structures justify the ordinary correction. If the final rival ties or beats the reference, the learner can use all of the decisions in those answers. If the returned answer is wrong and scores below the full reference, the learner falls back to the early comparison. This rule preserves the familiar full correction whenever the final scores support it. The difference from the ordinary rule is the validity check and the available fallback.
Max-violation compares the reference with the beam leader at each candidate depth. It chooses the admissible pair on which the reference-minus-rival score is smallest.
(x, y*, z*) = argmin₍ₓ,ᵧ′,𝓏′₎∈C, z′∈{Bᵢ[0] : i is a search step} w · ΔΦ(x, y′, z′)
The input x is fixed for the local search. The primed variables y′ and z′ are comparison prefixes, including complete structures at the final step. C requires them to form an admissible triple and to refer to the same depth under the beam definition. Bᵢ[0] is the leading candidate in the beam at step i, with 0 denoting its first list index. The operator argmin selects a triple attaining the smallest current score difference. The stars mark the selected reference and rival. For a valid update that difference must be nonpositive. The more negative it is, the more the weights favor the competing prefix.
The selected prefix can occur where early update would stop, further along the same search, or at the final step. The rule treats the score gap as evidence of how strongly the weights support a rival. Length enters indirectly because it determines which features are available at each comparison, while the selection itself uses the gap. Choosing the most severe observed violation also leaves the perceptron's weight correction unchanged. There is no separate factor in the update that scales the move by the size of the gap.
Latest update chooses the deepest point where an admissible rival still ties or beats the reference. Its objective is the length of the comparison.
(x, y*, z*) = argmax₍ₓ,ᵧ′,𝓏′₎∈C, z′∈{Bᵢ[0] : i is a search step}, w·ΔΦ(x,y′,z′)≤0 |z′|
Here the primed candidates, the set C, the beam leaders Bᵢ[0] and the starred selections have the same roles as for max-violation. The additional condition requires the current score gap under w to be nonpositive. The operator argmax selects a comparison with the largest rival length |z′|, which also gives the length of the reference prefix. The paper's displayed constraint for latest update uses the opposite sign from its definition of a violation. The rule described in words and required by the convergence argument is the one expressed here.
The distinction between latest and max-violation matters when the most seriously misranked prefix comes before the longest usable one. A late comparison lets the correction incorporate features of more decisions. A larger score gap indicates a stronger preference for the wrong candidate at the particular point where it is measured. Hybrid, latest and max-violation give priority to different features of the same search history. The bound applies through the fact that each selected comparison is a violation, leaving the empirical experiments to show which selection is more effective.
Resume a training example after a correction
The paper also relates the framework to a variant of LaSO, short for learning as search optimization. Like early update, it reacts to the loss of the reference. It then reinstates the reference at that depth and continues processing the same example with the new weights. In greedy search, this means restoring the correct action at the point of divergence. In beam search, it means replacing the beam at that step with the reference prefix.
Bᵢ ← [y[1:i]]
The arrow resets the beam Bᵢ to a list containing only the reference prefix y[1:i] through step i. The weights have already received the correction that triggered the reset. Subsequent successors are scored using the updated weights. If the reference later drops out again, the comparison at that new point is judged under the weights that actually produced the later ranking.
This continuation allows several updates during one visit to a training example. The paper accounts for them through the global version of the framework, which can choose successive violations on the same input. The proof only needs the admissible comparison and its score sign at the moment of each update. In the greedy version of LaSO, restoring the reference history makes training equivalent to applying an ordinary, unstructured perceptron at each action position given the history. The paper relates that observation to SEARN. The beam case retains the possibility of tracking several competing histories between resets.
Experiments and results
Tagging with and without exact search
The tagging experiments use the English Penn Treebank. Sections 00–18 supply the training examples, sections 19–21 form the held-out development set, and sections 22–24 are reserved for the test results. Accuracy measures how frequently the assigned tag agrees with the reference tag. Development accuracy is also used to select a beam setting for each update rule before reporting its test score.
The baseline follows Collins's perceptron tagger. It uses trigram tag context and spelling features from A Maximum Entropy Model for Part-of-Speech Tagging. The authors replace words seen once with the unknown-word symbol <unk>. The trigram representation permits exact search by dynamic programming. Histories with the same relevant tag context can be merged because older tag choices need not be examined again for the next decision. The authors also run approximate search on top of this dynamic program. Pruning limits how many of the resulting states remain under consideration.
The beam settings explored for tagging are 1, 2, 4, 7 and 10. A beam of 1 provides the greedy case, where an action can eliminate the correct path with no alternative history available for recovery. The exact baseline provides a check on the quality and cost of leaving pruning out of the search. The paper reports that this baseline does slightly better than the earlier Collins result with a beam of 20. Providing both options for the same task lets the authors ask what changes when they deliberately introduce approximation into a problem where an exact solution was available.
In the final tagging comparison, standard update selects exact search, with development accuracy of 97.17 and test accuracy of 97.28. Its reported training time is 162 m. Early update selects a beam of 4, reaches 97.22 on development and 97.35 on test, and takes 37 m. Max-violation selects a beam of 2, reaches 97.20 on development and 97.33 on test, and takes 26 m. The development lead and the shortest reported training time among these methods thus belong to different update rules.
Hybrid update selects a beam of 5 in the final results table, with development accuracy of 97.18, test accuracy of 97.19 and training time of 30 m. Latest update selects a beam of 7, with development accuracy of 97.17, test accuracy of 97.13 and training time of 45 m. The final table thus records a selected hybrid setting beyond the beam widths listed in the prose describing the sweep. The widths and results in the chart follow the final table.
Test accuracy on Penn Treebank part-of-speech tagging
Early update gives the highest test accuracy, and max-violation comes close with a narrower beam.
The numbers
| System or setting | accuracy % |
|---|---|
| Standard update, exact search | 97.28 |
| Early update, beam 4 (this paper) | 97.35 |
| Hybrid update, beam 5 | 97.19 |
| Latest update, beam 7 | 97.13 |
| Max-violation, beam 2 | 97.33 |
Early update's test accuracy exceeds the 97.33 reported for guided learning by Shen and colleagues, which the authors treat as the previous best published Penn Treebank tagging result. The comparison involves different feature contexts, since the guided system can use a context extending to 5-gram features. The paper also lists a Collins test result of 97.11. These comparisons place the scores relative to earlier taggers. The comparisons among update rules within the authors' implementation more directly address the effects of selecting a correction under beam search.
The authors describe valid updates as enabling roughly 5 times faster training than exact search while achieving better tagging accuracy. The relevant settings combine a different update rule with a narrower search. Their timings represent the practical cost of those combinations, including both the work required by a pass and the number of passes needed. For an assessment that holds beam width fixed, the convergence counts in the tagging experiments provide a separate comparison.
Incremental parsing with non-local features
In the parsing experiments, training draws on Penn Treebank sections 02–21, while development and testing draw on sections 22 and 23, respectively. Huang and Sagae’s parser, which combines beam search with dynamic programming, is implemented anew by the authors. It constructs a parse through incremental actions and uses non-local features, meaning that relevant scoring information can reach beyond a small local window. The setup makes exact search intractable in the authors' account. Beam search is part of how this parser operates, so the training rule must deal with the effects of pruning.
The baseline update is early update, matching the original parser's design. The experiments examine standard, hybrid, latest and max-violation updates with beams of 1, 2, 4 and 8. The marked contrast with tagging concerns how far the standard rule falls behind when it lacks exact inference. With a beam of 1 it reaches 60.04% on held-out data, and with a beam of 8 it reaches 78.99%. Allowing the search to preserve more alternatives helps the standard rule on this task, but its broader beam still leaves frequent occasions when the final prediction does not support a valid correction.
The development comparison has two distinct views. The training curves compare how soon max-violation reaches roughly the same performance as early update. At a beam of 8, early update reaches 92.24 after 38 iterations and 15.4 hours. Max-violation reaches 92.25 at 10 iterations and 4.6 hours. The final results table then gives max-violation a development score of 92.32 at 12 iterations and 5.5 h. The earlier point on the curve measures how quickly it gets to the vicinity of the early-update result. The final table measures what the training runs achieve at their reported endpoints.
Hybrid update reaches 92.26 on development at 11 iterations and 5.6 h. Latest update reaches 92.06 at 9 iterations and 4.5 h. In the final table, standard update has the held-out result of 78.99 at 1 iteration and 0.4 h. A short run ending at that score and a short run approaching the early-update baseline represent very different outcomes. The learning curves allow the training-time comparison to be made at a similar level of parsing performance.
Test parsing scores on Penn Treebank section 23
Max-violation has the highest test score, while standard update trails every rule that checks or ensures validity.
The numbers
| System or setting | parsing score % |
|---|---|
| Early update baseline | 92.09 |
| Standard update | 79.14 |
| Hybrid update | 91.95 |
| Latest update | 91.96 |
| Max-violation (this paper) | 92.18 |
The original Huang and Sagae result listed alongside these tests is 92.1. Max-violation reaches 92.18, the best test result in the paper's parser comparison. Hybrid update illustrates why the split matters when reading the final scores. Its development result of 92.26 is above early update's 92.24, while its test score of 91.95 is below early update's 92.09. The result that carries over most clearly for max-violation is the combination of early progress on development and a competitive final test score. The authors describe reaching comparable held-out performance as taking about 1/3 of the early-update training time.
What the ablations show
Compare update rules under the same search budget
The paper varies the update rule and beam width and examines the resulting training runs. In tagging, the matched comparisons are especially useful because the underlying tagger is the same, and the beam width can be held fixed. The convergence table reports held-out accuracy with the corresponding iteration count for standard, early and max-violation updates. These runs show where the choice of comparison helps even when no extra space is given to the beam.
At a beam of 1, standard update reaches held-out accuracy of 96.27 in 12 iterations. Early update reaches 96.97 in 13 iterations, while max-violation reaches 96.97 in 7 iterations. The comparison with standard update shows the cost of treating the complete greedy output as a sufficient training signal. Comparing early update with max-violation changes which valid comparison is used. Both get to the same recorded accuracy, but the latter does so after fewer passes. The authors report a 19% error reduction for max-violation relative to standard update in this setting.
Held-out Penn Treebank tagging accuracy with greedy search
Early update and max-violation tie on accuracy and both improve on standard update with the same search budget.
The numbers
| System or setting | accuracy % |
|---|---|
| Standard update | 96.27 |
| Early update | 96.97 |
| Max-violation (this paper) | 96.97 |
At a beam of 2, standard update and early update each take 6 iterations, with held-out accuracies of 97.07 and 97.15 respectively. Max-violation takes 3 iterations and reaches 97.20. At a beam of 7, standard update takes 4 iterations for 97.17, early update takes 7 for 97.19, and max-violation takes 4 for 97.20. With this wider beam, the standard and max-violation runs have the same iteration count, and the accuracy scores across the methods are closer. The choice of correction has its clearest effect when little of the search history can survive.
The chart of results across beam settings also shows why max-violation should be understood as a strong general performer in these experiments rather than a rule that must win under every setting. Beam width 4 is the reported exception to its usual lead in tagging. Early update takes the highest held-out and test accuracies overall there. The comparisons support the practical value of looking for a stronger violation, while the highest tagging accuracy on this benchmark still comes from the earlier rule.
Count corrections whose score gap has the wrong sign
The authors record how frequently standard update responds to a wrong answer even though its preferred complete ranking is already correct for the pair being compared. A positive reference-minus-rival score gap makes that correction invalid. This measurement is more specific than counting incorrect predictions. A prediction can be wrong because a rival genuinely scores higher, because the reference was lost and the returned rival scores lower, or through an interaction between pruning and the scoring rule. The invalid-update percentage isolates the second kind of outcome at the final comparison used for training.
In tagging, the fraction of standard updates that fail this check quickly drops to 0% in the reported analysis. In parsing, it settles at approximately 50%. The curve concerns the percentage of updates, so a drop to 0% can coexist with further valid updates on incorrectly ranked outputs. Likewise, the parsing curve describes a persistent share of corrections with a positive score gap. It does not measure the share of all examples on which search failed.
The respective results under standard update track this difference. The tagger can do reasonably well as the beam widens, whereas the parser with a beam of 8 still has many invalid corrections and remains far behind the valid alternatives. The diagnostic and the greedy counterexample illuminate the same mechanism at different scales. The counterexample proves that corrections with the wrong sign can sustain a failure indefinitely. The measured rates show that invalid corrections are common enough to matter in the parser implementation. The study presents the result as a correlation between search difficulty and invalid updates, supported by the way the correction works.
Follow training progress at a comparable score
The parsing learning curves compare early update and max-violation at a beam of 8. Early update can save work within a pass because some examples end as soon as the reference leaves the beam. The paper observes that those passes are faster for early update, especially near the beginning of training. Max-violation examines more of a search trajectory to locate its comparison. It makes up the extra work by needing fewer passes to reach a similar held-out score. The authors report little difference in per-iteration speed between the two rules for tagging.
Hybrid and latest provide useful controls on the explanation for max-violation's speed. Hybrid uses complete outputs wherever the scores allow and can also reach a strong parsing development score in considerably less time than early update. Latest explicitly tries to use the longest available valid prefix and has a short training run, though its held-out and test results are below max-violation's. This comparison gives no general advantage to choosing the last admissible update position. Within the parser runs, the score-gap criterion offers a stronger combination of speed and final quality than the length criterion.
The experiments establish this pattern through comparisons of whole update policies. They do not independently vary the length and score gap of the chosen prefix while keeping all other aspects of the correction fixed. As a consequence, the evidence supports the performance of selecting the largest available violation among the observed beam leaders. It gives a more limited account of how much of the improvement comes from the size of the gap, the features found at the selected depth, or the changes those decisions cause in subsequent training.
Limitations
Conditions stated by the authors
The convergence results require separability in the scenario used for training. For complete outputs, the assumption is that one direction gives the reference a positive margin over every full competitor. For beam training, the stated condition extends to every admissible comparison with a wrong prefix of the same length. The difference matters even when using the same corpus, features and decoder. Evidence that a full sequence is distinguishable says little about whether the features available halfway through it can distinguish all of the necessary alternatives.
The theorem is a bound on the number of valid updates, with the feature-space diameter and margin of that scenario determining its value. It gives no elapsed training time or pass count directly. Two methods covered by the same general argument may use very different parts of a search trajectory, do different amounts of work per example, and need different numbers of visits to expose useful comparisons. The faster runs with max-violation are experimental observations. A larger observed score gap does not enter the bound as a guarantee of a proportionally faster run.
The paper describes the tagging study as a proof of concept because exact search is feasible with the features it uses. It suggests that adding genuinely non-local features could strengthen the case for valid updates and beam search in tagging, since this would make exact inference harder. Its discussion of machine translation and protein folding similarly identifies settings where approximate structured search is relevant. The experiments establish scores and timings for tagging and dependency parsing on the Penn Treebank. They leave those other applications open.
The authors also leave the relationship to cutting-plane and subgradient approaches for future investigation. Selecting a badly violated comparison makes the association intelligible, since all of these discussions concern which constraints or examples to address during training. The analysis in this paper is for a perceptron with feature-difference updates. It supplies a proof for the class of updates it defines and an empirical comparison of specific selection rules.
What follows from the setup
A validity check tells the learner that a particular reference and rival are misordered or tied. A single approximate trajectory cannot in general certify that every comparison in the beam confusion set has been examined. For example, a beam can finish with the reference as its best answer while having excluded many other prefixes from consideration along the way. The finite-update argument needs every correction to have the right sign and belong to the scenario. A stronger assertion that there are no remaining violations depends on what the search for a violation can establish. The distinction is especially relevant when a tie is counted as a violation but the decoder happens to return the reference.
The paper's evaluation uses fixed splits of an annotated corpus and specific implementations. There is no empirical demonstration that the full beam confusion set for either real task is separable, or a numerical margin estimate tying the theoretical bound to the observed runs. Development and test accuracy describe behavior on the stated splits. Differences among the stronger methods are reported as observed scores without an estimate of uncertainty across runs. The very poor parser scores for standard update establish a clear problem in this setup. Smaller gaps between valid rules support a narrower claim about their reported ordering.
Timing also depends on which comparison is being made. In the final tagging results, each rule selects its beam width by development accuracy, and the exact baseline uses a different search budget from the approximate alternatives. These are meaningful practical configurations, but the timing difference includes the cost of search as well as the training effect of update selection. The parsing curve with a fixed beam gives a closer view of the latter. Even there, early update and max-violation spend different amounts of work per pass because of where they stop and what they compare.
The score comparisons assume that candidates and reference prefixes are available at matching stages and can be evaluated with the same feature map. The paper gives ways to track the reference under beam recombination, but a task with a different search organization would need its own admissible comparisons and its own way of finding them. The theoretical framework describes what would make those updates valid. It does not provide an efficient general procedure for finding a violation in every structured search space.
The counterexample proves possibility. It shows that an approximate decoder can repeatedly prompt the ordinary learner to move the weights even on data separable by complete scores. It leaves room for the ordinary rule to work well when its search rarely returns an inferior complete rival. The tagging experiments show that setting within the same study. The relevant quantity for the convergence argument is the sign of the correction being taken. Beam width and the difficulty of inference matter through the training comparisons they produce.
What came after
Beam search and incremental prediction
Sequence-to-Sequence Learning as Beam-Search Optimization cites the paper in a study that makes beam search part of the learning problem for sequence-to-sequence prediction. The connection is clearest at the level of the objective named in the title. Training must account for what a bounded search keeps or discards as it builds a sequence. The perceptron paper gives one precise instance of that concern by locating a training comparison along the search path and testing its score gap. The citation establishes the connection between the works, while the title alone leaves the exact choice of training correction open.
AMR Parsing with an Incremental Joint Model cites it from incremental semantic parsing. An incremental formulation makes partial structures part of the prediction problem. That is the feature of the setup to which the perceptron paper's distinction between full and partial comparisons speaks directly. Joint Incremental Disfluency Detection and Dependency Parsing brings a related incremental perspective to the combination of recognizing disfluencies and assigning dependency structure. Its title places both tasks in the same incremental process, where later choices can depend on earlier partial decisions.
These papers point to several kinds of structure that can be assembled incrementally. Sequence outputs, meaning representations and dependency structures require different definitions of a candidate and of the actions that extend it. The transferable question is how the learner gets a comparison that is meaningful at the point where the search commits to an alternative. The citations and research topics establish where that question reappears. They do not specify which of these systems used early, latest or max-violation updates.
Joint extraction and coreference
Joint Event Extraction via Structured Prediction cites the paper in an information extraction setting that combines event decisions and uses global features. The connection suggested by that scope is between feature context and search. When a scoring feature concerns a larger portion of an output, the most useful comparison may depend on which parts the search has already assembled. The earlier paper works through this issue with prefix features whose availability changes over the course of a search.
Incremental Joint Extraction of Entity Mentions and Relations brings the citation into a task with linked mention and relation decisions built incrementally. Modeling Joint Entity and Relation Extraction with Table Representation addresses joint entity and relation extraction through a table representation. These titles identify distinct ways of organizing related predictions. A succession of partial decisions gives a direct analogue for comparing search prefixes. A table representation raises the separate question of how the structured output is organized for scoring and search. The citation alone does not establish the same update rule across the two representations.
Learning Structured Perceptrons for Coreference Resolution explicitly retains structured perceptron learning and places it in coreference resolution with latent antecedents and non-local features. The title identifies both a hidden choice about antecedents and feature dependencies beyond a local decision. The perceptron paper analyzes what happens when the reference comparison is known during training. A citation from a task with latent choices raises the additional issue of how that reference comparison is defined. Easy-first Coreference Resolution cites it from a setting organized around resolving easier decisions first, bringing the order of decisions into view.
Joint Event Trigger Identification and Event Coreference explicitly uses a structured perceptron to combine identification of event triggers with decisions about which events refer to the same occurrence. Its connection to the earlier paper is the learning rule applied to a new combination of structured decisions. The title establishes the use of the perceptron. Identifying a particular variant of violation selection would require details beyond that description.
Other search procedures and output structures
Greed is Good if Randomized cites the paper while investigating new inference for dependency parsing through randomized greed. The perceptron paper uses deterministic greedy search to isolate the effect of premature commitments on a training comparison. Randomized greedy inference places emphasis on changing which alternatives the search can reach. Randomized Greedy Inference for Joint Segmentation, POS Tagging and Dependency Parsing carries that search approach into a joint output that includes segmentation, tags and dependencies. Both citations are pertinent to the distinction between optimizing a score and exploring the candidates on which the score is evaluated.
Density-Driven Cross-Lingual Transfer of Dependency Parsers cites the paper in work on transferring parsers across languages. Its title identifies transfer as the focus and leaves the treatment of approximate inference unspecified. Discriminative Syntax-Based Word Ordering for Text Generation cites it from text generation, where the structured output under study is a word order informed by syntax. These works extend the citation record beyond the original evaluation settings. Across those settings, the paper's result remains a criterion for interpreting a proposed correction: the learner needs a usable reference and rival, and their current scores must show a ranking problem.
Institutions
Fields, topics and concepts
Shelves 4The field of science this work belongs to (OpenAlex fields).Computer Science · 19,503 worksArtificial Intelligence · 18,805 worksArts and Humanities · 17,959 worksLanguage and Linguistics · 17,789 works
Cite
Cite as Liang Huang, Suphan Fayong and Yang Guo. 2012. Structured Perceptron with Inexact Search. Proceedings of the 2012 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies.
@inproceedings{huang2012structured,
title = {{Structured Perceptron with Inexact Search}},
author = {Liang Huang, Suphan Fayong and Yang Guo},
booktitle = {Proceedings of the 2012 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies},
year = {2012},
url = {https://aclanthology.org/N12-1015/}
}References
- Collins, Michael. 2002. Discriminative training methods for hidden markov models: Theory and experiments with perceptron algorithms. In Proceedings of EMNLP.
- Collins, Michael and Brian Roark. 2004. Incremental parsing with the perceptron algorithm. In Proceedings of ACL.
- Crammer, Koby and Yoram Singer. 2003. Ultraconservative online algorithms for multiclass problems. Journal of Machine Learning Research (JMLR), 3:951–991. OpenAlex ↗ · Scholar ↗
- Daumé, Hal, John Langford, and Daniel Marcu. 2009. Search-based structured prediction. OpenAlex ↗ · Scholar ↗
- Daumé, Hal and Daniel Marcu. 2005. Learning as search optimization: Approximate large margin methods for structured prediction. In Proceedings of ICML. OpenAlex ↗ · Scholar ↗
- Finley, Thomas and Thorsten Joachims. 2008. Training structural SVMs when exact inference is intractable. In Proceedings of ICML. OpenAlex ↗ · Scholar ↗
- Huang, Liang. 2008. Forest reranking: Discriminative parsing with non-local features. In Proceedings of the ACL: HLT, Columbus, OH, June. OpenAlex ↗ · Scholar ↗
- Huang, Liang and Kenji Sagae. 2010. Dynamic programming for linear-time incremental parsing. In Proceedings of ACL 2010. OpenAlex ↗ · Scholar ↗
- Joachims, T., T. Finley, and Chun-Nam Yu. 2009. Cutting-plane training of structural svms. Machine Learning, 77(1):27–59. OpenAlex ↗ · Scholar ↗
- Kulesza, Alex and Fernando Pereira. 2007. Structured learning with approximate inference. In NIPS. OpenAlex ↗ · Scholar ↗
- Lafferty, John, Andrew McCallum, and Fernando Pereira. 2001. Conditional random fields: Probabilistic models for segmenting and labeling sequence data. In Proceedings of ICML. OpenAlex ↗ · Scholar ↗
- Liang, Percy, Alexandre Bouchard-Côté, Dan Klein, and Ben Taskar. 2006. An end-to-end discriminative approach to machine translation. In Proceedings of COLING-ACL, Sydney, Australia, July. OpenAlex ↗ · Scholar ↗
- Marcus, Mitchell P., Beatrice Santorini, and Mary Ann Marcinkiewicz. 1993. Building a large annotated corpus of English: the Penn Treebank. Computational Linguistics, 19:313–330.
- McDonald, Ryan and Fernando Pereira. 2006. Online learning of approximate dependency parsing algorithms. In Proceedings of EACL.
- Ratliff, Nathan, J. Andrew Bagnell, and Martin Zinkevich. 2007. (online) subgradient methods for structured prediction. In Proceedings of AIStats. OpenAlex ↗ · Scholar ↗
- Ratnaparkhi, Adwait. 1996. A maximum entropy model for part-of-speech tagging. In Proceedings of EMNLP.
- Shen, Libin, Giorgio Satta, and Aravind Joshi. 2007. Guided learning for bidirectional sequence classification. In Proceedings of ACL. OpenAlex ↗ · Scholar ↗
- Taskar, Ben, Carlos Guestrin, and Daphne Koller. 2003. Max-margin markov networks. In Proceedings of NIPS. MIT Press. OpenAlex ↗ · Scholar ↗
- Tsochantaridis, I., T. Joachims, T. Hofmann, and Y. Altun. 2005. Large margin methods for structured and interdependent output variables. Journal of Machine Learning Research, 6:1453–1484. OpenAlex ↗ · Scholar ↗
- Xu, Yuehua, Alan Fern, and Sungwook Yoon. 2009. Learning linear ranking functions for beam search with application to planning. Journal of Machine Learning Research (JMLR), 10:1349–1388. OpenAlex ↗ · Scholar ↗
- Zhang, Yue and Stephen Clark. 2008. A tale of two parsers: investigating and combining graph-based and transition-based dependency parsing using beam-search. In Proceedings of EMNLP.
This page in Markdown https://md.research.elamur.ai/free/en/papers/huang-2012-structured-perceptron-inexact-search/