Elamur Research

Hierarchical Search for Parsing

Paper · 2009 · Adam Pauls and Dan Klein

Summary

A sentence can have many grammatical analyses, and a detailed grammar gives a parser many ways to build each one. In parsing, the cost of finding the best analysis under the grammar can become prohibitive even when the sentence itself is short enough to seem manageable. Adam Pauls and Dan Klein compare two ways to reduce that work. Both consult a simpler grammar before committing effort to the detailed one. A* uses the simpler grammar to estimate how cheaply a partial analysis could be completed, then gives promising items priority. Coarse-to-fine pruning uses the simpler grammar to discard items whose best possible analyses at that level score poorly relative to the best coarse analysis.

The paper shows how to make A* consult a whole hierarchy of grammars. Estimating completion costs can itself take substantial work, so the authors use an even simpler grammar to guide that computation. Their hierarchical A* parser shares a single queue across all grammar levels. As soon as it has the bound needed to pursue an item in a finer grammar, it can do so. The method still returns an optimal derivation under the target grammar. The authors also implement coarse-to-fine pruning in the same queue-based framework, making it possible to compare how much work the two strategies generate under similar operating conditions.

On the state-split grammars trained from the Penn Treebank, which distinguish increasingly fine versions of grammatical categories, the full coarse-to-fine hierarchy offered a large advantage when some search errors were tolerable. In the reported regime with fewer than 5% search errors, it was more than 10 times faster than hierarchical A*. When the tolerance dropped below 1%, hierarchical A* was faster. The lexicalized experiment, which used a grammar sensitive to word identities, reversed the broader pattern. Hierarchical A* was faster across the pruning thresholds examined because its estimates of completion cost were already very tight.

The comparison explains why more levels can help one strategy and hinder the other. An extremely coarse grammar can still identify candidates worth discarding. To preserve exact search, however, A* requires optimistic bounds. Simplifying the grammar can make so many candidates look cheap that the parser processes them before making much progress in the target grammar. The experiments measure search errors against the target grammar’s own optimum. They establish how reliably the algorithms recover that optimum and how much work they do along the way.

Deep dive: Hierarchical Search for Parsing

Hierarchical Search for Parsing compares exact A* search with coarse-to-fine pruning and explains when simpler grammars make either approach faster. · about 35 minutes to read

The problem and its context

The parser in this paper receives a sentence and a weighted grammar. Its job is to choose a complete derivation, a tree that explains how the grammar generates the words in the sentence. A rule contributes a cost whenever the derivation uses it. The parser seeks the tree with the lowest total cost. The paper calls this the Viterbi derivation. The word “best” throughout the search problem refers to this objective. An annotated reference tree might embody a different analysis, so an algorithm can solve the search problem exactly and still return a linguistically imperfect result.

The starting point is a probabilistic context-free grammar, or PCFG. Its rules say how a category can expand, and their probabilities determine the costs used in search. A context-free rule can be applied to its category wherever that category occurs. To make the scoring sensitive to distinctions that matter for parsing, the grammars discussed in the paper refine what categories the parser can distinguish. A state-split grammar divides categories into learned substates. A lexicalized grammar incorporates word identities into its representations. The extra distinctions give the grammar more ways to describe a sentence and increase the number of intermediate analyses the parser may need to handle.

A chart parser avoids repeatedly solving identical subproblems. An item in its chart identifies a category and a span of the sentence. Several derivations can produce the same category over the same span, so the parser can store their best known cost together with the information needed to reconstruct the derivation that achieved it. This reuse saves work, but the set of distinct items can still become large. The paper points to both the lexicalized grammars described by Collins and Charniak and the state-split grammars developed by Petrov and colleagues as cases in which an unpruned chart is impractical to build in memory. Three Generative, Lexicalised Models for Statistical Parsing

A coarse grammar gives the parser a smaller search problem for the same sentence. Where a refined grammar distinguishes several versions of a category, its approximation can group them. Solving the small problem yields information about where particular categories can fit and what it costs to complete them. Since multiple fine items can share a coarse description, a result computed at the coarse level can guide several choices at the fine level. The central question is what the fine search is entitled to infer from that result.

Two uses for a simpler grammar

Earlier coarse-to-fine parsers used coarse scores to rule out analyses. In the procedure the paper takes as its point of comparison, the parser evaluates a sentence at a coarse level and assesses how competitive each item is there. If an item occurs only in poor analyses of the sentence, refined items that map to it can be discarded. Charniak and colleagues had already used successive approximations this way. Petrov and Klein likewise parsed through a succession of grammars with increasing detail. A rejection at an early level can avoid work throughout the rest of the hierarchy. The decision is approximate because good analyses can change rank as the grammar’s distinctions change. Improved Inference for Unlexicalized Parsing

The line of work on A* used the smaller problem to order the search. A partial derivation has a known cost for the work done inside its span. A heuristic estimates the best cost of attaching it to the rest of the sentence. A* gives priority to items with the smallest sum. The estimate has to satisfy a consistency condition for the guarantee used here. Informally, the estimates have to agree with the costs of building items from one another so that the search cannot finalize an item before a cheaper derivation has had its chance to reach the queue. With that property, reaching the full-sentence root certifies that the returned derivation attains the target grammar’s optimum.

Earlier work by Klein and Manning applied A* to a lexicalized parsing problem with separate scoring components. The simplified problems gave the parser enough guidance to cut work in the full grammar while preserving the optimum. But producing the guidance required exhaustive parsing in a simpler space, which could itself dominate the computation. Even a good heuristic can thus leave a parser slow for a reason that is invisible if one counts only the work performed after the heuristic becomes available. Pauls and Klein ask whether the computation of the heuristic can benefit from the same sort of guidance.

The general hierarchical A* framework of Felzenszwalb and McAllester supplied a way to organize these searches together. Pauls and Klein specialize it to parsing and apply it to grammars with different forms of refinement. A coarse item’s completion cost can itself require a search, and a still coarser estimate can guide that search. This turns the hierarchy into more than a sequence of preprocessing passes. Its levels can interact as the parser discovers partial results.

Why the comparison uses a common queue

Coarse-to-fine pruning was usually implemented with a dynamic program such as CKY, which combines analyses of shorter spans to build analyses of longer spans. A* usually needs an agenda, a queue ordered by the current priorities of candidate items. A comparison between existing parsers would therefore combine the effects of the search strategy with the effects of different implementations and different schedules for processing items.

The authors put both strategies in an agenda-based parser. Coarse-to-fine pruning can operate there because the decision to discard an item depends on the coarse score. The order in which candidates were reached in a CKY traversal is incidental to that decision. The authors choose priorities that give the retained items the intended coarse-to-fine treatment. This establishes a common mechanical setting for asking how much work comes from each strategy’s use of the hierarchy. It also makes the cost of computing coarse information part of the same accounting as the cost of searching the most detailed grammar.

The method, step by step

What the parser builds inside a span

The paper’s notation distinguishes what happens inside a span from what happens around it. An inside item can represent a verb phrase covering a portion of the sentence. Its cheapest derivation could be built from several smaller phrases, whose own costs come from their internal rules. An outside item for the same verb phrase represents what it takes to put that phrase in a complete sentence tree. Its cost covers the rest of the structure, including the rules that connect the phrase to the root. The phrase’s internal construction is accounted for separately.

The authors illustrate this distinction with I(VP, 0, 3) and O(VP, 0, 3). The first concerns a verb phrase over the indicated span. The second concerns the structure that would allow a verb phrase with those boundaries to appear in a complete parse. The two items have the same category and span, which makes it possible to pair a way of building the phrase with a way of completing its context. They can still have very different costs, and those costs become available through different deductions.

The parser’s input consists of terminals, which are the sentence’s words. Its notation for their sequence is:

T₀, …, Tₙ₋₁

Here, T denotes a terminal, the subscript is its position, 0 is the initial position, and n is the sentence length. The ellipsis stands for the intervening terminals through position n−1. The parser uses boundaries to describe spans. A word at position i occupies the span from i to i+1, and the root spans the whole sentence.

For combinations of nonterminals, the paper describes a binary grammar in Chomsky normal form. A binary production has the following form:

r = A → B C

Here, r identifies the grammar rule. The arrow indicates an expansion from parent category A to child categories B and C, in that order. A rule has an associated weight, written wᵣ. The paper assumes non-negative weights, with negative log probabilities as an example, and minimizes the sum of these weights through the derivation.

An inside item has the form:

e = I(X, i, j)

Here, e names the item and I denotes the inside type. X is the category at the top of the structure, i is its starting boundary, and j is its ending boundary. The parser associates an inside score βₑ with the item. During search this is the cheapest cost found so far for deriving that category over the indicated span.

When two inside items meet at the same boundary, the parser can join them if the grammar has an applicable binary rule. The candidate cost is:

β_A = β_B + β_C + wᵣ

Here, β_A is the proposed inside cost of the parent A across the combined span from i to j. β_B is the inside cost of B from i to the shared boundary k, and β_C is that of C from k to j. wᵣ is the cost of the rule r that joins the children. If this candidate is cheaper than the current known cost for the parent item, the parser updates the score and records the children and rule as backpointers so that it can later recover the tree.

The agenda holds pending items. The chart holds the items that have been processed. The operation repeated by the parser is to remove the lowest-priority-value item from the agenda, enter it in the chart, and consider what new items it can build in combination with chart entries. Scoring determines whether a new derivation improves an item. The priority function determines where the item belongs in the queue. Keeping those jobs distinct is what allows the authors to use the same basic parser for different search strategies.

In the ordinary agenda parser, the initial items are the sentence’s terminals. The algorithm ends when it removes the inside item with the distinguished root category over the full sentence. A priority function based only on the current inside cost yields uniform-cost search. With the paper’s non-negative rule costs, that ordering gives the root its optimal inside cost when it is removed. The drawback is that a cheap fragment can take priority even if fitting that fragment into a complete sentence would be expensive.

How A* estimates the remaining work

Standard A* adds an estimate for the completion of an inside item. Its priority is:

p(e) = βₑ + h(e)

Here, p(e) is the queue priority of item e, βₑ is its current inside cost, and h(e) estimates the cheapest outside cost for an item with that category and span. Smaller values are processed earlier. Uniform-cost search is the special case in which the heuristic is always 0.

The outside cost describes the cheapest context compatible with the item. For the verb phrase in the paper’s example, it covers the derivations elsewhere in the sentence and the route from the verb phrase to the root. An informative bound can push a cheap but awkwardly placed fragment down the queue. It can also bring forward a more expensive fragment if the surrounding structure allows it to form a cheaper complete tree. The heuristic only affects when the parser considers the fragment. The cost of building it still comes from its own derivation.

With a consistent heuristic, an item’s inside cost is optimal when it is removed from the queue. In particular, the first removal of the root inside item gives the Viterbi cost. This guarantee concerns the item’s path cost, the cost of the part of the derivation already constructed. At an intermediate item, the priority can still underestimate the best complete cost because it includes the heuristic.

In standard A*, the source of the heuristic can be treated as a separate component. The paper describes prior work that precomputed much of this information offline and work that solved a simplified parsing problem for each sentence. Hierarchical A* instead makes the search for those simplified answers part of the parser. The coarse search supplies bounds only as its own agenda entries become ready. A still coarser level can in turn supply guidance for their computation.

How a grammar becomes a lower bound

The hierarchy runs from the most abstract grammar G₀ to the target grammar Gₘ. The subscript identifies a level, and m is the index of the target level. Each grammar has its own category inventory and a distinguished root. Terminals for the sentence also have counterparts at each level. The authors describe a projection between adjacent inventories as:

πₜ: Σₜ → Σₜ₋₁

Here, πₜ is the mapping from level t to the immediately coarser level t−1. Σₜ and Σₜ₋₁ are the symbol inventories at those levels, and the arrow gives the direction of the mapping. The function is defined on every fine symbol and is onto, meaning that every symbol at the coarser level has a fine counterpart. Applying the mapping to the symbols in a rule gives the corresponding coarse rule. Applying it to a chart item changes its category while retaining its span.

A projection becomes a relaxation when each projected rule costs at most as much as the rule it represents:

wᵣ′ ≤ wᵣ

Here, r is a fine rule and r′ is its projection. wᵣ and wᵣ′ are their respective weights. The inequality says that replacing a fine rule with its coarse counterpart can only maintain or reduce its cost.

The paper gives a construction that enforces this requirement:

wᵣ′ = min { wᵣ : r ∈ Gₜ, πₜ(r) = r′ }

Here, min selects the smallest weight among fine rules r in grammar Gₜ that map to the same coarse rule r′. The colon introduces the conditions for inclusion in the set, and ∈ denotes membership. The expression πₜ(r) means that πₜ is applied to the symbols of rule r. The resulting weight wᵣ′ belongs to the rule in the grammar at level t−1.

Every fine derivation can be projected to a coarse derivation whose cost is at most that of the original. The same reasoning applies to the context of an item. Project the fine outside structure, and its rules become at least as cheap as before. The best coarse outside structure can be cheaper still, since the coarse grammar can join structures that require incompatible distinctions in the fine grammar. Accordingly, the optimal coarse outside cost is a lower bound for the fine outside cost.

The construction can be applied repeatedly, starting with the target grammar and projecting toward the most abstract level. As more rules are grouped, the minimum weight can come from any one of many fine alternatives. A series of individually cheap choices in the coarse grammar can therefore produce a very optimistic cost for a whole context. This is compatible with the lower-bound requirement. The experiments ask how much useful guidance remains when that happens.

How the agenda moves between grammar levels

Hierarchical A* maintains two kinds of chart entries at each level. An inside entry records a way to derive the words under a category. An outside entry records a way to derive the rest of the sentence around that category. All pending entries compete on the same agenda, irrespective of type or grammar level. An item that advances the coarse search can therefore be followed by an item that uses the newly available information in a finer grammar.

How hierarchical A* builds a target parse

The steps in order.

How hierarchical A* builds a target parseStep 1: Queue the most abstract grammar’s terminal items1. Queue the most abstract grammar’s terminal itemsStep 2: Build inside items and complete the coarse root2. Build inside items and complete the coarse rootStep 3: Seed outside search from the completed root3. Seed outside search from the completed rootStep 4: Derive outside costs using inside siblings4. Derive outside costs using inside siblingsStep 5: Enable finer items when projected bounds become available5. Enable finer items when projected bounds become availableStep 6: Share agenda priorities across all grammar levels6. Share agenda priorities across all grammar levelsStep 7: Return the derivation at the target root7. Return the derivation at the target root

The initial agenda holds the terminal items in the most abstract grammar. At finer levels, even a terminal waits until the chart contains its projected outside item. Once that prerequisite is met, the terminal can enter the agenda. Its inside cost is zero, so its priority comes from the coarse bound. As binary rules assemble longer spans, a fine inside item similarly waits for three ingredients to be available in the chart. These are its two fine inside children and its corresponding coarse outside item.

For an inside deduction at a level with a coarser projection, the priority is:

p(e) = βₑ + α_{ē′}

Here, e is a fine inside item and βₑ is its candidate inside cost. ē′ denotes the outside item for its projected category and the same span, one level coarser. α_{ē′} is that chart item’s outside cost. The symbol p denotes the priority function. The two addends have different jobs. The fine one scores the derivation that has been assembled. The coarse one provides the bound used to schedule further work.

At a given level, an outside computation can begin when the full-sentence inside root is removed from the agenda. The root’s outside item has cost 0, since it has no surrounding structure. It is queued with priority equal to the inside cost of that root. From the root, the parser can derive outside items for smaller spans. A deduction takes the outside context of a parent and adds the rule and the inside structure on the sibling side. It also requires the inside item for the child whose outside context is being proposed, since that inside item supplies the remaining term of the outside item’s priority.

The proposed outside cost for the left child is:

α_B = α_A + β_C + wᵣ

Here, α_B is the candidate outside cost of child B over the span from i to k. α_A is the outside cost of its parent A over the span from i to j. β_C is the cost of building the right sibling C from k to j, and wᵣ is the cost of the rule r connecting the parent and children. These entries and the rule belong to the same grammar level.

The corresponding deduction for the right child is:

α_C = α_A + β_B + wᵣ

Here, α_C is the candidate outside cost of child C from k to j. α_A again gives the parent’s surrounding cost, β_B gives the cost of building the left sibling from i to k, and wᵣ again scores the rule that attaches the children. The child’s own inside cost is reserved for evaluating the agenda priority.

The outside item’s priority is:

p(o) = αₒ + β_{ō}

Here, o is an outside item, αₒ is its candidate outside cost, and ō is its matching inside item at the same grammar level, with the same category and span. β_{ō} is the cost of that inside item, which the required chart entry has already supplied. p(o) is the queue priority. Thus an outside deduction is scheduled by pairing the new context with a known way to fill its opening. An inside deduction uses a context from the preceding grammar level because the fine outside search is itself being assembled on the agenda.

The priorities and deduction requirements give hierarchical A* the optimality property the paper draws from the general framework. When an inside or outside item comes off the agenda, the cost of that item’s derivation is optimal for its type and grammar. The fine-level search can rely on finalized outside costs from its projection. Once the agenda removes the full-sentence inside root in the target grammar, the search ends and follows the backpointers to recover the best derivation. The coarse charts can remain incomplete at termination. Work on a coarse item is necessary only insofar as the queue reaches it before reaching the target goal.

How coarse-to-fine pruning uses the same machinery

For coarse-to-fine pruning, the relevant quantity is the cost of the best complete tree containing a given item in the coarse grammar. The paper calls this a max marginal. In cost notation, it is the sum of the cheapest way to build the item and the cheapest context in which it can appear. Those pieces can be joined because they agree on the item’s category and span. With a cost objective, a larger value indicates a less competitive item.

To decide whether to retain a fine item, standard coarse-to-fine pruning compares the projected item’s max marginal against the best complete coarse parse. The paper’s test in the notation used above is:

α_{ē′} + β_{e′} > β_{R′} + τ

Here, e′ is the coarse projection of the fine inside item e, and ē′ is its coarse outside counterpart. β_{e′} is the coarse inside cost and α_{ē′} is the coarse outside cost. β_{R′} is the best full-sentence root cost at that coarse level. τ is the allowed cost margin above that optimum. An item whose projection satisfies the strict inequality is discarded. A projected item at the cutoff survives that test.

The agenda implementation gives inside items the priority used by uniform-cost search:

p(e) = βₑ

Here, p(e) is the priority of inside item e and βₑ is its inside cost. Coarse approval is still required for the fine item to enter through the appropriate deduction. Once it is eligible, the inside cost determines its place in the queue.

The outside items are where the pruning decision takes effect:

p(o) = ∞             if αₒ + β_{ō} > β_{Rₜ} + τₜ
p(o) = αₒ + β_{ō}    otherwise

Here, o is an outside item at level t, αₒ is its outside cost, and β_{ō} is the inside cost of its matching item. β_{Rₜ} is the inside cost of the full-sentence root at level t. τₜ is the threshold for that level and is non-negative. p(o) is the outside item’s priority. The infinity symbol ∞ denotes a suppressed item. An outside item within the threshold retains the summed priority.

Because the fine inside deduction requires the coarse outside item, suppression at the coarse level prevents the dependent fine items from entering the agenda. The authors describe this as pruning slightly earlier than the conventional formulation, where the decision is expressed as skipping the fine items themselves. They say the agenda version explores the same set of states as CKY-based coarse-to-fine pruning, with flexibility in the order. It can lose the target optimum if a constituent of the optimal fine derivation projects to a discarded coarse item.

The thresholds can be selected separately at different levels. The threshold sweep in the state-split experiment uses a shared value for simplicity. Raising the allowed margin retains more of the coarse chart’s possibilities. That gives the target derivation more ways to remain reachable, at the expense of allowing more fine items onto the agenda. Hierarchical A* has no analogous allowance for search errors in the experiments. Its efficiency depends on how useful the bounds are for ordering the work.

How the experimental grammars were obtained

For the state-split experiments, the authors trained grammars with the Berkeley Parser. The training starts with an unsplit X-Bar grammar and successively refines its categories through split-merge cycles. The additional substates are latent, meaning that the categories used internally distinguish structures more finely than the categories directly observed in the training trees. The successive refinements give the authors ways to map categories back to coarser inventories. Those mappings define which rules are grouped together when building the auxiliary grammars.

Hierarchical A* and coarse-to-fine pruning then assign different weights to the groups. The exact search uses the minimum-weight construction so that every projected rule obeys the relaxation. Following Petrov and Klein’s approach to pruning, the authors set the coarse weights to minimize the discrepancy that KL divergence measures between the coarse tree distribution and the target distribution. The paper characterizes those weights as more like an average than a minimum. The distinction matters because pruning needs coarse rankings that are useful as a guide to plausibility. Exact A* needs costs with a provable relationship to the fine costs.

The lexicalized experiment uses grammars built with the Stanford Parser. Its sentence-specific target grammar combines an unlexicalized PCFG and a dependency component. The PCFG scores constituent structure. The dependency component scores relationships involving the words, providing the lexical information used by the combined system. The hierarchy uses the PCFG projection, while the authors obtain dependency completion scores from a separate component. In the lexicalized coarse-to-fine run, the pruning decision uses the PCFG max marginals alone.

The combined A* completion estimate is the sum of the two outside scores:

h(e) = h_PCFG(e) + h_dep(e)

Here, e is an item in the combined grammar and h(e) is its completion estimate. h_PCFG(e) is the outside score computed for its PCFG projection and h_dep(e) is the outside score supplied by the dependency projection. The plus sign adds the bounds from the two components, following the factored parsing approach used in the earlier work. The hierarchy in this experiment helps compute the PCFG contribution.

Experiments and results

What counts as work and what counts as an error

The authors judge efficiency primarily by how many edges the parser pushes onto the agenda. An edge is a chart item such as an inside analysis or an outside context. A push registers pending work generated by the search. This measure includes work from the auxiliary levels, so it can capture the costs of obtaining a heuristic as well as the costs of applying it. It also responds to the branching differences between grammars. Expanding an item in a refined grammar can generate more successors than expanding a coarse item. Counting only removals from the queue would give both expansions the same weight even when they produce very different amounts of follow-on work.

CPU time would be a direct measurement of speed on a given implementation and machine. The paper emphasizes that it also depends on hardware, low-level implementation choices, and what else a machine is doing. The authors report that agenda pushes correlated well with CPU time in their experiments. Their comparisons of search effort use that relationship. The results are most directly about the amount of work the parser generates, with the authors reporting speedups for the tested implementations.

A search error is a failure to recover a best derivation of the target grammar for the sentence. Uniform-cost search and the exact A* variants supply reference points with no search errors. Coarse-to-fine runs can differ from those reference points because their pruning rules can remove a required item. The reported error percentages describe the frequency of those failures across sentences. They give no direct measure of agreement between the parser’s trees and a human annotation.

The state-split benchmark

The training data were sections 2-21 of the Penn Treebank. The authors ran 6 split-merge cycles and obtained 7 grammars. The unsplit X-Bar grammar had 98 symbols and 8773 rules. The 6-split grammar had 1139 symbols and 973,696 rules. That finest grammar was the target for all state-split comparisons. The test set consisted of sentences of length ≤ 30 from section 23. In each run, the parser sought the best fully refined derivation of the same sentence under the same target grammar.

Rule counts at the endpoints of the Penn Treebank state-split hierarchy

The finest grammar has far more rules than the unsplit grammar used to approximate it.

Rule counts at the endpoints of the Penn Treebank state-split hierarchyUnsplit X-Bar grammar: 8773Unsplit X-Bar grammar87736-split target grammar (this paper): 973,6966-split target grammar (this paper)973,696
The numbers
System or settinggrammar rules
Unsplit X-Bar grammar8773
6-split target grammar (this paper)973,696

The rule counts describe the size of the grammars the parser starts from. They explain why the smaller problem is attractive as a source of guidance. The number of agenda pushes then shows whether using such a grammar actually saves work over a particular search. A small auxiliary grammar can be a poor investment if it requires extensive processing and supplies loose bounds for the level above it.

The Viterbi objective also matters for comparison with the parsing work that supplied the grammar hierarchy. In their earlier work, Petrov and Klein used these grammars to approximate the most probable parse with a variational method. Pauls and Klein optimize the fully refined derivation. Pruning criteria that help with one objective can preserve different candidates under the other. The paper attributes the lower search-error rates in the earlier work to a closer fit between its objective and its pruning criterion.

What exact search gained from a hierarchy

The uniform-cost baseline, abbreviated UCS, used no completion estimate. The standard A* baseline used the 3-split grammar as its only auxiliary grammar. The authors chose it because it gave the best overall speed among the choices they tested for standard A*. In this baseline, the auxiliary inside and outside information is computed exhaustively. The reported speedup over UCS was about a factor of 5 on the state-split test set.

The authors also ran hierarchical A* with only the 3-split auxiliary grammar. It was about 10% faster than standard A* despite using the same grammars. The difference lies in when the auxiliary work gets done. Standard A* completes the auxiliary computation before searching the target. Hierarchical A* can begin the fine search as soon as useful coarse results reach the chart, and it can terminate with unneeded coarse work still pending. Because the auxiliary grammar is held fixed, the comparison isolates the advantage of making its computation part of the shared search.

They then tried the 3-5 split hierarchy. Adding the 4- and 5-split auxiliary grammars improved performance by another 25% over the hierarchical run with just the 3-split grammar. The result shows that additional guidance can save enough work in a refined search to repay the cost of generating it. But a run using all 6 auxiliary grammars, 0-5 split, was less efficient than the one using 3-5. It generated extra work at levels whose low costs made little contribution to deciding which refined items to explore first.

All of these exact variants solved the same target problem on the same test sentences. Their efficiency differences concern the schedule of work and the cost of computing the heuristics. Neither the selection of auxiliary levels nor the different agenda order changes the optimum they are required to find.

Where coarse-to-fine was faster

In the main state-split comparison, the coarse-to-fine variants in Figure 4 made search errors on about 2% of test sentences. The paper reports that adding the 0- through 2-split grammars gave coarse-to-fine a factor of 8 speedup without additional search errors in that comparison. This was the part of the hierarchy that hurt hierarchical A* when it was added to the stronger exact configuration. With pruning, the coarse grammar can prevent numerous later items from being constructed. Its contribution depends on the judgments it makes cheaply, even if some of the judgments that survive to finer levels need to be revised there.

The authors also compare agenda pushes by sentence length for hierarchical A* with the 3-5 split auxiliaries and coarse-to-fine with the 0-5 split auxiliaries. In the observed range, coarse-to-fine effort grew less sharply with length. The paper connects this behavior to the amount of input outside an item’s span. As the surrounding context includes more words, a relaxed grammar has more opportunities to accumulate savings relative to the fine grammar. The resulting bound can leave more work ahead of the true best derivation in the A* queue.

A threshold sweep with all 6 auxiliary grammars traces the efficiency and error tradeoff. At settings with a moderate search-error rate, described as < 5%, the paper reports that coarse-to-fine was more than 10 times faster than hierarchical A* and nearly 100 times faster than UCS. When the tolerated search-error rate fell below 1% on the state-split grammars, hierarchical A* was the faster option. In that part of the sweep, retaining enough items to recover the optimum on almost every sentence erased the pruning method’s earlier efficiency advantage. Hierarchical A* already attains the optimum without relaxing its guarantee.

The percentages in these comparisons describe different points or regions of the experiment. The about 2% figure describes the coarse-to-fine variants in the main comparison. The other rates describe the regimes highlighted in the threshold sweep. Together they show the range over which the ranking of the methods changed on this benchmark.

A different outcome with the lexicalized grammar

In the lexicalized experiment, section 21 of the Penn Treebank serves as the test set, and sections 2–20 serve as the training set. The PCFG component has 19,054 symbols and 36,078 rules. For each sentence, the size of the combined grammar depends on the sentence length. The paper gives its symbol multiplier relative to the PCFG as:

n

Here, n is the number of words in the input sentence. The sentence-specific combined grammar has this many times the symbols of the PCFG component.

The reported rule multiplier is:

2n²

Here, 2 is the coefficient given by the authors and n² is the square of the input length n. The multiplier applies to the number of rules in the PCFG component. The size of the complete grammar gives the search a reason to exploit the simpler projections, even though the eventual ranking of the strategies differs from the result for state splitting.

The exact lexicalized run uses one auxiliary PCFG level in hierarchical A* and takes the separate dependency estimate as given. The coarse-to-fine run searches the combined grammar with uniform-cost priorities and uses max marginals in the PCFG to prune. The paper presents a threshold sweep for pruning and a fixed exact-search comparison. It reports that hierarchical A* was faster throughout the examined range, including at thresholds that caused many search errors. The lexicalized results figure labels the exact reference A*, and the surrounding account describes the hierarchical use of the PCFG projection.

The completion estimate was unusually tight. Even at spans of length 1, average slack was less than 1% of the overall cost assigned by the combined grammar. In a span containing a single word, much of the sentence remains outside, so a bound that stays close to the true cost there provides strong guidance early in search. The lexicalized result shows that moderate error tolerance alone does not predict a pruning advantage. The quality of the available bound can make exact search the more efficient choice even when approximate search is allowed to discard aggressively.

What the ablations show

The value of interleaving can be measured separately

The closest comparison to an isolated change is standard A* against hierarchical A* with the same 3-split auxiliary grammar. Both have the same target and get their heuristic from the same coarse problem. The major change is whether the entire auxiliary pass runs first or its results are computed on the shared agenda. Since the grammar quality is held fixed, the improvement in this comparison is evidence for interleaving itself. The exact strategy can spend time on the parts of the auxiliary problem that become relevant before it reaches the goal.

This result also clarifies what a hierarchy with a single auxiliary level contributes. Its benefit can come from the timing of the heuristic computation even before the parser adds a heuristic to guide that computation. Once the authors add the 4- and 5-split levels, there is a further effect. Those levels add intermediate estimates between the 3-split grammar and the target, improving the order in which the parser works on increasingly refined items. The reported gain shows that those intermediate computations pay for themselves in that configuration. The single-auxiliary comparison gives a baseline against which to interpret the extra levels.

Putting all 6 auxiliaries in the hierarchy tests whether that gain extends to every additional level. It does not in the authors’ state-split experiment. The smallest relaxed grammars give many items very low priorities. These items are processed ahead of substantial work in the refined grammars. The decisive cost of adding a level includes the coverage of the search it induces. A very small grammar can still be costly in aggregate when almost all of its items must be processed and the resulting estimates barely sort the finer items by their prospects.

Slack connects grammar weights to agenda effort

The authors call the gap between an outside estimate and the true outside cost slack. For a valid lower bound, the true cost is at least the estimate, so the size of that gap indicates how much room the heuristic leaves for a candidate to look better than it can be. A bound can be correct for every item and still be too optimistic to narrow the useful part of the queue. As more low priorities accumulate ahead of an optimal complete derivation, A* generates more candidates before it can finish.

The first slack analysis averages the gap over items in the Viterbi tree. It groups the results by outside context size, measured in the number of words still outside the item’s span. The plot includes references for an exact heuristic and a uniformly zero heuristic. The exact reference gives the completion cost itself. The zero reference gives up the guidance that comes from estimating the remaining cost. Between those reference cases, the coarsest relaxed grammars show especially large slack when the outside context grows.

This is consistent with the way the relaxed weights are constructed. Each projected rule can adopt the cheapest weight available from its group of fine rules. A long outside derivation has many opportunities to benefit from those minimum choices. If the choices rely on different fine distinctions, their apparent savings may be unavailable together in the target grammar. Even a sequence of valid lower bounds can therefore give a poor estimate of the true completion cost. The more context the heuristic has to score, the more that looseness can matter.

The second slack analysis runs A* with each auxiliary grammar individually and compares agenda pushes with the grammar’s average slack for spans of length 10. Using a single auxiliary grammar at a time gives a direct view of the relationship between bound quality and work when those grammars serve as separate sources of guidance. The plot associates larger slack with more agenda pushes. The authors connect the pattern to the theoretical behavior that A* work can grow exponentially with heuristic slack. The experiment illustrates the sensitivity on these grammars. It supplies a diagnostic for the observed slowdown when the smallest relaxations are added to the hierarchy.

The sentence-length analysis supplies a complementary view. Holding the chosen hierarchical configurations fixed, the authors see a steeper rise in work for hierarchical A* than for coarse-to-fine pruning. The slack plots examine the number of unincorporated words around an item, while the length plot examines whole sentences. Longer sentences allow larger outside contexts, so the two observations fit together. The analysis makes a specific explanation available for the observed scaling of work. The parser can be exact throughout and still process many more items as its lower bounds loosen.

Pruning can use coarse information of a different kind

The 0- through 2-split levels have opposite effects in the reported state-split comparisons. In hierarchical A*, including the coarsest levels creates a large block of low-priority auxiliary work. In coarse-to-fine pruning, adding those levels yields the reported factor of 8 speedup without increasing the observed search-error rate in that comparison. The benefit of pruning comes from its ability to suppress any later items that depend on a rejected coarse entry. A very abstract grammar can still identify regions of the search worth dropping before more expensive grammars explore them.

This comparison uses the same category projections, with different weights chosen for the two purposes. Coarse-to-fine benefits when the coarse scores are reasonably representative of the target’s preferences. Hierarchical A* depends on each projected cost satisfying the relaxation, even when the minimum cost is unrepresentative. The authors tested average-style projection weights as A* heuristics. Those weights violated consistency, the resulting runs made many search errors, and the change yielded little speed benefit. The trial shows why the coarse-to-fine weights cannot simply be substituted while retaining the exact-search guarantee.

The threshold sweep manipulates the pruning opportunity directly. Tightening the margin excludes more items and creates more occasions for losing a target-optimal derivation. Widening it preserves more alternatives and makes the search more expensive. On the state-split grammars, that sweep reaches a range in which hierarchical A* does less work while retaining exactness. The sweep helps identify the reason for the change in ranking. It occurs when the approximate search has to keep enough possibilities to offer almost the same protection against search error.

The lexicalized case tests how far the pattern travels

The lexicalized comparison puts the methods in a setting with a different source of estimates. A* combines outside scores from the dependency and PCFG projections, and those scores give a tight bound. Coarse-to-fine prunes using the PCFG alone. Across the tested thresholds, pruning fails to catch the speed of the exact reference. The authors’ slack measurement supports their explanation that there is relatively little unnecessary A* work for pruning to save in this case.

Because the grammar, available estimates, and pruning evidence all change between the state-split and lexicalized experiments, the comparison has the role of a contrasting case. Within the state-split analysis, the single-grammar slack plot connects looser bounds with more work while keeping the target grammar fixed. In the lexicalized experiment, a different scoring setup produces the behavior that connection would lead one to expect from a tight bound. The evidence for the mechanism comes from reading those comparisons together.

Limitations

Limits the authors identify

The authors restrict the study to search errors. Their guarantee is about finding the least-cost derivation under the target grammar, and their error measure records when pruning loses that derivation. The statistical choices that produced the grammar are outside that evaluation. A perfect search therefore establishes successful optimization of the grammar’s objective. The study leaves open how the observed search errors affect agreement with annotated syntax or usefulness in another task.

The authors also flag the difference between their state-split objective and the one in Petrov and Klein’s earlier parser. The Viterbi target here is a fully refined derivation. The earlier objective uses a variational approximation to the highest-probability parse. The paper explains that the earlier objective is better aligned with the pruning criterion and reports fewer search errors. The margin figures in this paper must therefore be read with the specific Viterbi objective and grammar construction that produced them.

The efficiency measure has a stated practical limit. Agenda pushes correlated well with CPU time in these experiments, but the authors note that actual timing depends on implementation and hardware. The counts describe the amount of work in a shared queue-based setup. They leave open how much of the reported performance gap would carry to a different implementation or how memory usage would compare under other chart representations.

The state-split threshold experiment uses a single shared threshold even though the agenda formulation allows thresholds to differ by level. Its tradeoff represents the settings explored with that choice. Separate tuning could change how much of the search is removed at each level, with consequences for efficiency and errors. The authors also describe the fully factored extension of hierarchical A* to the lexicalized setup as ineffective in practice. They consequently leave the dependency computation outside the hierarchy and include only the PCFG projection in it. They report neither a lexicalized UCS comparison nor a lexicalized hierarchy with multiple auxiliary levels.

Limits visible in the experimental setup

Both evaluations use Penn Treebank data, with different section splits for the two grammar families. The state-split test restricts sentences to length ≤ 30. The observed relation between length and work pertains to that range and that hierarchy. The experiments leave open how the particular crossover, or the slope of agenda work against length, changes on longer inputs or on another collection of sentences. The lexicalized result already establishes that the outcome can change substantially with the grammar and heuristic.

The common agenda controls an important implementation difference, but the main comparison measures complete strategies with their own appropriate projections. State-split pruning uses coarse weights selected for closeness to the target distribution. State-split A* uses minimum weights under the relaxation. In the lexicalized comparison, A* uses evidence from both factors for completion costs while the pruning test uses the PCFG factor. The results establish how those particular configurations perform. The individual effect of queue ordering, projection weights, and access to the dependency estimate can only be assigned where a comparison holds the other ingredients fixed.

The average slack analysis is also selective by design. Its context-size plot averages over items in the Viterbi tree. A* can generate many other items, and their priorities help determine how much the parser actually does. The plot shows how the heuristic behaves around parts of an optimal derivation. The separate comparison with agenda pushes shows that the diagnostic varies in step with search effort across the tested auxiliary grammars. It does not give a complete accounting of the priorities of all items, and the reported averages can conceal variation across items and sentences.

Finally, the cited error percentages are frequencies over sentences. They do not specify how far the returned derivations were from the target optimum on the sentences where pruning erred. Without that additional information, the same rate could represent occasional errors of different magnitudes. The threshold curves establish a tradeoff between search effort and the frequency of missing the optimum. The cost of those misses under a downstream objective remains an open question.

What came after

K-Best A* Parsing cites Hierarchical Search for Parsing and takes up A* under a ranked-output objective. Here, the agenda reaching the target root is a sufficient stopping condition. At that point the parser has established the cost of an optimal derivation and can use the backpointers to recover it. A k-best parsing problem asks for a ranked collection of parses. Finding the first optimal result settles the beginning of that ranking, while the remaining ranked results still have to be established.

The connection concerns what a priority queue can certify about complete analyses. In Hierarchical Search for Parsing, the completion bounds allow the parser to reach an optimal root without finishing every auxiliary search. Ranked output raises a related question about what information must be retained after that point. A chart record sufficient to recover the cheapest derivation can leave out alternatives that matter for later positions in a ranking. Likewise, a stopping condition that is sound for one optimum does not by itself certify the rest of a ranked output. Those are consequences of the change in objective, independent of the particular implementation of a k-best parser.

The citation and the later paper’s title establish this connection at the level of the parsing objective and the use of A*. Whether the later algorithm reuses the multi-level grammar construction, the shared inside and outside agenda, or either experimental setup is unspecified. The earlier paper’s contribution remains the comparison of search strategies for recovering one Viterbi derivation. The later work places A* in a setting where the parser must account for further complete analyses after the first has been found.

Cite

Cite as Adam Pauls and Dan Klein. 2009. Hierarchical Search for Parsing. Proceedings of Human Language Technologies: The 2009 Annual Conference of the North American Chapter of the Association for Computational Linguistics.

The paper itself, not this page. BibTeX from the library's record of the work.

@inproceedings{pauls2009hierarchical,
  title = {{Hierarchical Search for Parsing}},
  author = {Adam Pauls and Dan Klein},
  booktitle = {Proceedings of Human Language Technologies: The 2009 Annual Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2009},
  doi = {10.3115/1620754.1620835},
  url = {https://doi.org/10.3115/1620754.1620835}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/pauls-2009-hierarchical-search-parsing/