Algorithm Search⌘K

Modeladvanced

Inversion transduction grammar

Also called ITG.

Wu's synchronous grammar in binary normal form whose rules keep or invert the order of two children, biparsing a sentence pair in time cubic in each sentence length.

An inversion transduction grammar (ITG) is a synchronous context-free grammar whose rules have at most two children, and each binary rule either keeps the order of its children on the target side (a straight rule) or reverses it (an inverted rule). Wu (1997) showed that every ITG has a normal form like Chomsky normal form, and that the best joint parse of a source sentence of mm words and a target sentence of ll words can be found in O(m3l3)O(m^3 l^3) time, which gives a word alignment and a bracketing of both sentences together. The reorderings an ITG can produce are exactly the separable permutations: all orders for up to three words, and 22 of the 24 orders of four words.

The machine

Direction and notation. The source is f=f1…fmf = f_1 \ldots f_m and the target e=e1…ele = e_1 \ldots e_l. Spans are fencepost: (s,t)(s, t) covers fs+1…ftf_{s+1} \ldots f_t and (u,v)(u, v) covers eu+1…eve_{u+1} \ldots e_v. Probabilities are multiplied, or their natural logs added.

Rules in normal form. With nonterminals X,Y,ZX, Y, Z, a source word xx and a target word yy:

rule written source side target side
straight X→[Y  Z]X \to [Y \; Z] Y  ZY \; Z Y  ZY \; Z
inverted X→⟨Y  Z⟩X \to \langle Y \; Z \rangle Y  ZY \; Z Z  YZ \; Y
word pair X→x/yX \to x / y xx yy
source word only X→x/εX \to x / \varepsilon xx nothing
target word only X→ε/yX \to \varepsilon / y nothing yy

A stochastic ITG gives each rule a probability, with the rules of each left side summing to 1. The bracketing ITG has one nonterminal AA and only the rules A→[A A]A \to [A \, A], A→⟨A A⟩A \to \langle A \, A \rangle and the word rules; it knows no syntax and only constrains which reorderings are possible.

Reachable orders. Consider one-to-one translations, where target word kk translates source word π(k)\pi(k). A tree of straight and inverted nodes produces π\pi exactly when π\pi can be built by splitting the source into two adjacent blocks whose translations are also adjacent, in the same or the reverse order, and splitting each block again, down to single words. Such permutations are called separable.

Example. For four words, the target order 2 1 4 3 comes from [⟨1 2⟩ ⟨3 4⟩][\langle 1 \, 2 \rangle \, \langle 3 \, 4 \rangle]: two inverted pairs side by side. The order 2 4 1 3 has no first split. Cutting the source after word 1 leaves the words 2, 3, 4 at the target positions 1, 4 and 2, which are not adjacent; cutting after word 2 puts the words 1 and 2 at the target positions 3 and 1; cutting after word 3 puts the words 1, 2 and 3 at the positions 3, 1 and 4. So no ITG derivation gives this order, and the same holds for 3 1 4 2. The orders 2 4 1 3 and 3 1 4 2 are the inside-out alignments, which occur in real data but rarely.

What it counts

The model counts derivations, each with a probability, and the main computation is biparsing: the best (or the total) probability of a derivation that yields ff and ee together. Let β(X,s,t,u,v)\beta(X, s, t, u, v) be the best probability that XX derives the source span (s,t)(s, t) and the target span (u,v)(u, v). Then

β(X,s,t,u,v)=max⁡{max⁡X→[YZ], S, Up β(Y,s,S,u,U) β(Z,S,t,U,v),  max⁡X→⟨YZ⟩, S, Up β(Y,s,S,U,v) β(Z,S,t,u,U)},\beta(X, s, t, u, v) = \max \Big\{ \max_{X \to [Y Z],\, S,\, U} p \, \beta(Y, s, S, u, U) \, \beta(Z, S, t, U, v), \; \max_{X \to \langle Y Z \rangle,\, S,\, U} p \, \beta(Y, s, S, U, v) \, \beta(Z, S, t, u, U) \Big\},

with s≤S≤ts \le S \le t and u≤U≤vu \le U \le v, the word rules as base cases, and the answer β(S,0,m,0,l)\beta(S, 0, m, 0, l). In the straight case YY takes the left parts of both spans; in the inverted case YY takes the left source part and the right target part. There are O(m2l2∣N∣)O(m^2 l^2 |N|) items, each with O(ml)O(m l) split pairs and O(∣N∣2)O(|N|^2) rules, so the time is O(m3l3∣N∣3)O(m^3 l^3 |N|^3) and the space O(m2l2∣N∣)O(m^2 l^2 |N|) on the word RAM. For the bracketing ITG, ∣N∣=1|N| = 1 and the time is O(m3l3)O(m^3 l^3), which is O(n6)O(n^6) when both sentences have nn words. Replacing max by sum gives the inside probabilities, and with the outside probabilities the inside-outside algorithm trains a stochastic ITG by expectation maximization.

For translation, the target is unknown. Parsing only the source with the source side of the grammar costs O(m3)O(m^3) times the grammar size, as in CKY; an n-gram language model on the target makes each item also hold the boundary words of its target string, which keeps decoding polynomial for a fixed vocabulary but much slower.

Relation to other models

  • Synchronous CFG. An ITG is an SCFG of rank 2 in normal form. Wu (1997) showed that an ITG with longer straight and inverted rules can be put in this normal form, and rank 3 SCFGs give no new translations, so the rank 2 SCFGs and the ITGs describe the same translations.
  • Hiero. Hierarchical phrase-based rules have up to two nonterminals, so Hiero is a rank 2 SCFG, but its rules carry whole phrases around the gaps and are learned from data instead of being binary word-level rules.
  • Phrase-based reordering. In a stack decoder, the ITG constraint allows a phrase order only if it is separable. The lexicalized reordering model has the same two basic classes, monotone and swap, but only for neighbouring phrases.
  • Word alignment models. The IBM models and the HMM model allow any alignment. A bracketing ITG restricts the alignment to separable structure, which excludes the inside-out patterns but also many bad alignments.
  • Monolingual parsing. With an empty target side, the biparsing program becomes the CKY program for one sentence; the extra factors l3l^3 come from the second sentence.

Known results in the model

  • Separable permutations (theorem). The one-to-one orders an ITG produces are the separable permutations, which are the permutations that contain neither 2 4 1 3 nor 3 1 4 2 as a pattern (Bose, Buss and Lubiw 1998).
  • Their count (theorem). For n=1,…,6n = 1, \ldots, 6 words there are 1, 2, 6, 22, 90 and 394 separable permutations, the large Schröder numbers, out of n!=1,2,6,24,120,720n! = 1, 2, 6, 24, 120, 720. The large Schröder numbers grow like cnc^n times a power of nn with c=3+22≈5.83c = 3 + 2\sqrt 2 \approx 5.83, while n!n! grows faster than any cnc^n, so the fraction of all orders that an ITG can produce goes to 0 as nn grows.
  • Spurious ambiguity (theorem). Different trees can give the same order. For three words there are 2 tree shapes, each with 4 labelings of its two inner nodes as straight or inverted, so 8 trees but only 6 orders: [[1 2] 3][[1\,2]\,3] and [1 [2 3]][1\,[2\,3]] both give 1 2 3. A normal form that prefers one branching direction for nodes of the same kind removes this ambiguity, which matters when counting or summing over derivations.
  • Biparsing in O(m3l3)O(m^3 l^3) (theorem). By the program above. For general SCFGs of unbounded rank the problem is NP-hard (see the SCFG page).
  • Coverage (measurement). Studies of hand-aligned parallel text found that the separable orders cover most of the reordering for the language pairs studied, and that the inside-out patterns are real but rare.
  • Decoding constraint (measurement). Zens and Ney (2003) compared the ITG constraint with other reordering constraints for word-based decoding and found that it covered the reordering in their data better than the IBM constraints.

References

  1. Wu 1997, the straight and inverted rules, the normal form, the stochastic model, the biparsing algorithm and the reorderings an ITG can express
  2. Bose, Buss and Lubiw 1998, separable permutations and their characterization as the permutations that avoid the patterns 2413 and 3142

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/8BXTRR/text.yaml