Correcting errors in a matrix inverse (or product) Daniel S. Roche - - PowerPoint PPT Presentation

correcting errors in a matrix inverse
SMART_READER_LITE
LIVE PREVIEW

Correcting errors in a matrix inverse (or product) Daniel S. Roche - - PowerPoint PPT Presentation

Introduction Matrix Multiplication Matrix Inverse Perspective Correcting errors in a matrix inverse (or product) Daniel S. Roche Computer Science Department United States Naval Academy Annapolis, Maryland, U.S.A. Laboratoire Jean Kuntzmann


slide-1
SLIDE 1

Introduction Matrix Multiplication Matrix Inverse Perspective

Correcting errors in a matrix inverse

(or product) Daniel S. Roche

Computer Science Department United States Naval Academy Annapolis, Maryland, U.S.A. Laboratoire Jean Kuntzmann Universit´ e Grenoble Alpes Grenoble, France

24 January 2018 Journ´ ees Nationales de Calcul Formel Luminy, France

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 1 / 23

slide-2
SLIDE 2

Introduction Matrix Multiplication Matrix Inverse Perspective

Correcting Errors

General Framework Some problem is slow to solve locally. So we outsource the computation and get back the result. If the result is wrong, we should detect that. If the result is “close”, we should correct it.

Sources of error

Noisy communication channel Faults in computation Malicious servers?

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 2 / 23

slide-3
SLIDE 3

Introduction Matrix Multiplication Matrix Inverse Perspective

Example: Sudoku

Sent to server 7 8 2 7 1 4 8 3 5 5 8 3 6 9 3 7 5 1 7 4 9 7 4 2 Response 9 7 6 8 1 2 4 5 3 2 5 3 9 6 4 8 1 7 1 4 5 3 8 7 9 2 6 7 9 8 6 2 5 3 4 1 4 6 1 5 7 3 2 8 9 3 8 2 1 4 9 7 6 5 5 3 9 2 9 6 1 7 4 6 2 4 7 9 1 5 3 8 8 1 7 4 3 8 6 9 2

Source: https://www.nytimes.com/crosswords/game/sudoku/hard

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 3 / 23

slide-4
SLIDE 4

Introduction Matrix Multiplication Matrix Inverse Perspective

Example: Sudoku

Sent to server 7 8 2 7 1 4 8 3 5 5 8 3 6 9 3 7 5 1 7 4 9 7 4 2 Response 9 7 6 8 1 2 4 5 3 2 5 3 9 6 4 8 1 7 1 4 5 3 8 7 9 2 6 7 9 8 6 2 5 3 4 1 4 6 1 5 7 3 2 8 9 3 8 2 1 4 9 7 6 5 5 3 9 2 9 6 1 7 4 6 2 4 7 9 1 5 3 8 8 1 7 4 3 8 6 9 2

Source: https://www.nytimes.com/crosswords/game/sudoku/hard

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 3 / 23

slide-5
SLIDE 5

Introduction Matrix Multiplication Matrix Inverse Perspective

First Problem: Matrix Multiplication

Matrix Multiplication with Errors

Input: A, B, C ∈ Fn×n, where C ≈ AB Output: E ∈ Fn×n s.t. AB = C − E Parameters: Dimension n Input size t = #A + #B + #C Error count k = #E

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 4 / 23

slide-6
SLIDE 6

Introduction Matrix Multiplication Matrix Inverse Perspective

First Problem: Matrix Multiplication

Matrix Multiplication with Errors

Input: A, B, C ∈ Fn×n, where C ≈ AB Output: E ∈ Fn×n s.t. AB = C − E Parameters: Dimension n Input size t = #A + #B + #C Error count k = #E Na¨ ıve recomputation: O(nω) Gasieniec, Levcopoulos, Lingas, Pagh, Tokuyama, Algorithmica 2017:

  • O
  • n2 + kn
  • Dan Roche (USNA/LJK)

Matrix Inverse with Errors 24 January 2018 4 / 23

slide-7
SLIDE 7

Introduction Matrix Multiplication Matrix Inverse Perspective

First Problem: Matrix Multiplication

Matrix Multiplication with Errors

Input: A, B, C ∈ Fn×n, where C ≈ AB Output: E ∈ Fn×n s.t. AB = C − E Parameters: Dimension n Input size t = #A + #B + #C Error count k = #E Na¨ ıve recomputation: O(nω) Gasieniec, Levcopoulos, Lingas, Pagh, Tokuyama, Algorithmica 2017:

  • O
  • n2 + kn
  • Ours:
  • O(t + kn) worst-case;
  • O
  • t + k0.686n
  • best case

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 4 / 23

slide-8
SLIDE 8

Introduction Matrix Multiplication Matrix Inverse Perspective

Related Work

Monte Carlo verification in Linear Algebra

Matrix multiplication: Freivalds ’79 Positive semidefiniteness: Kaltofen, Nehring, Saunders ’11 Rank, characteristic polynomial,. . . : Dumas & Kaltofen ’14 Rank profile, triangular forms: Dumas, Lucas, Pernet ’17

Error correction in symbolic computation Complexity of sparse matrix multiplication

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 5 / 23

slide-9
SLIDE 9

Introduction Matrix Multiplication Matrix Inverse Perspective

Related Work

Monte Carlo verification in Linear Algebra Error correction in symbolic computation

Chinese remaindering: Goldreich, Ron, Sudan ’99 Rational reconstruction: Khonji, Pernet, Roch, Roche, Stalinski ’10 Sparse interpolation: Comer, Kaltofen, Pernet ’12

Complexity of sparse matrix multiplication

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 5 / 23

slide-10
SLIDE 10

Introduction Matrix Multiplication Matrix Inverse Perspective

Related Work

Monte Carlo verification in Linear Algebra Error correction in symbolic computation Complexity of sparse matrix multiplication k = number of nonzeros

  • O
  • n2 + k0.7n1.2

: Yuster & Zwick ’04

  • O
  • k1.34
  • utput sensitive: Amossen & Pagh ’09
  • O
  • k0.188n2

: Lingas ’10

  • O
  • n2 + kn
  • utput sensitive: Pagh ’13

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 5 / 23

slide-11
SLIDE 11

Introduction Matrix Multiplication Matrix Inverse Perspective

Outline

Introduction Matrix Multiplication with Errors Crucial tools: Nonzero row identification, Sparse interpolation Matrix Inverse with Errors Additional tools: Commutativity, Sparse low-rank linear algebra Open Problems

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 6 / 23

slide-12
SLIDE 12

Introduction Matrix Multiplication Matrix Inverse Perspective

Correcting errors in matrix multiplication

Input: A, B, C ∈ Fn×n Output: E ∈ Fn×n s.t. AB = C − E Algorithm overview:

1 Formulate as E = C − AB 2 Find nonzero rows

Choose random v ∈ Fn and compute Ev

3 Evaluate row polynomials

For each evaluation θ, compute E[1, θ, . . . , θn−1]T

4 Interpolate row polynomials

Sparse interpolation to recover at least half of the nonero rows

5 Repeat O(log k) times until all rows are found

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 7 / 23

slide-13
SLIDE 13

Introduction Matrix Multiplication Matrix Inverse Perspective

Finding nonzero rows

For unknown M ∈ Fn×n, which rows are nonzero?

Example

?

M

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 8 / 23

slide-14
SLIDE 14

Introduction Matrix Multiplication Matrix Inverse Perspective

Finding nonzero rows

For unknown M ∈ Fn×n, which rows are nonzero?

Example

?

M v

1 Choose random vector v ∈ Fn

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 8 / 23

slide-15
SLIDE 15

Introduction Matrix Multiplication Matrix Inverse Perspective

Finding nonzero rows

For unknown M ∈ Fn×n, which rows are nonzero?

Example

?

M v = x

1 Choose random vector v ∈ Fn 2 Apply Mv = x

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 8 / 23

slide-16
SLIDE 16

Introduction Matrix Multiplication Matrix Inverse Perspective

Finding nonzero rows

For unknown M ∈ Fn×n, which rows are nonzero?

Example

? ? ? ? ? ? ? ? ?

M v = x

1 Choose random vector v ∈ Fn 2 Apply Mv = x 3 Nonzero rows of M are nonzero entries in x w.h.p.

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 8 / 23

slide-17
SLIDE 17

Introduction Matrix Multiplication Matrix Inverse Perspective

Row Polynomials

Treat each row of M ∈ Fn×n as a degree-(n − 1) polynomial

Example 1 x x2 x3 . . . = x5 + x7 x9 . . . = f1(x) f2(x) f3(x) . . .

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 9 / 23

slide-18
SLIDE 18

Introduction Matrix Multiplication Matrix Inverse Perspective

Row Polynomial Evaluation

Need to evaluate each row polynomial fi(x) at 1, θ, θ2, . . . This is equivalent to multiplying by a (truncated) DFT matrix.

Example

θi+j

=

f1(1) f1(θ) f1(θ2) · · · f2(1) f2(θ) f2(θ2) · · · . . . . . . . . . . . .

M n × n V n × s MV n × s

Important: Takes

O(sn + t) field ops, where t = #M

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 10 / 23

slide-19
SLIDE 19

Introduction Matrix Multiplication Matrix Inverse Perspective

Oligonomial Polynomial Interpolation

Algorithm (Kaltofen, Lakshman, Wiley 1990)

Unknown polynomial f ∈ F[x] with t nonzero terms is uniquely determined by f(1), f(θ), f(θ2), . . . , f(θ2s−1) iff:

f has at most s nonzero terms; and

  • rder(θ) ≥ deg f

Problem over GF(q):

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 11 / 23

slide-20
SLIDE 20

Introduction Matrix Multiplication Matrix Inverse Perspective

Oligonomial Polynomial Interpolation

Algorithm (Kaltofen, Lakshman, Wiley 1990)

Unknown polynomial f ∈ F[x] with t nonzero terms is uniquely determined by f(1), f(θ), f(θ2), . . . , f(θ2s−1) iff:

f has at most s nonzero terms; and

  • rder(θ) ≥ deg f

Problem over GF(q): Needs t discrete logarithms to discover the exponents Solution: Pre-compute first deg f = n powers of θ

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 11 / 23

slide-21
SLIDE 21

Introduction Matrix Multiplication Matrix Inverse Perspective

Multiplication Algorithm Overview

Given A, B, C, we want to compute E = C − AB

?

= E − C B A

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 12 / 23

slide-22
SLIDE 22

Introduction Matrix Multiplication Matrix Inverse Perspective

Multiplication Algorithm Overview

1 Find zero rows of E ? ? ? ? ? ? ? ? ? ? ? ?

= E v Cv − ABv − C B A v v

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 12 / 23

slide-23
SLIDE 23

Introduction Matrix Multiplication Matrix Inverse Perspective

Multiplication Algorithm Overview

2 Remove corresponding rows from C and A

?

= E − C B A

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 12 / 23

slide-24
SLIDE 24

Introduction Matrix Multiplication Matrix Inverse Perspective

Multiplication Algorithm Overview

3 Choose s ≤ n and evaluate row polynomials at 2s powers of θ

?

θi+j =

E V

θi+j − θi+j

C B A V V

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 12 / 23

slide-25
SLIDE 25

Introduction Matrix Multiplication Matrix Inverse Perspective

Multiplication Algorithm Overview

3 Choose s ≤ n and evaluate row polynomials at 2s powers of θ

?

θi+j =

E V − CV BV A

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 12 / 23

slide-26
SLIDE 26

Introduction Matrix Multiplication Matrix Inverse Perspective

Multiplication Algorithm Overview

3 Choose s ≤ n and evaluate row polynomials at 2s powers of θ

?

θi+j =

E V − CV ABV

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 12 / 23

slide-27
SLIDE 27

Introduction Matrix Multiplication Matrix Inverse Perspective

Multiplication Algorithm Overview

3 Choose s ≤ n and evaluate row polynomials at 2s powers of θ

?

θi+j =

E V CV − ABV

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 12 / 23

slide-28
SLIDE 28

Introduction Matrix Multiplication Matrix Inverse Perspective

Multiplication Algorithm Overview

3 Choose s ≤ n and evaluate row polynomials at 2s powers of θ ? ? ? ? ? ? ? ? ? ? ? ?

θi+j =

E V CV − ABV

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 12 / 23

slide-29
SLIDE 29

Introduction Matrix Multiplication Matrix Inverse Perspective

Multiplication Algorithm Overview

4 Perform sparse interpolation to recover s-sparse rows of E ? ? ? ? ? ?

θi+j =

E V CV − ABV

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 12 / 23

slide-30
SLIDE 30

Introduction Matrix Multiplication Matrix Inverse Perspective

Complexity Analysis

How large should s (number of evaluations) be? If s ≥ 2k/r, then we recover at least half of the nonzero rows. We can transpose as necessary Make the number of nonzero rows in E minimal.

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 13 / 23

slide-31
SLIDE 31

Introduction Matrix Multiplication Matrix Inverse Perspective

Multiplication Complexity

Total cost in field operations is

  • O

      t + kn min(r, k

r)3−ω

       n = dimension t = number of nonzeros in A, B, C k = number of errors (nonzeros in E) r = number of nonzero rows or columns in E, whichever is smaller ω < 2.373, exponent of matrix multiplication

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 14 / 23

slide-32
SLIDE 32

Introduction Matrix Multiplication Matrix Inverse Perspective

Multiplication Complexity

Total cost in field operations is

O

  • t + kn/ min(r, k

r)3−ω

n = dimension t = number of nonzeros in A, B, C k = number of errors (nonzeros in E) r = number of nonzero rows or columns in E, whichever is smaller ω < 2.373, exponent of matrix multiplication

Very sparse “Compact” errors Worst case

t ≪ nkω/2 r ≈ √ k k ≤ n k ≥ n tk0.5 t + k0.69n t + kn t + k0.38n1.63 t + k(ω−1)/2n t + kω−2n4−ω

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 14 / 23

slide-33
SLIDE 33

Introduction Matrix Multiplication Matrix Inverse Perspective

Second Problem: Matrix Inverse

Matrix Inverse with Errors

Input: A, B ∈ Fn×n Output: E ∈ Fn×n s.t. A−1 = B + E Parameters: Dimension n Input size t = #A + #B Error count k = #E Na¨ ıve recomputation: O(nω) Ours:

  • O(t + kn + kω) worst-case;
  • O
  • t + k0.69n
  • best case

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 15 / 23

slide-34
SLIDE 34

Introduction Matrix Multiplication Matrix Inverse Perspective

Problem Formulation

Rewriting the problem definition:

EA = I − BA AE = I − AB

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 16 / 23

slide-35
SLIDE 35

Introduction Matrix Multiplication Matrix Inverse Perspective

Problem Formulation

Rewriting the problem definition:

EA = I − BA AE = I − AB

Crucial steps in multiplication algorithm: Computing nonzero rows of E Evaluate EAv = v − A(Bv) for random vector v

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 16 / 23

slide-36
SLIDE 36

Introduction Matrix Multiplication Matrix Inverse Perspective

Problem Formulation

Rewriting the problem definition:

EA = I − BA AE = I − AB

Crucial steps in multiplication algorithm: Computing nonzero rows of E Evaluate EAv = v − A(Bv) for random vector v Evaluating row polynomials at 2s powers of θ (Coming up next. . . )

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 16 / 23

slide-37
SLIDE 37

Introduction Matrix Multiplication Matrix Inverse Perspective

Low-Rank Linear Algebra

Algorithm (Chung, Kwok, Lau ’13)

Input: Matrix M with rank r and t nonzeros Output: Indices of r linearly independent rows Cost:

O(t + rω)

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 17 / 23

slide-38
SLIDE 38

Introduction Matrix Multiplication Matrix Inverse Perspective

Low-Rank Linear Algebra

Algorithm (Chung, Kwok, Lau ’13)

Input: Matrix M with rank r and t nonzeros Output: Indices of r linearly independent rows Cost:

O(t + rω)

How we use this:

1 Find zero rows of E 2 Remove corresponding columns of A 3 Resulting (r × n) matrix has rank r 4 Remove linearly dependent rows 5 Compute inverse of resulting r × r matrix

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 17 / 23

slide-39
SLIDE 39

Introduction Matrix Multiplication Matrix Inverse Perspective

Inverse Algorithm Overview

Write EA = I − BA

?

= E A − I B A

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 18 / 23

slide-40
SLIDE 40

Introduction Matrix Multiplication Matrix Inverse Perspective

Inverse Algorithm Overview

Find nonzero rows of E

? ? ? ? ? ? ? ? ? ? ? ?

= E A v v − BAv − I v B A v

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 18 / 23

slide-41
SLIDE 41

Introduction Matrix Multiplication Matrix Inverse Perspective

Inverse Algorithm Overview

Write AE = I − AB

? ? ? ? ? ? ? ? ? ? ? ?

= A E − I A B

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 18 / 23

slide-42
SLIDE 42

Introduction Matrix Multiplication Matrix Inverse Perspective

Inverse Algorithm Overview

Remove zero rows of E and corresp. columns from A

?

= X E − I A B

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 18 / 23

slide-43
SLIDE 43

Introduction Matrix Multiplication Matrix Inverse Perspective

Inverse Algorithm Overview

Find linear independent rows of X, remove others from both sides

?

= X E − I A B

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 18 / 23

slide-44
SLIDE 44

Introduction Matrix Multiplication Matrix Inverse Perspective

Inverse Algorithm Overview

Evaluate row polynomials at first 2s powers of θ

?

θi+j =

X E V

θi+j − θi+j

I V A B V

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 18 / 23

slide-45
SLIDE 45

Introduction Matrix Multiplication Matrix Inverse Perspective

Inverse Algorithm Overview

Evaluate row polynomials at first 2s powers of θ

?

θi+j =

X E V V − ABV

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 18 / 23

slide-46
SLIDE 46

Introduction Matrix Multiplication Matrix Inverse Perspective

Inverse Algorithm Overview

Compute X−1 and apply to both sides

?

θi+j =

E V X−1 V − ABV

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 18 / 23

slide-47
SLIDE 47

Introduction Matrix Multiplication Matrix Inverse Perspective

Inverse Complexity

Total cost in field operations is

O

  • t + rω + kn/ min(r, k

r)3−ω

n = dimension t = number of nonzeros in A, B, C k = number of errors (nonzeros in E) r = number of nonzero rows or columns in E, whichever is smaller ω < 2.373, exponent of matrix multiplication

“Compact” errors Worst case

r ≈ √ k k ≤ n0.73 n0.74 ≤ k ≤ n k ≥ n t + k0.69n t + kn t + k2.38 n2.38 t + k(ω−1)/2n t + kω nω

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 19 / 23

slide-48
SLIDE 48

Introduction Matrix Multiplication Matrix Inverse Perspective

(Potential) Applications

Fault-tolerant computing Sparse and output-sensitive computation Simultaneous Chinese remaindering with different sizes

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 20 / 23

slide-49
SLIDE 49

Introduction Matrix Multiplication Matrix Inverse Perspective

Challenge: LU Factorization

Problem

Input: A, L, U ∈ Fn×n Output: EL, EU ∈ Fn×n s.t. A = (L + EL)(U + EU) (where L, EL are lower triangular and U, EU are upper triangular) We can apply the inverse with errors algorithm except that: Only L OR U can have errors No commutativity, so can’t choose min(nonzero rows, nonzero columns)

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 21 / 23

slide-50
SLIDE 50

Introduction Matrix Multiplication Matrix Inverse Perspective

Next Steps

Faster Can you achieve the “best-case” cost w.h.p.? Further

LU factorization and other interesting problems. . .

(Matrix inverse is kind of bullshit.) Code What is the practical number of errors k before recomputation is faster?

Dan Roche (USNA/LJK) Matrix Inverse with Errors 24 January 2018 22 / 23

slide-51
SLIDE 51

Merci !