1 / 92

Simpler & More General Minimization for Weighted Finite-State Automata

Simpler & More General Minimization for Weighted Finite-State Automata. Jason Eisner Johns Hopkins University May 28, 2003 — HLT-NAACL. First half of talk is setup - reviews past work. Second half gives outline of the new results. a. b. a. b. a. b. b. b.

Download Presentation

Simpler & More General Minimization for Weighted Finite-State Automata

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Simpler & More General Minimizationfor Weighted Finite-State Automata Jason EisnerJohns Hopkins University May 28, 2003 — HLT-NAACL First half of talk is setup - reviews past work. Second half gives outline of the new results.

  2. a b a b a b b b The Minimization Problem Input: A DFA (deterministic finite-state automaton) Output: An equiv. DFA with as few states as possible Complexity: O(|arcs| log |states|) (Hopcroft 1971) Represents the language {aab, abb, bab, bbb}

  3. a b a b a b b b The Minimization Problem Input: A DFA (deterministic finite-state automaton) Output: An equiv. DFA with as few states as possible Complexity: O(|arcs| log |states|) (Hopcroft 1971) Represents the language {aab, abb, bab, bbb}

  4. The Minimization Problem Input: A DFA (deterministic finite-state automaton) Output: An equiv. DFA with as few states as possible Complexity: O(|arcs| log |states|) (Hopcroft 1971) a b a b a b b b Represents the language {aab, abb, bab, bbb}

  5. The Minimization Problem Input: A DFA (deterministic finite-state automaton) Output: An equiv. DFA with as few states as possible Complexity: O(|arcs| log |states|) (Hopcroft 1971) a b a b a b b Represents the language {aab, abb, bab, bbb}

  6. The Minimization Problem Input: A DFA (deterministic finite-state automaton) Output: An equiv. DFA with as few states as possible Complexity: O(|arcs| log |states|) (Hopcroft 1971) a b a b a b b Represents the language {aab, abb, bab, bbb}

  7. The Minimization Problem Input: A DFA (deterministic finite-state automaton) Output: An equiv. DFA with as few states as possible Complexity: O(|arcs| log |states|) (Hopcroft 1971) a b a b b Can’t always work backward from final state like this. A bit more complicated because of cycles. Don’t worry about it for this talk.

  8. a b a b a b b b Mergeable because they have the same suffix language: {ab,bb} Mergeable because they have the same suffix language: {b} The Minimization Problem Input: A DFA (deterministic finite-state automaton) Output: An equiv. DFA with as few states as possible Complexity: O(|arcs| log |states|) (Hopcroft 1971) Here’s what you should worry about: An equivalence relation on states … merge the equivalence classes

  9. The Minimization Problem Input: A DFA (deterministic finite-state automaton) Output: An equiv. DFA with as few states as possible Complexity: O(|arcs| log |states|) (Hopcroft 1971) Q: Why minimize # states, rather than # arcs? A: Minimizing # states also minimizes # arcs! Q: What if the input is an NDFA (nondeterministic)? A: Determinize it first. (could yield exponential blowup ) Q: How about minimizing an NDFA to an NDFA? A: Yes, could be exponentially smaller ,but problem is PSPACE-complete so we don’t try. 

  10. b:0.3 a:0.2 d:1 c:0.7 b:3 a:2 d:0 c:7 b:wx a:w d: c:wz Real-World NLP:Automata With Weights or Outputs • Finite-state computation of functions • Concatenate strings • Add scores • Multiply probabilities abd wwx acd wwz abd 5 acd 9 abd 0.06 acd 0.14

  11. Real-World NLP:Automata With Weights or Outputs • Want to compute functions on strings: * K • After all, we’re doing language and speech! • Finite-state machines can often do the job • Easy to build, easy to combine, run fast • Build them with weighted regular expressions • To clean up the resulting DFA, minimize it to merge redundant portions • This smaller machine is faster to intersect/compose • More likely to fit on a hand-held device • More likely to fit into cache memory

  12. Real-World NLP:Automata With Weights or Outputs • Want to compute functions on strings: * K • After all, we’re doing language and speech! • Finite-state machines can often do the job How do we minimize such DFAs? • Didn’t Mohri already answer this question? • Only for special cases of the output set K! • Is there a general recipe? • What new algorithms can we cook with it?

  13. Finite-state computation of functions • Concatenate strings • Add scores • Multiply probabilities b:0.3 abd wxx acd wzz a:0.2 d:1 c:0.7 b:3 abd 5 acd 9 a:2 d:0 c:7 b:wx a:w d: abd 0.06 acd 0.14 c:wz Weight Algebras • Specify a weight algebra (K,) • Define DFAs over (K,) • Arcs have weights in set K • A path’s weight is also in K: multiply its arc weights with  • Examples: • (strings, concatenation) • (scores, addition) • (probabilities, multiplication) • (score vectors, addition) • (real weights, multiplication) • (objective func & gradient, product-rule multiplication) • (bit vectors, conjunction) OT phonology conditional random fields, rational kernels training the parameters of a model membership in multiple languages at once

  14. b:0.3 a:0.2 d:1 c:0.7 b:3 a:2 d:0 c:7 b:wx a:w d: c:wz Weight Algebras • Finite-state computation of functions • Concatenate strings • Add scores • Multiply probabilities • Specify a weight algebra (K,) • Define DFAs over (K,) • Arcs have weights in set K • A path’s weight is also in K: multiply its arc weights with  • Q: Semiring is (K,,). Why aren’t you talking about  too? • A: Minimization is about DFAs. • At most one path per input. • So no need to  the weights of multiple accepting paths. abd wxx acd wzz abd 5 acd 9 abd 0.06 acd 0.14

  15. Shifting Outputs Along Paths • Doesn’t change the function computed: b: wx abd wwx acd wwz a:w d: c: wz

  16. Shifting Outputs Along Paths • Doesn’t change the function computed: b: x abd wwx acd wwz a:ww d: c: z

  17. Shifting Outputs Along Paths • Doesn’t change the function computed: b: wx abd wwx acd wwz a:w d: c: wz

  18. Shifting Outputs Along Paths • Doesn’t change the function computed: b: wwx abd wwx acd wwz a: d: c: wwz

  19. Shifting Outputs Along Paths • Doesn’t change the function computed: b: wx abd wwx acd wwz a:w d: c: wz

  20. b:3 abd 5 acd 9 a:2 d:0 c:7 Shifting Outputs Along Paths • Doesn’t change the function computed:

  21. b:3-1 abd 5 acd 9 a:2+1 d:0 2 3 c:7-1 6 Shifting Outputs Along Paths • Doesn’t change the function computed:

  22. b:3-2 abd 5 acd 9 a:2+2 d:0 c:7-2 Shifting Outputs Along Paths • Doesn’t change the function computed: 1 4 5

  23. b:3-3 abd 5 acd 9 a:2+3 d:0 c:7-3 Shifting Outputs Along Paths • Doesn’t change the function computed: 0 5 4

  24. …ebd uwx …ecd uwz e:u Shifting Outputs Along Paths b: wx abd wwx acd wwz a:w d: c: wz

  25. e:u Shifting Outputs Along Paths • State sucks back a prefix from its out-arcs b: x abd wwx acd wwz a:w d: w c: z …ebd uwx …ecd uwz

  26. e:uw Shifting Outputs Along Paths • State sucks back a prefix from its out-arcsand deposits it at end of its in-arcs. b: x abd wwx acd wwz a:ww d: c: z …ebd uwx …ecd uwz

  27. e:u Shifting Outputs Along Paths b: x abd wwx acd wwz a:w d: w c: z …ebd uwx …ecd uwz

  28. b: wx e:u …abnbd u(wx)nwx …abncd u(wx)nwz Shifting Outputs Along Paths b: wx abd wwx acd wwz a:w d: c: wz …ebd uwx …ecd uwz

  29. b: x e:u Shifting Outputs Along Paths b: x abd wwx acd wwz a:w d: w c: z …ebd uwx …ecd uwz …abnbd u(wx)nwx …abncd u(wx)nwz

  30. b: xw e:uw Shifting Outputs Along Paths b: x abd wwx acd wwz a:ww d: c: z …ebd uwx …ecd uwz …abnbd u(wx)nwx …abncd u(wx)nwz …abnbd uw(xw)nx …abncd uw(xw)nz

  31. b: x e:u Shifting Outputs Along Paths b: x abd wwx acd wwz a:w d: w c: z …ebd uwx …ecd uwz …abnbd u(wx)nwx …abncd u(wx)nwz …abnbd uw(xw)nx …abncd uw(xw)nz

  32. b: wx e:u …abnbd u(wx)nwx …abncd u(wx)nwz Shifting Outputs Along Paths b: wx abd wwx acd wwz a:w d: c: wz …ebd uwx …ecd uwz …abnbd uw(xw)nx …abncd uw(xw)nz

  33. e:u Shifting Outputs Along Paths (Mohri) • Here, not all the out-arcs start with w • But all the out-paths start with w • Do pushback at later states first: b: wx a:w d:  c: d: w :  b: wz

  34. e:u Shifting Outputs Along Paths (Mohri) • Here, not all the out-arcs start with w • But all the out-paths start with w • Do pushback at later states first: now we’re ok! b: wx a:w d: c: w  d: :  b: zw

  35. e:u Shifting Outputs Along Paths (Mohri) • Here, not all the out-arcs start with w • But all the out-paths start with w • Do pushback at later states first: now we’re ok! b: x a:w d: w  c:  d: :  b: zw

  36. e:uw Shifting Outputs Along Paths (Mohri) • Here, not all the out-arcs start with w • But all the out-paths start with w • Do pushback at later states first: now we’re ok! b: x a:ww d:  c:  d: :  b: zw

  37. e:u Shifting Outputs Along Paths (Mohri) • Actually, push back at all states at once b: wx a:w d:  c: d: w :  b: wz

  38. e:u Shifting Outputs Along Paths (Mohri) • Actually, push back at all states at once • At every state q, compute some (q) b: wx a:w d: w   c: w d: w :  b: wz w

  39. wx a:ww w e:uw e:u w wzw Shifting Outputs Along Paths (Mohri) • Actually, push back at all states at once • Add (q) to end of q’s in-arcs b: wx a:w d: w   c: w d: w :  b: wz w

  40. e:uw Shifting Outputs Along Paths (Mohri) • Actually, push back at all states at once • Add (q) to end of q’s in-arcs • Remove (q) from start of q’s out-arcs wx b: a:ww d: w  w c: w d: w : w b: wzw w

  41. e:uw a: (q)-1 k (r) a:k becomes q q r r Shifting Outputs Along Paths (Mohri) • Actually, push back at all states at once • Add (q) to end of q’s in-arcs • Remove (q) from start of q’s out-arcs b: x a:ww d:  c:  d: :  b: zw

  42. a b a b a b b b Mergeable because they accept the same suffix language: {ab,bb} Minimizing Weighted DFAs (Mohri)

  43. Minimizing Weighted DFAs (Mohri) Still accept same suffix language, but produce different outputs on it a:y b:z a:x b:zz a:wwy b: b: b:wwzzz

  44. Minimizing Weighted DFAs (Mohri) Still accept same suffix language, but produce different outputs on it a:y b:z a:x b:zz a:wwy b: b: b:wwzzz Not mergeable - compute different suffix functions: ab yz or wwy acd zzz or wwzzz

  45. Minimizing Weighted DFAs (Mohri) Fix by shifting outputs leftward … a:y b:z a:x b:zz wwy a: b: b: b: wwzzz

  46. Minimizing Weighted DFAs (Mohri) Fix by shifting outputs leftward … a:y b:z a:x b:zz y a: ww b: b: b: zzz

  47. Now mergeable - they have the same suffix function:ab yz acd zzz Minimizing Weighted DFAs (Mohri) Fix by shifting outputs leftward … a:y b:z a:x b:zz y a: b:ww b: b: zzz But still no easy way to detect mergeability.

  48. Now mergeable - they have the same suffix function:ab yz acd zzz Minimizing Weighted DFAs (Mohri) If we do this at all states as before … a:y b:z a:x b:zz y a: b:ww b: b: zzz

  49. Now mergeable - they have the same suffix function:ab yz acd zzz Minimizing Weighted DFAs (Mohri) If we do this at all states as before … a:y b: z a:x b:zz y a: b:ww b: b: zzz

  50. Now mergeable - they have the same suffix function:ab yz acd zzz Now these have the same sufffix function too: b  Minimizing Weighted DFAs (Mohri) If we do this at all states as before … a:yz b: a:x b:zzz yz a: b:ww b: b: zzz

More Related