Elamur Research

Left language model state for syntactic machine translation

Paper · 2011 · Kenneth Heafield, Hieu Hoang, Philipp Koehn et al.

Summary

A syntactic machine translation decoder can build a sentence by joining separately translated fragments. When it does, a language model has to reconsider some words near the join. A word that was scored with only the beginning of its own fragment as context may now have useful words to its left. The decoder keeps a record of each fragment’s edges so it can make these corrections. The paper asks how much of that record it really needs and how much work it can avoid when using it.

The authors show that the decoder can discard some words from the record of the left edge. The test concerns which word sequences the language model explicitly stores. When no stored sequence can extend a certain prefix farther to the left, the effect of adding context to its final word can be accounted for without retaining that word. This shorter state lets the decoder group more fragments whose behavior at later joins will be equivalent. The authors also store direct references to language-model entries, avoiding repeated lookups, and stop scoring across a join once the words from the preceding fragment can no longer affect the remaining corrections.

At a fixed search limit, the changes reduce CPU time by 3-6% across the tested systems. The search generally finds translations with better scores under the decoder’s own objective. The paper also finds that shortening the left state allows more fragments to be grouped than shortening the right state does, yet has a smaller effect on the score of the best translation found. The authors connect this result to penalties for falling back to shorter word histories. Some penalties associated with a short left state are still absent from the fragment’s provisional score and appear only when the fragment is placed in context.

The Chinese-to-English experiment shows what happens when the decoder spends the improvement on speed. The baseline takes 19.6 CPU seconds per sentence with a pruning limit of 1000. With the new handling of left state and a limit of 910, the decoder takes 17.3 CPU seconds per sentence, an 11% reduction, while reaching a slightly higher average objective score. Uncased BLEU moves from 29.63% to 29.67%, a difference the paper reports as insignificant.

Deep dive: Left language model state for syntactic machine translation

Left language model state shows how a syntactic translation decoder can score fragment joins faster and find better translations by its own objective. · about 37 minutes to read

The problem and its context

Why joining translations changes their scores

The decoders in this paper assemble a translation from the bottom up. A grammar rule describes how to put together words and smaller translated pieces. A decoder can keep several candidates for each piece, combine them under rules, and use the resulting candidates in further combinations. Eventually it has candidates for the whole sentence. The order in which pieces are constructed can leave the left context of a target fragment undecided for much of the search. A fragment may already have a provisional score before the decoder knows which words will come immediately before it.

Many of the quantities used to score a translation can be accumulated as rules are applied. If a rule contributes a feature value, that contribution can be added to those already collected for its children. The target-language score has a different dependency. A word sequence of interest can begin within a child fragment and end within the next one. Scoring those children separately never presents the entire sequence to the language model. The missing information becomes available when the fragments are joined, so the decoder needs a way to update the score at that point.

The scoring mechanism is an n-gram language model. An n-gram is a contiguous sequence of words. Here the next word is scored given a limited number of preceding words, with the maximum set by the order of the language model. Near the left edge of an isolated fragment, some of those preceding positions are missing. Farther into the fragment, the words already present supply all the context that the scoring rule can use. Joining the fragment to something on its left can therefore change the score near its beginning while leaving the scores farther inside it intact. The limited reach of these dependencies makes a compact description of a fragment possible.

Dynamic programming exploits this property by collecting fragments with equivalent behavior in later rule applications. The operation is called recombination. A decoder can keep the best-scoring way to build a candidate in a given state for the purpose of finding the highest-scoring complete translation. The state is the information needed to account for what happens when the candidate is extended. At the left edge, it describes words whose provisional scores may change. At the right edge, it describes words that may affect the score of a following fragment. Two candidates with different words in their interiors can share a state once the decoder has accounted for their existing scores and established that they offer the same relevant information at their edges.

Keeping all potentially relevant edge words is a straightforward way to define equivalence. It also makes the set of possible states large. The paper gives the same order of growth for the time and space per constituent under this direct approach.

O(V²ⁿ⁻²), with n = N

Here O expresses the order of growth, V is the vocabulary size, and N is the maximum language-model order. The exponent accounts for the words potentially retained at both edges. A constituent is a unit of the grammar-based search for which the decoder keeps candidate translations. Even when a particular constituent occupies only a small part of the source sentence, it can acquire many candidate states.

How the decoder decides what to try

Practical decoders restrict the number of combinations they evaluate. The paper focuses on cube pruning, a way of prioritizing rule applications when a rule offers several possible choices for its component fragments. A target-side rule can contain terminals, which are actual words, and nonterminals, which stand for pieces to be supplied by other hypotheses. For each nonterminal, the decoder has a set of possible values. Choosing a value for each one specifies a rule application to evaluate. The search space is organized by those choices, so the decoder can use promising combinations to direct its attention to other combinations.

A combination receives an initial estimate from the rule and the scores already calculated for its chosen pieces. The paper describes combining those scores by multiplication, or by addition when they are expressed in logarithms. The estimate is available before the language model has made the corrections at the new boundaries. The decoder considers the highest-priority possibilities under that estimate first. Taking a candidate from this ordering and evaluating it is a pop. The pop limit caps how many rule applications the decoder can compute for a constituent. A larger allowance permits it to examine more of the space and costs additional computation.

The resulting search has distinct sources of inefficiency. Evaluating an application can involve a long series of lookups even though some work repeats what the decoder did when it built the pieces. The decoder can also spend part of its limited allowance on fragments that have the same future scoring behavior but whose records make them look distinct. Shortening those records can affect which possibilities get considered. Speeding up a join can reduce the cost of processing the possibilities that do get considered. The paper studies both effects within bottom-up decoding.

What earlier decoders already did

The authors describe other ways to arrange the search. A decoder that builds the target sentence in reading order already knows what comes before its current right edge. For language scoring, it can recombine candidates based on equivalent right states. Such decoders typically use beam search, grouping hypotheses that are comparable for pruning, for instance by length. The approach can make more recombinations possible. Evaluating a constituent in several distinct left contexts can also repeat work. The paper situates this approach through work on hierarchical phrase-based translation and on tree-to-string decoding. Left-to-Right Target Generation for Hierarchical Phrase-Based Translation · Efficient Incremental Decoding for Tree-to-String Translation

Cube growing, another approach described in the paper, generates candidates for a constituent as they are needed. Cube pruning uses a fixed allowance for producing them. Both build sentence fragments, group equivalent hypotheses, and rank candidates using estimated scores. The authors locate their changes in that shared work within a constituent. Improving an edge record or a join can be relevant to how a candidate is represented and assessed under either schedule. Forest Rescoring

The idea of shortening both boundary records also had a precedent. The earlier chart-decoder work discussed by the authors reduced left and right state but kept the entire fragment in state when it was shorter than the usual boundary allowance. Its comparison turned both forms of minimization on together. It connected opportunities for minimization to sparsity, the fact that only some of the possible word sequences are explicitly stored. The present paper keeps the earlier left-edge criterion for long fragments and extends its use to short ones. It also asks separately how much each edge contributes to recombination and to the quality of the search under the decoder’s objective.

The choice of language-model interface shaped what decoders could readily do. SRILM could supply a probability and, with a separate call that repeated work, the minimum right state. It did not tell the decoder which order had matched or whether a sequence could extend to the left. The implementation in Joshua discussed by the authors made applying the earlier minimization expensive enough that its documentation favored SRILM with neither edge minimized for CPU and memory use. Thus the existence of a condition for dropping words did not by itself make the condition cheap to exploit. Joshua

IRSTLM gave the decoder the order of the sequence matched in a query. This can bound what needs to be stored, since a match that ends at a shorter order carries information about what is absent. There is a further question even after a match succeeds. A sequence can have its own entry and still have no longer entry continuing it in a particular direction. Discovering that fact from the same lookup that obtains the probability is part of the authors’ solution. The paper develops that interface in KenLM for its reverse trie and its probing data structure. KenLM

The method, step by step

Score what the fragment already tells you

A candidate carries a provisional language score. Its early words are evaluated with whatever history the fragment itself supplies. Its later words have enough history within the fragment to fill the language model’s context window. When the candidate is put to the right of another one, only the early scores can need revision. The update is a correction to an existing score, so the decoder does not have to rescore the union as if both pieces were new.

How the decoder scores a fragment join

The steps in order.

How the decoder scores a fragment joinStep 1: Score fragments using their available histories1. Score fragments using their available historiesStep 2: Find prefixes that can still extend left2. Find prefixes that can still extend leftStep 3: Save references to retained prefixes3. Save references to retained prefixesStep 4: Start each correction from its saved entry4. Start each correction from its saved entryStep 5: Update the right state as words enter5. Update the right state as words enterStep 6: Stop when the earlier context loses influence6. Stop when the earlier context loses influenceStep 7: Keep the boundary state for later joins7. Keep the boundary state for later joins

The paper indexes the words of the following fragment starting at the join. For the formula below, the upper bound in the first product is capped at the actual fragment length. This is how the paper applies the formula when the fragment ends before supplying a full context window.

p(w₁ᴷ) = (∏ᵢ₌₁ᵏ p(wᵢ | w₁ⁱ⁻¹)) (∏ᵢ₌ₙᴷ p(wᵢ | wᵢ₋ₙ₊₁ⁱ⁻¹)), with n = N and k = min{N − 1, K}

Here wᵢ is the word at position i, and a lower and upper index on w delimit a contiguous sequence of words. K is the final position of the fragment, N is the language-model order, and n in this formula denotes that same order. k is the length of the prefix whose scores were computed with potentially incomplete context. p denotes a probability, and the vertical bar separates the word being scored from its conditioning history. ∏ multiplies the terms over the indicated positions. If a range is empty, its product contributes the multiplicative identity. If there are no preceding words at a position, its history is empty.

The first product covers words that could gain usable context from the left. The second covers the rest, each with the preceding window supplied by the fragment itself. This division gives the decoder a provisional probability for comparison with other fragments. It also identifies exactly which factors might need to be replaced if the decoder learns more about the left context.

At a join, the paper uses nonpositive positions for words in the preceding fragment. The last word of that fragment has index 0. The first word of the following fragment has index 1. This choice makes the location of a boundary-crossing sequence explicit in the expression for the correction.

p(wⱼᴷ) = p(wⱼ⁰) p(w₁ᴷ) c(wⱼ₀⁰, w₁ᵏ), with j₀ = max{2 − N, J} and j = J

Here J is the first position of the preceding fragment, so J ≤ 0. The j on the left side and in the first probability on the right side denotes that same position, while j₀ is the start of the usable suffix of that fragment. max chooses the later of the context-window bound and the actual start. wⱼᴷ is the entire joined fragment, wⱼ⁰ is the preceding fragment, and w₁ᴷ is the following fragment. The function c is the correction factor. Its arguments are the preceding fragment’s usable right edge and the following fragment’s provisional left edge, whose length is k. K, N, w, and p have the meanings established above.

For the remaining formulas, j denotes the beginning of the usable suffix, the quantity called j₀ above. The decoder corrects the score of each early word by dividing out the provisional contribution and multiplying in the contribution based on the available context at the join.

c(wⱼ⁰, w₁ᵏ) = ∏ᵢ₌₁ᵏ [p(wᵢ | wₘⁱ⁻¹) / p(wᵢ | w₁ⁱ⁻¹)], with m = max{j, i − N + 1}

Here c is the total correction, j starts the available suffix, and k ends the prefix being corrected. i indexes each scored position. For that position, m starts the updated history at the later of the available suffix’s beginning and the earliest position allowed by order N. The numerator conditions the probability of wᵢ on that updated history. The denominator conditions the same word on its original history within the following fragment. The product multiplies the individual ratios. The notation wₘⁱ⁻¹ runs from position m through the word immediately before wᵢ.

The paper illustrates the boundary with a fragment ending in “is one of the few” and another beginning “countries that have diplomatic relations.” With the order used in the illustration, the suffix made available by the first fragment begins at “one,” and the provisional prefix of the next fragment ends at “diplomatic.” The word “countries” can be rescored with words on the other side of the join. By the time the decoder reaches “relations,” the preceding words inside its own fragment already fill the history window. The illustration shows how the order of the language model bounds the initial state. The minimization procedure asks which of the words within that bound actually need to be retained.

Use backoff to find the indispensable left edge

The baseline already shortens the right state. An initial word of the stored suffix can be removed if no explicit entry continues that suffix to the right and its backoff weight is 1. Under these conditions, the word can supply neither a longer match nor an extra penalty for the next word. The same test can be repeated after dropping it. Right minimization matters both as an existing technique and as a component of the paper’s method for detecting when a join no longer needs work.

Shortening the left side requires a different argument. The decoder is asking whether new context can ever change the entry used to score a word already in the fragment. A missing long sequence can still lead to additional backoff weights, so establishing that the same probability entry will be used is only part of the task. The authors show when those remaining weights can be handled without knowing the word that would otherwise occupy the end of left state.

An assumption makes this possible. The paper calls it the substring property.

If w₁ⁿ is stored, then wᵢʲ is stored for every 1 ≤ i ≤ j ≤ n.

Here w₁ⁿ is a stored sequence of length n, and wᵢʲ is the contiguous sequence from i through j inside it. The bounds cover every nonempty substring, including a prefix or suffix and the original sequence itself. The reasoning uses the property in reverse: when a required substring is absent, no explicit entry containing it can be present.

In an unpruned language model, extracting a sequence from the training corpus also supplies its substrings. Pruning can break that property. The authors report that SRILM pruning does so, and they restore the missing entries before relying on substring closure. The restored probabilities are assigned according to the ordinary backoff calculation, preserving the probabilities returned by the language model. Under the default pruning configuration, the paper reports that this preparation usually adds 1.4% more n-grams. The entries are needed because the minimization rule reasons about presence and absence in the stored data as well as about probabilities.

The backoff calculation starts with the longest admissible history. When the full sequence ending at the predicted word has no entry, the query looks for a shorter suffix ending at that same word. Dropping a word from the history can introduce a weight associated with the context being dropped. The stored probability at the eventual match is multiplied by the weights encountered on the way.

p(wₙ | w₁ⁿ⁻¹) = p(wₙ | wբⁿ⁻¹) ∏ᵢ₌₁ᶠ⁻¹ b(wᵢⁿ⁻¹), where բ = f

Here wₙ is the predicted word, w₁ⁿ⁻¹ is its requested history, and f is the starting position of the longest stored sequence ending in wₙ. The lower index բ in the probability term denotes f, so wբⁿ⁻¹ is the history of the stored match. p(wₙ | wբⁿ⁻¹) is the probability taken from that match. b is the backoff weight assigned to a history. The product over i applies the weights for the histories passed over before arriving at the match. When the language model has no entry for a backoff history, the paper uses a weight of 1.

Now take the final word of a prefix that might appear in left state. Suppose there is no word that can be put immediately before that prefix to obtain a stored entry. Then no longer preceding context can give a stored entry ending at the same final word either. Such an entry would contain a one-word left extension as a substring, which would have to be stored. The query with new left context therefore backs off to the same internal match as the query made when the fragment stood alone.

p(wₙ | wⱼⁿ⁻¹) / p(wₙ | w₁ⁿ⁻¹) = ∏ᵢ₌ₘ⁰ b(wᵢⁿ⁻¹), with m = max{j, n − N + 1}

Here wₙ ends the prefix being tested. wⱼⁿ⁻¹ is the requested history with newly available preceding words beginning at j, and w₁ⁿ⁻¹ is the original within-fragment history. p denotes the associated conditional probabilities. In the product, b is a backoff weight, i is the start of each extra history, and m clips the start to the earliest usable position under order N. Position 0 is the last word before the join. The ratio applies when no one-word left extension of w₁ⁿ is stored. The matching probability and the weights for histories entirely inside the following fragment cancel between the numerator and denominator.

The histories in the surviving product end before wₙ. The final word can consequently disappear from left state without losing information needed for its correction. The data structure can establish the required absence in either of two situations. If the prefix itself has no entry, the substring property excludes all of its left extensions. If the prefix does have an entry, the query needs to know whether that entry has any extension to the left. The ability to report the matched order handles the first situation, and information about the available extensions handles the second.

The test can be repeated on the shortened prefix. At first this seems to require retaining every word just before a discarded one, since the first omitted word’s correction can depend on its preceding history. The recursive argument removes that requirement. If the preceding word also qualifies for removal, then the prefix that ends at that word cannot have an explicit extension across the boundary. The histories crossing the boundary that would have supplied a backoff weight for the later word are therefore absent. They contribute 1. The decoder can keep shortening the prefix until a word must stay, and can account for the remaining boundary backoff using the information still present.

Record whether the left state covers the fragment

The same retained prefix can represent fragments with different scoring obligations. One possibility is that the prefix contains every word of a short fragment. The other is that the fragment has words beyond the prefix. The first possibility has no omitted word for which to charge the extra backoff contribution. The second can have a word whose identity has been dropped but whose contextual penalty remains to be accounted for.

The paper calls these cases small and large and puts a flag in the state. Small in this sense refers to a short fragment whose state has retained its complete text. A fragment can be large in the sense used by the algorithm because its text extends beyond the boundary window or because minimization removed a word. Thus a short fragment that would have fit in the original window can still have the large flag. A decoder that knew only the length of the retained prefix could confuse the two cases.

The flag is a way to remember a scoring obligation without keeping the word that gave rise to it. The proposition about backoff establishes that the obligation depends on context. The flag tells the decoder whether there is an omitted continuation to which that reasoning applies. This is what allows the authors to minimize short fragments as well as the long fragments covered by the earlier approach. It also matters when comparing states for recombination, since the same prefix with a different flag need not receive the same adjustment.

Store a route into the language-model data

Even when a word must be kept in left state, representing it by its vocabulary identifier leaves work to be done at the next join. A reverse trie stores sequences so that a query begins at the predicted word and proceeds back through its history. Looking up a long sequence can mean visiting several shorter suffixes before reaching the relevant record. When the decoder built the following fragment, it already obtained the records for its retained prefixes. Those records can serve as starting points when the fragment is used later.

The paper writes the same correction used at a join in terms of its per-position ratios. These are the units the revised interface needs to return.

p(wᵢ | wₘⁱ⁻¹) / p(wᵢ | w₁ⁱ⁻¹), with m = max{j, i − N + 1}

Here i is the position whose contribution is being updated, and wᵢ is the word at that position. p gives the conditional probability under the updated history in the numerator and the original history in the denominator. j is the start of the available preceding suffix, N is the language-model order, and m is the earliest index the updated query may use. Multiplying these terms yields the correction. The paper repeats that product when it describes encoding and again when it describes early exit.

For each retained prefix, the stored reference gives the query direct access to the entry for that prefix. In a reverse trie, the entry exposes the block of extensions that add the preceding word. Further extensions can lead farther to the left. A query can start at the known prefix and test the new context there, skipping the traversal it would otherwise have made from the final word to that prefix. The entry also supplies what is needed to retrieve the original term for the ratio.

({d(w₁ⁱ)}ᵢ₌₁ᵏ, flag)

Here d maps a stored word sequence to its data-structure reference, w₁ⁱ is the retained prefix ending at position i, and k is the number of retained words. The braces denote the collection of references at those positions. flag records whether an omitted part of the fragment calls for backoff accounting. If no words are retained, the collection is empty and the flag still carries its information.

Every reference in that representation is valid. If the longest retained prefix were absent, the test for omission would have removed its final word. All shorter retained prefixes are substrings of that longest one, so they are present as well. During a state comparison, the length, the flag, and the reference for the longest prefix suffice for the left side. The longest prefix determines its shorter prefixes. In implementations where a reference is an index into an array for a particular order, that index needs the order to identify the record. The reference’s position in the state supplies it.

The authors considered saving still more information about each prefix so that later queries could skip visiting its record too. This would require storing the prefix probability and the bounds of its block of left extensions. In the trie, the end of the block is obtained from the next entry’s pointer. The paper gives a storage cost of 20 bytes per word for keeping those details, compared with 8 bytes per word for the chosen left-state encoding. Saving the reference leaves a visit to the prefix record and reuses the storage already dedicated to the probability and the extension block.

KenLM’s trie already represents left extensions through its structure. The probing representation uses a hash table to retrieve the probability and backoff information for a sequence. For that representation, extension information can be determined while building the language model and stored with the entry. The paper reuses the otherwise constant probability sign bit for the left-extension indication. KenLM already indicates whether an entry extends to the right by using a special backoff value where the ordinary backoff is zero in its stored representation. It also reports the matched order. Together, these details let a scoring call return information that the decoder would otherwise have to obtain through further searches.

End the correction when the preceding context drops out

A join can be evaluated by moving through the following fragment’s retained prefix from left to right. After each incoming word, the decoder can update the temporary right state describing which words may still matter to the next query. The right-state minimization already used by the baseline applies to this intermediate state too. Eventually the state may cease to include any word from the preceding fragment. At that point, the remaining per-word queries behave as they would with only the following fragment’s own history.

p(wᵢ | wₘⁱ⁻¹) / p(wᵢ | w₁ⁱ⁻¹) = 1 for i > t, with m = max{j, i − N + 1}

Here t is the iteration after which the updated right state no longer encodes words from before the join. i indexes a later word in the retained prefix, j begins the available preceding suffix, and N bounds the history. m is the clipped start for the updated query. The numerator and denominator are conditional probabilities for wᵢ. Their ratio is 1 once the preceding fragment can no longer affect the query.

This stopping condition concerns the relative score. In the baseline implementation described by the authors, the provisional prefix score was commonly stored as a single denominator.

∏ᵢ₌₁ᵏ p(wᵢ | w₁ⁱ⁻¹)

Here k is the length of the provisional prefix, i indexes its words, and p(wᵢ | w₁ⁱ⁻¹) is the original probability of the word at i given the part of the prefix that precedes it. The product represents all the provisional terms together. If the decoder computes an updated numerator separately, stopping before the last word leaves the denominator still accounting for the skipped words.

Returning a ratio for each queried word makes it possible to stop as soon as all further ratios are known to be neutral. The state need not store the whole denominator or a separate probability for every position. The direct references support access to the needed terms as the query advances. The flag continues to distinguish whether backoff must be accounted for beyond the retained prefix. Thus the representation supports the scoring rule and the stopping rule through the same join, while the suffix state supplies the evidence that the influence of the preceding fragment has ended.

Prepare the translation systems and their scoring data

The experiments use translation systems built with the normal Moses pipeline and constrained data for their evaluations. The target-syntax systems use the Collins parser to analyze the target side of the training material. These target analyses are part of building the translation systems. The paper’s change takes place later, in the representation and scoring of hypotheses during decoding.

The target-language scoring data were built with SRILM using order N = 5, modified Kneser-Ney smoothing, and default pruning. Different systems used different target-language collections, described with their test sets below. The method preserves the scoring probabilities when adding entries needed for substring closure. It changes what the decoder and language-model data structure can infer from those entries, what the decoder carries forward in state, and what it needs to look up at a join.

Experiments and results

Translation directions and test sets

The authors modified and instrumented the Moses chart decoder. The experiments span five systems in three translation directions. A hierarchical system builds translations under a hierarchy of rules. A target-syntax system uses syntax on the output side. The paper reports both kinds of system for the German and English directions, and a hierarchical system for Chinese to English. These settings give several places to check whether shorter left state and cheaper scoring help within the same bottom-up decoding framework. Moses translation framework

The Chinese-to-English hierarchical system was trained on 2.1 million parallel news sentences. For English scoring, it pools estimates drawn from the Xinhua and AFP sections of version 4 of English Gigaword and from the English half of the parallel material. The 2008 NIST evaluation supplied the 1,357 sentences in the test set. The system description gives an uncased BLEU score of 29.63%, which the tradeoff experiment identifies for the baseline at its stated pop limit.

For German to English, the hierarchical and target-syntax systems extract their rules from Europarl. Their English language scoring combines Europarl, news commentary, and monolingual news supplied for the Workshop on Machine Translation. The paper uses the official 3003-sentence test set. It reports BLEU of 21.10% for the hierarchical system and 20.14% for the system with target-side syntax. These are scores of the systems described for the experiments.

In the reverse direction, the hierarchical and target-syntax systems were also trained on Europarl. Their German language scoring uses the monolingual German data from the 2011 Workshop on Machine Translation, including Europarl, news commentary, and the news material released by year. The same 3003 sentences are translated in the opposite direction. The reported uncased BLEU scores are 14.95% for the hierarchical system and 14.69% for the target-syntax system. Findings of the 2011 Workshop on Statistical Machine Translation

The comparison baseline in the primary speed discussion includes right-state minimization. It gives the new left-state handling an established form of suffix optimization to build on. In the controlled comparison of objective scores, the authors also run configurations with neither, either, and both edges minimized. That wider comparison identifies the contribution of each side. When reading the timing result, the baseline to keep in view is the one with right minimization already enabled.

What the metrics measure

The search objective is the weighted sum of a translation’s feature values. It combines the language score with the other features the decoder uses to rank candidates. The authors report averages of the objective scores of the best translations returned. Higher is better within a system and a fixed scoring setup. The paper notes that the scores have a scale and include a term reflecting translation difficulty, which makes their absolute values difficult to interpret. The comparisons use changes within each system, where the objective being searched is held fixed.

BLEU measures translation output against references and serves in the paper as a proxy for translation quality. Uncased BLEU is used in the headline Chinese-to-English comparison. CPU seconds per sentence express the computational time spent by the decoder, including user and system CPU time. At a fixed pop limit, a speed change shows how much less CPU work is needed under that allowance. With the allowance varied, CPU time and objective score together show what the decoder can achieve under different amounts of work. BLEU evaluation method

The paper also counts intermediate events. A pop is a rule application taken for evaluation. A language-model query computes a scoring contribution and can require several visits to entries in the underlying data structure. The authors report numbers of pops, queries, and lookups because changes can affect them differently. A ratio returned for a retained prefix, for instance, is still a query even when the data structure begins from a saved entry and avoids visits to shorter sequences.

Where the time goes

On the 1357-sentence Chinese-to-English test set at a pop limit of 1000, the baseline makes 760,788,076 pops. With left state minimization enabled, the reported count is 761,124,349. Both runs have the same maximum per constituent. The measured total shows that the faster condition did not achieve its speed by taking fewer pops in that comparison. Savings within the evaluations matter because each pop can require scoring terminals and joining nonterminal values.

The authors report a 30% reduction in queries from left-state minimization and early exit. Minimization can reduce how many words a nonterminal presents for correction. Early exit can then remove queries from the retained prefix once the temporary state shows that the preceding fragment has lost influence. For the queries that remain, the saved prefix references cut down the work of reaching the relevant records. The lookup counts therefore reflect the effect of fewer queries together with faster routes for some of those that still run.

Unigram data-structure lookups on the Chinese-to-English test set

The optimized decoder makes substantially fewer lookups at the shortest order.

Unigram data-structure lookups on the Chinese-to-English test setBaseline: 3,709,029,243Baseline3,709,029,243Pointer-based left-state handling (this paper): 1,988,280,862Pointer-based left-state handling (thispaper)1,988,280,862
The numbers
System or settingUnigram lookups
Baseline3,709,029,243
Pointer-based left-state handling (this paper)1,988,280,862

On the Chinese-to-English test set, the paper reports a 46% reduction in unigram lookups and a 35% reduction in bigram lookups. The corresponding reductions for trigrams and four-word sequences are 30% and 24%. For sequences at the highest order, the reported reduction is 7%. This pattern fits the role of the saved references. Starting from an already identified prefix skips many visits to lower-order entries on the way to a cross-boundary lookup. Opportunities to skip those visits are more common than opportunities to remove the longest lookup itself.

Across all five test systems, CPU time falls by 3-6%. When the authors vary the pop limit to 50, 100, 200, 500, and 1000, the relative reduction still falls in that range. The magnitude of the time saving is smaller than the lookup reductions. The paper observes that many avoided accesses revisit entries used recently, so they are likely to be served by hardware caches. Counting a saved lookup treats it as one fewer operation regardless of how little time a cached visit would have taken.

Spending the search gain on speed

The Chinese-to-English tradeoff experiment varies the pop limit and examines average objective score as a function of CPU time. This gives the score improvements a practical interpretation. If the decoder can recover an objective score at least as good as the baseline with a lower cap, there is a speed benefit from reducing the search allowance as well as from making individual joins cheaper. The comparison starts from the baseline operating point and finds a nearby score under the revised decoding procedure.

CPU time at comparable objective scores on the Chinese-to-English test set

Left-state minimization reaches a slightly higher average objective score using less CPU time.

CPU time at comparable objective scores on the Chinese-to-English test setBaseline, pop limit 1000: 19.6Baseline, pop limit 100019.6Left-state minimization, pop limit 910 (this paper): 17.3Left-state minimization, pop limit 910(this paper)17.3
The numbers
System or settingCPU seconds per sentence
Baseline, pop limit 100019.6
Left-state minimization, pop limit 910 (this paper)17.3

At a pop limit of 1000, the baseline reaches an average objective score of -82.5368. With left-state minimization and a pop limit of 910, the score is -82.5367. The latter is slightly higher. The CPU times in the chart represent the reported 11% net reduction on this test. The score is close enough to the baseline to make the timing comparison about reaching nearly the same objective level under the two settings.

The accompanying uncased BLEU figures are 29.63% at the baseline point and 29.67% at the faster point. The authors call the latter result insignificantly better. This check is relevant because a decoder’s objective and reference-based evaluation measure different things. Here the authors alter the amount of search to obtain a speed result while reporting what happened to BLEU for the selected settings.

The paper reports a small memory saving of about 1% across the tested systems at the same pop limit, which it attributes to the new representation being more efficient than Moses’s existing state handling. It also reports no increase in language-model storage size for representing left-extension information. The trie already represents those extensions, and probing uses the repurposed bit. This storage observation concerns the implementation of extension information. Restoring substring entries after pruning is a separate part of preparing the data.

The timings were measured on a computer equipped with 32 cores and 64 GB of RAM. Both the grammar and the language model were converted to binary form before decoding, and the operating system’s disk cache was warmed with them before each run. The measured CPU time therefore describes the configured decoding runs instead of the work of building the scoring data or converting the input files.

What the ablations show

Left state gets shorter more often than right state

The Chinese-to-English state-length analysis uses a pop limit of 1000. The paper groups the hypotheses examined by the decoder according to the lengths of their left and right states. Among the hypotheses represented in the length table, which omits fragments shorter than 4 words, 19.2% of hypotheses have full-length left state and 29.5% have full-length right state. Full length in this experiment is 4 words. The paper reports that 2.2% of the hypotheses were excluded by that short-fragment cutoff. Its comparison is evidence about the boundary states commonly encountered in that search.

The decoder’s treatment of the sentence boundary contributes to the observed pattern. It uses a glue rule to assemble some hypotheses from left to right. When a hypothesis is bound to the beginning of the sentence, there can be no additional fragment to its left. In that situation, the decoder’s preexisting sentence-start logic already lets candidates recombine without agreeing on their initial words. Such hypotheses effectively have left state of length zero. The length histogram therefore includes effects of sentence position as well as opportunities created by checking for absent left extensions.

The authors also measure recombination directly. They enable minimization on both sides, record the highest-scoring fragment carried by each hypothesis, and compare those fragments whenever the hypotheses recombine. The comparison establishes which of the observed merges would have been licensed by the ordinary boundary records, the existing sentence-boundary special cases, or minimization of one or both edges. It addresses the concern that a shorter state distribution might partly reflect cases already covered by the decoder.

The average is 176,191 recombinations per sentence on that Chinese-to-English test at a pop limit of 1000. The ordinary agreement checks and sentence-boundary cases account for 101,409 (57%). Right minimization alone accounts for another 26,111 (15%). Left minimization accounts for 33,537 (19%) on its own, and 15,133 (9%) require minimization of both sides. In the observed merges, shortening the left record is therefore the larger source of additional equivalences. The count describes events in a search run with both changes enabled, so it also provides context for interpreting the separate runs that follow.

More recombination gives a smaller gain in the best score

The score comparison runs each combination of minimization settings at a pop limit of 1000. In hierarchical Chinese to English, the paper’s scores increase from neither edge minimized, through left only and right only, to both. The right-only setting obtains a higher score than the left-only setting, even though the instrumented search attributed more recombinations to the left side.

Average objective score by state minimization setting on hierarchical Chinese-to-English

Both edges minimized gives the highest score, and the right-only result exceeds the left-only result.

Average objective score by state minimization setting on hierarchical Chinese-to-EnglishNeither edge minimized: -82.5435Neither edge minimized-82.5435Left edge only: -82.5417Left edge only-82.5417Right edge only: -82.5368Right edge only-82.5368Both edges minimized (this paper): -82.5340Both edges minimized (this paper)-82.5340
The numbers
System or settingAverage objective score
Neither edge minimized-82.5435
Left edge only-82.5417
Right edge only-82.5368
Both edges minimized (this paper)-82.5340

The same ordering appears in the hierarchical German-to-English system. Its average objective score is -101.392 with neither change, -101.390 with left minimization, -101.388 with right minimization, and -101.387 with both. For hierarchical English to German, the corresponding scores are -79.2035, -79.2028, -79.1982, and -79.1972. Comparing the settings inside each system keeps the feature scale and test direction fixed.

The target-syntax systems show the same relative advantage for right minimization at the precision reported. For German to English, neither side and left only both display -104.244, right only gives -104.242, and both give -104.241. For English to German, the scores are -13.1425 with neither, -13.1415 with left only, -13.1389 with right only, and -13.1370 with both. These are objective scores on the respective 3003-sentence test sets at the same pop limit. The displayed tie in German to English should be read at the table’s stated precision.

Recombination changes an approximate search by letting one state represent more derivations. Its value for the best complete answer depends on which partial translations survive long enough to contribute. Merging many candidates that will receive unfavorable scores when attached to other fragments can have little effect on the final winner. A smaller number of recombinations among candidates that stay competitive can matter more. The paper pursues this distinction by measuring how provisional scores change at joins.

Left and right shortening have different implications at a join

The explanation starts with the information available when a fragment is scored. If its left state can be shortened, the omitted word cannot acquire a longer explicit match from new context. It can still receive backoff adjustments when the missing left context is supplied. That part of the adjustment remains uncharged while the preceding fragment is unknown. A short left state thus identifies many hypotheses whose provisional language scores can become less favorable when the decoder evaluates the full join.

At the right edge, most of the context within the fragment has already been seen at scoring time. Backoff costs arising in that part of the fragment have already entered its score. The right state carries what can still affect words added later. The paper identifies short fragments as an exception to the usual availability of history. The distinction is about the time at which evidence enters the provisional score. The two edges expose superficially similar opportunities to shorten a record, but they represent different roles in the conditional probabilities.

To inspect the effect, the authors group join corrections by the length of the preceding fragment’s right state, the length of the following fragment’s left state, and the following fragment’s small or large flag. They summarize corrections by their geometric mean, reported on a logarithmic scale. The language feature itself uses log probabilities, so an arithmetic mean in log space is natural for the analysis. Zero-length right state is omitted from the correction tables because it supplies no new context and its log correction is zero.

On the Chinese-to-English test set at a pop limit of 1000, the large-flag group with right state of length 4 has mean log correction -1.701 when the left state has length 0. With the same right-state length and left state of length 4, the mean is 0.037. At right-state length 1, the means at those left-state lengths are -0.741 and 0.220. Reading along a fixed right-state length holds the amount of retained history on that side constant. A shorter left record is associated with a less favorable correction in these comparisons.

The table also shows the tendency in the other direction. For large-flag hypotheses with left state of length 3, the mean log correction on Chinese to English is 0.007 at right-state length 1 and -0.314 at right-state length 4. A shorter right state frequently accompanies a more favorable correction. The separate small-flag results have their own range of possible left lengths because the flag means the state retains the whole short fragment. For example, at right-state length 4 the small-flag mean is -0.359 for left length 1 and -0.117 for left length 3. Reporting the groups separately keeps the differing backoff obligations visible.

The hierarchical German-to-English analysis checks the pattern in another direction. For large-flag hypotheses at right-state length 4, the mean log correction is -1.573 when left state has length 0 and 0.409 when it has length 4. The general association between short left state and less favorable corrections recurs. The right-state tendency has exceptions. At left-state length 4, for instance, the mean is 0.390 at right length 1 and 0.509 at right length 3. The paper treats state length as a predictor of likely behavior, with a pattern in the observed groups rather than a ranking rule for every join.

The correction analysis gives the recombination result a concrete interpretation. The candidates benefiting from left minimization are often among those whose language score will decline at concatenation. Some of the merges that expand the search’s capacity therefore involve hypotheses that later become easy to prune. Right-state minimization can have a bigger effect on the highest-scoring output in spite of accounting for fewer merges. This connects the state representation to the distribution of score revisions the decoder faces.

Which speed improvements the comparisons isolate

The query count isolates a joint effect of shrinking left state and exiting early. It establishes how many scoring calls those changes jointly avoid. The lookup counts add the effect of starting from saved entries. They show fewer visits at every order reported, especially the lower orders a reverse-trie query would ordinarily traverse first. The paper does not give a separate CPU time for each of the individual changes, so the total CPU reduction is evidence for the implementation as used together.

There is also a control for restoring substrings after pruning. The authors run the 1357-sentence Chinese-to-English test once with the added entries and once without them. Right minimization is enabled in both cases, and left minimization is disabled because it requires the substring property. The single-best outputs and their objective scores are identical across these runs. This checks an experimental concern beyond preserving the probability of any individual query. Entries can affect what the decoder knows about state equivalence, and the control asks whether the particular restoration step visibly changed the baseline’s best outputs on that test.

The authors additionally report limited trials without pruning. The primary relative finding about objective score, that left minimization has a smaller effect than right minimization, still holds in those trials. This supports looking to the timing of backoff corrections for an explanation. The detailed lookup and timing measurements remain tied to the experimental preparation described above.

Limitations

Limits identified by the authors

The paper sets out to improve bottom-up decoding. It discusses left-to-right methods and cube growing to establish how the search organization relates to state, and its experiments use cube pruning in the Moses chart decoder. The authors leave the comparative merits of different overall search strategies outside their study. Cube growing shares operations to which the proposed changes can apply, but the reported timing and score comparisons concern the implemented bottom-up setup.

Recombination creates a way to represent more possibilities with the same state information, but the authors explicitly caution that a higher best score is not guaranteed under a pop limit. Expanding a candidate that now survives can generate further candidates and change what the search prunes. It is possible for the revised search to remove a component of the translation the baseline would have chosen. The objective improvements in the tables are observed outcomes under the tested limits.

The method relies on the substring property and on access to information about stored matches and extensions. The authors handle pruning that violates the property by adding back entries with probabilities consistent with backoff. An implementation using an interface that provides only the probability, or provides only the order that matched, lacks part of the evidence for the full procedure. The paper describes concrete ways of getting that evidence in KenLM. It also demonstrates why an earlier implementation could have the theoretical state savings while being slower to run.

The authors identify delayed backoff as a source of bias in the provisional scores used at joins. Their implementation accounts for the required corrections during concatenation. They propose investigating rest costs in future work to address the bias in advance. A rest cost would estimate a scoring contribution still to come. The paper provides observations about the bias and its direction in the tested groups, with the proposed remedy left for subsequent study.

The headline quality comparison uses BLEU as a proxy, and the authors describe its change at the faster setting as insignificant. The reported benefit at that operating point is reaching nearly the same average search objective with less CPU time. The BLEU figures supply an accompanying check on the outputs under those settings.

Limits visible in the experimental design

The 11% reduction is measured at a selected pair of operating points on the Chinese-to-English test set. The authors report a smaller 3-6% range across the five systems at fixed search allowances. These claims answer different questions. The broader result concerns the efficiency of the modified work under the same cap. The Chinese-to-English result includes the benefit of lowering that cap while attaining a comparable score. The paper leaves open how much of the second benefit each other system would yield after separately adjusting its limit.

The experiments use finite-order backoff scoring with sparse stored sequences. The proof for removing a word depends on how the query selects its longest match and on how extra context affects the remaining product of weights. It therefore establishes the omission rule for the scoring procedure analyzed. Translation scoring with different context dependencies would require its own equivalence criterion. Even within the paper’s setting, the amount that can be omitted depends on the sequences available in the scoring data and on which fragments reach the decoder.

The correction tables describe average behavior in groups produced by the search. They do not follow every merge through to a particular final translation or experimentally move the delayed penalty earlier while keeping the rest of the search fixed. The analysis links the score patterns to the backoff equations and checks them in Chinese to English and hierarchical German to English. It supports the explanation while leaving the exact effect of changing provisional ranking to a further experiment.

The code measurements reflect the time to decode with the grammar and language model already in binary form and the operating system cache prepared. The mix of repeated queries and cached records helps determine the cost of the operations being removed. Other memory or cache behavior could change the time saving associated with the same lookup counts. The paper gives the proportions of work avoided and the timings for its setup, which lets a reader distinguish those pieces of evidence.

The study reports average scores of returned translations and BLEU at particular settings. An average improvement in the objective does not establish that every sentence improved or that the decoder recovered the highest possible score for each sentence. The search is still limited and approximate. The separate use of BLEU for the speed tradeoff also leaves the evidence about quality concentrated in that Chinese-to-English comparison. The main contribution is to the cost and behavior of the search that produces those outputs.

What came after

The paper reports that the implementation was released in KenLM under the LGPL. It also reports that Moses and cdec were already using the functionality, although the measured experiments were carried out with Moses. This records a concrete transfer of the implementation beyond the decoder instrumented for the study. The reusable part is the language-model interface for identifying extendable prefixes, keeping references to relevant entries, and making the relative scoring operations available to a decoder. KenLM · cdec

A later citing work is Travatar, a forest-to-string machine translation engine based on tree transducers. Its task places the citation in a related setting where structured input is translated into a target string. The citation establishes the connection to this paper. The specific details of any left-state representation, early-exit procedure, or performance effect in Travatar are unspecified here. The evidence for code use is explicit for Moses and cdec, while the later Travatar record establishes a citation from another syntax-based translation system. Travatar

Cite

Cite as Kenneth Heafield, Hieu Hoang, Philipp Koehn, Tetsuo Kiso and Marcello Federico. 2011. Left language model state for syntactic machine translation. Proceedings of the 8th International Workshop on Spoken Language Translation: Evaluation Campaign.

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

@inproceedings{heafield2011left,
  title = {{Left language model state for syntactic machine translation}},
  author = {Kenneth Heafield, Hieu Hoang, Philipp Koehn, Tetsuo Kiso and Marcello Federico},
  booktitle = {Proceedings of the 8th International Workshop on Spoken Language Translation: Evaluation Campaign},
  year = {2011},
  url = {https://aclanthology.org/2011.iwslt-evaluation.24/}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/heafield-2011-left-language-model-state-syntactic/