SPIRE2013-tabei20131009

Yasuo Tabei
Yasuo TabeiResearcher, Software Developer at Japan Science and Technology Agency
20th String Processing and Information Retrieval (SPIRE2013),
Jerusalem, Israel, October 9th, 2013

Fully-Online Grammar
Compression
Yasuo Tabei (PREST, JST)
Collaboration with
Shirou Maruyama (PFI, Inc)
Hiroshi Sakamoto (Kyutech)
Kunihiko Sadakane (NII)
Motivation
• Large-scale and highly repetitive text collections
have become ubiquitous
– Personal genomes, version controlled documents,
source codes in repository, reports by studentsnew

• Repair = representative grammar compression
– Not applicable to large-scale repetitive texts

• Present a scalable grammar compression
Straight Line Program (SLP)
• Canonical form of a CFG deriving a single string
• Every production rule satisfies
– Right-hand side is a digram
– Subscripts of the left symbol is larger than subscripts
of the right symbols
X5

Example:
aabbabb

X1➝ab
X2➝X1a
X3➝X1X2
X4➝X3X2

X2
a

X4
X1

ab

b

X3

b

X1
ab
Straight Line Program (SLP)
• Canonical form of a CFG deriving a single string
• Every production rule satisfies
– Right-hand side is a digram
– Subscripts of the left symbol is larger than subscripts
of the right symbols
X5

Example:
aabbabb
N:text length

X1➝ab
X2➝X1a
n
X3➝X1X2
X4➝X3X2

X2
a

X4
X1

ab

h:
b height

X3

b

X1
ab
Grammar Compression (GC)
• Build a small CFG from an input string
– Size n = number of production rules

• Two crucial data structures
1. Dictionary : Given Xk, returns XiXj for Xk ➝ XiXj
- Array : 2nlgn bits
2. Reverse dictionary: Given XiXj, return Xk
- Hash table : O(nlgn) bits
X1➝ab
X2➝X1a
X3➝X1X2
X4➝X3X2

Access : Xk ➝ A[2k-1][2k]
Existing grammar compression
• Compression time and working space are
important for scalability
• Online LCA (OLCA) [CCP,2011] = efficient GC
Compression
Method
time
CCP,2011 O(N/α)
SPIRE,2012 O(N/α)
CPM,2013 O(Nlgn)

Working space (bits)
(3+α)nlgn
(11/4+α nlgn
2nlgn(1+o(1))+2nlgp (p << √n)

• Drawbacks : they need a large working space
• Challenge : developing fast GC of smaller
working space
Fully-Online LCA (FOLCA)
Direct encoding of an SLP
SLP (Parse Tree)
Text
abaababa

Partial Parse Tree

Succinct
Representation
12345678910
B:0010101011
L:abaX1X2
P:123469

• Smaller working space : (1+α)nlgn+n(3+lg(αn))
bits
• Optimal encoding: lgn+2n+o(n) bits
– Almost equal to the lower bound [CPM,2013]
Menu
• Review of Online LCA
• FOLCA

• Compressed hash table for smaller working space
• Substring extractions
• Experiments
Basic idea of OLCA
• Replace the same pairs of symbols in common
substrings by the same non-terminal symbols as
many as possible
• Build 2-trees or 2-2-trees
X2
X1

X2

X2
X3

X4

X1

X3

X4

X1

a b r a k a d a b r a k a d a b r
common substrings

• Iterate this procedure to novel non-terminal
symbols until it builds a single parse tree
Land mark : local feature decided by
a triple of symbols ABC
• B is a landmark if B belongs to one of the
following : i) repetitive: A = B = C, ii) maximum:
A < B > C, iii) minimum: A > B < C
• Enable an bottom up construction of a parse tree
in an online manner
• Build a parse subtree from a sequence of
symbols of length four
i)B is a landmark
Z

ii) Otherwise
Z

Y

ABCD
A B C

D
Online construction of a parse tree
• Use a queue corresponding to each level of a parse tree
• Read a character, build a subtree in each queue, and
enqueue a non-terminal symbol of the root to the higher
queue
(i) q1 is land mark

enqueue

z

Qi+1

(ii) Otherwise

z

Qi+1
z

z

y
Qi q0 q1 q2 q3
q0q1

Qi q0 q1 q2 q3
dequeue

q0q1q2

enqueue

dequeue
Demonstration of OLCA
Q3
d

X3

1

2

d

X1 X1

b X2

1

2

4

Rules
X1→aa
X2→ab
X3→X1X1

3

4

5

Q2
3

5

Q1

Input string

d
1

a a a a b a b a a a a b
2

3

4

5

Courtesy by Shirou Maruyama
Efficiency of OLCA
• The approximation ratio : O(lg2N)
• Compression time : O(N/α)

• Working space : (3 + α)nlgn bits
• Parse tree is balanced and its height is h =
O(lgN)
Fully-Online LCA (FOLCA)
• Build post-order partial parse tree (POPPT)
– Partial parse tree whose internal nodes have postorder variables
Parse tree

POPPT

• Enable direct encoding to a post-order
succinct tree : nlgn + 2n + o(n) bits
Online construction of POPPT
• A replacing pair in queues are shifted to the right
position of OLCA
(i) q1 is land mark

enqueue

z

Qi+1

(ii) otherwise

enqueue

z

Qi+1
z

z

y
Qi q0 q1 q2 q3 q4
q0q1

Qi q0 q1 q2 q3 q4
dequeue

q0q1q2

dequeue

• Approximation ratio is the same as that of OLCA
Succinct encoding of POPPT
• FOLCA builds POPPT in an online manner, it
encodes the POPPT into dynamic RMM tree
[Sadakane and Navarro,2009]
– ‘0’ for a leaf and ‘1’ for an internal node
– L : a label sequence for leaves
POPPT

Succinct tree
B : 0010101011
L : abaX1X2

nlgn + 2n + o(n) bits
• Simulate tree operations using rank/select
dictionary : random access to Xk ➝ XiXj
Compression of reverse dictionary :
Given XiXj, it returens Xk for Xk➝XiXj
• Implemented as chaining hash table
– αnlgn bits for the table, n(1+α)lgn bits for the lists (α:
load factor of hash table)

• Observation : FOLCA generates post-order
variables in increasing order
– Variables in each list can be organized in increasing
order.

• Compress each list by gap-encoding and the
delta code
• Space : (1+α)nlgn + n(3+lg(αn)) bits
• Access time : O(1/α)
Substring extraction
• Keep the starting position of the substring
encoded by each variable Xi in position array P
– Naïve representation : nlgN bits

• Observation : position array is a monotonically
increasing sequence [Grossi et al., 2003]
• nlg(N/n)+3n+o(n) bits
• Extraction time of a substring
of length l is O(l+h)

P
Increasing
Experiments
• Ecoli (108MB) and kernel texts (247MB) from
repetitive collections in pizza & chili corpus
• Evaluate compression time, working space and
substring extraction time
• Compare FOLCA with LZend [Kreft and
Navarro’10]
• Applicability to 100 human genomes (300GB)
Compression time and working
space for the Ecoli text
FOLCA: Spaces for hash table (H) dictionary (D)
and position array (P)
load
H+D
H+D+P
factor
time (sec) H (MB) (MB)
(MB)
0.01
1,328
23
45
50
0.05
728
37
59
64
0.1
553
48
70
75
0.3
416
65
87
92
0.5
408
90
112
117
LZend
time (sec) space (MB)
2,217
2,410
Compression time and working
space for the kernel text
FOLCA: Spaces for hash table (H) dictionary (D)
and position array (P)
load
H+D
H+D+P
factor
time (sec) H (MB) (MB)
(MB)
0.01
2,891
11
21
23
0.05
2,071
13
23
25
0.1
1,472
16
26
28
0.3
951
30
40
42
0.5
882
42
52
54
LZend
time (sec) space (MB)
4,547
4,653
Substring extraction time and
working space for the kernel text
Time [sec]
Length
101
102
103
104
105

FOLCA

LZend

0.00007
0.00026
0.00224
0.02176
0.21328

0.00002
0.00011
0.00100
0.00954
0.09215

Working space [MB]
FOLCA
12

LZend
14
Compression size for 100 human
genomes (300GB)
Compression time for 100 human
genomes (300GB)
Summary of FOLCA
• Directly encode an SLP into a succinct
representation of nlgn+2n+o(o) bits
• Asymptotically equivalent to the information
theoretic lower bound [CPM,2013]
• Compressed hash table for small working space
of (1+α)nlgn+n(3+lg(αn)) bits
• Support substring extraction in O(l+h) time using
additional space of nlg(N/n)+3n+o(n) bits
1 of 25

Recommended

CPM2013-tabei201306 by
CPM2013-tabei201306CPM2013-tabei201306
CPM2013-tabei201306Yasuo Tabei
4.5K views20 slides
DCC2014 - Fully Online Grammar Compression in Constant Space by
DCC2014 - Fully Online Grammar Compression in Constant SpaceDCC2014 - Fully Online Grammar Compression in Constant Space
DCC2014 - Fully Online Grammar Compression in Constant SpaceYasuo Tabei
1.1K views21 slides
Tpr star tree by
Tpr star treeTpr star tree
Tpr star treeWin Yu
1.3K views23 slides
lecture 13 by
lecture 13lecture 13
lecture 13sajinsc
378 views20 slides
A Gentle Introduction to Locality Sensitive Hashing with Apache Spark by
A Gentle Introduction to Locality Sensitive Hashing with Apache SparkA Gentle Introduction to Locality Sensitive Hashing with Apache Spark
A Gentle Introduction to Locality Sensitive Hashing with Apache SparkFrançois Garillot
16.9K views33 slides
Finding similar items in high dimensional spaces locality sensitive hashing by
Finding similar items in high dimensional spaces  locality sensitive hashingFinding similar items in high dimensional spaces  locality sensitive hashing
Finding similar items in high dimensional spaces locality sensitive hashingDmitriy Selivanov
1.2K views20 slides

More Related Content

What's hot

Parallel Optimization in Machine Learning by
Parallel Optimization in Machine LearningParallel Optimization in Machine Learning
Parallel Optimization in Machine LearningFabian Pedregosa
312 views65 slides
Big o notation by
Big o notationBig o notation
Big o notationhamza mushtaq
5.8K views16 slides
Sortsearch by
SortsearchSortsearch
Sortsearch Krishna Chaytaniah
952 views26 slides
Linear sorting by
Linear sortingLinear sorting
Linear sorting Krishna Chaytaniah
763 views6 slides
Using R in remote computer clusters by
Using R in remote computer clustersUsing R in remote computer clusters
Using R in remote computer clustersBurak Himmetoglu
689 views19 slides
Real Time Big Data Management by
Real Time Big Data ManagementReal Time Big Data Management
Real Time Big Data ManagementAlbert Bifet
1.3K views67 slides

What's hot(20)

Parallel Optimization in Machine Learning by Fabian Pedregosa
Parallel Optimization in Machine LearningParallel Optimization in Machine Learning
Parallel Optimization in Machine Learning
Fabian Pedregosa312 views
Real Time Big Data Management by Albert Bifet
Real Time Big Data ManagementReal Time Big Data Management
Real Time Big Data Management
Albert Bifet1.3K views
[AAAI-16] Tiebreaking Strategies for A* Search: How to Explore the Final Fron... by Asai Masataro
[AAAI-16] Tiebreaking Strategies for A* Search: How to Explore the Final Fron...[AAAI-16] Tiebreaking Strategies for A* Search: How to Explore the Final Fron...
[AAAI-16] Tiebreaking Strategies for A* Search: How to Explore the Final Fron...
Asai Masataro2.2K views
Monad presentation scala as a category by samthemonad
Monad presentation   scala as a categoryMonad presentation   scala as a category
Monad presentation scala as a category
samthemonad2K views
Regularised Cross-Modal Hashing (SIGIR'15 Poster) by Sean Moran
Regularised Cross-Modal Hashing (SIGIR'15 Poster)Regularised Cross-Modal Hashing (SIGIR'15 Poster)
Regularised Cross-Modal Hashing (SIGIR'15 Poster)
Sean Moran1.2K views
New zealand bloom filter by xlight
New zealand bloom filterNew zealand bloom filter
New zealand bloom filter
xlight1.5K views
Of Sampling and Smoothing: Approximating Distributions over Linked Open Data by Thomas Gottron
Of Sampling and Smoothing: Approximating Distributions over Linked Open DataOf Sampling and Smoothing: Approximating Distributions over Linked Open Data
Of Sampling and Smoothing: Approximating Distributions over Linked Open Data
Thomas Gottron496 views
Introducing: A Complete Algebra of Data by Inside Analysis
Introducing: A Complete Algebra of DataIntroducing: A Complete Algebra of Data
Introducing: A Complete Algebra of Data
Inside Analysis1.1K views

Similar to SPIRE2013-tabei20131009

Text classification using Text kernels by
Text classification using Text kernelsText classification using Text kernels
Text classification using Text kernelsDev Nath
3.6K views42 slides
Scaling Genomic Analyses by
Scaling Genomic AnalysesScaling Genomic Analyses
Scaling Genomic Analysesfnothaft
893 views19 slides
Speech enhancement for distant talking speech recognition by
Speech enhancement for distant talking speech recognitionSpeech enhancement for distant talking speech recognition
Speech enhancement for distant talking speech recognitionTakuya Yoshioka
7.8K views26 slides
Prolog & lisp by
Prolog & lispProlog & lisp
Prolog & lispIsmail El Gayar
16.5K views24 slides
lex and yacc.pdf by
lex and yacc.pdflex and yacc.pdf
lex and yacc.pdfSurajRavi16
8 views64 slides
PS by
PSPS
PSNRSHEKAR
3 views12 slides

Similar to SPIRE2013-tabei20131009(20)

Text classification using Text kernels by Dev Nath
Text classification using Text kernelsText classification using Text kernels
Text classification using Text kernels
Dev Nath3.6K views
Scaling Genomic Analyses by fnothaft
Scaling Genomic AnalysesScaling Genomic Analyses
Scaling Genomic Analyses
fnothaft893 views
Speech enhancement for distant talking speech recognition by Takuya Yoshioka
Speech enhancement for distant talking speech recognitionSpeech enhancement for distant talking speech recognition
Speech enhancement for distant talking speech recognition
Takuya Yoshioka7.8K views
DSJ_Unit I & II.pdf by Arumugam90
DSJ_Unit I & II.pdfDSJ_Unit I & II.pdf
DSJ_Unit I & II.pdf
Arumugam9010 views
Introduction to Ultra-succinct representation of ordered trees with applications by Yu Liu
Introduction to Ultra-succinct representation of ordered trees with applicationsIntroduction to Ultra-succinct representation of ordered trees with applications
Introduction to Ultra-succinct representation of ordered trees with applications
Yu Liu511 views
zkStudyClub: PLONKUP & Reinforced Concrete [Luke Pearson, Joshua Fitzgerald, ... by Alex Pruden
zkStudyClub: PLONKUP & Reinforced Concrete [Luke Pearson, Joshua Fitzgerald, ...zkStudyClub: PLONKUP & Reinforced Concrete [Luke Pearson, Joshua Fitzgerald, ...
zkStudyClub: PLONKUP & Reinforced Concrete [Luke Pearson, Joshua Fitzgerald, ...
Alex Pruden791 views
Python高级编程(二) by Qiangning Hong
Python高级编程(二)Python高级编程(二)
Python高级编程(二)
Qiangning Hong9.7K views
Memory allocation by sanya6900
Memory allocationMemory allocation
Memory allocation
sanya69001.7K views
Scalable up genomic analysis with ADAM by fnothaft
Scalable up genomic analysis with ADAMScalable up genomic analysis with ADAM
Scalable up genomic analysis with ADAM
fnothaft1.2K views

More from Yasuo Tabei

Space-efficient Feature Maps for String Alignment Kernels by
Space-efficient Feature Maps for String Alignment KernelsSpace-efficient Feature Maps for String Alignment Kernels
Space-efficient Feature Maps for String Alignment KernelsYasuo Tabei
253 views15 slides
SISAP17 by
SISAP17SISAP17
SISAP17Yasuo Tabei
325 views32 slides
Scalable Partial Least Squares Regression on Grammar-Compressed Data Matrices by
Scalable Partial Least Squares Regression on Grammar-Compressed Data MatricesScalable Partial Least Squares Regression on Grammar-Compressed Data Matrices
Scalable Partial Least Squares Regression on Grammar-Compressed Data MatricesYasuo Tabei
4.4K views26 slides
Kdd2015reading-tabei by
Kdd2015reading-tabeiKdd2015reading-tabei
Kdd2015reading-tabeiYasuo Tabei
1.1K views18 slides
NIPS2013読み会: Scalable kernels for graphs with continuous attributes by
NIPS2013読み会: Scalable kernels for graphs with continuous attributesNIPS2013読み会: Scalable kernels for graphs with continuous attributes
NIPS2013読み会: Scalable kernels for graphs with continuous attributesYasuo Tabei
8.3K views22 slides
GIW2013 by
GIW2013GIW2013
GIW2013Yasuo Tabei
1.1K views26 slides

More from Yasuo Tabei(17)

Space-efficient Feature Maps for String Alignment Kernels by Yasuo Tabei
Space-efficient Feature Maps for String Alignment KernelsSpace-efficient Feature Maps for String Alignment Kernels
Space-efficient Feature Maps for String Alignment Kernels
Yasuo Tabei253 views
Scalable Partial Least Squares Regression on Grammar-Compressed Data Matrices by Yasuo Tabei
Scalable Partial Least Squares Regression on Grammar-Compressed Data MatricesScalable Partial Least Squares Regression on Grammar-Compressed Data Matrices
Scalable Partial Least Squares Regression on Grammar-Compressed Data Matrices
Yasuo Tabei4.4K views
Kdd2015reading-tabei by Yasuo Tabei
Kdd2015reading-tabeiKdd2015reading-tabei
Kdd2015reading-tabei
Yasuo Tabei1.1K views
NIPS2013読み会: Scalable kernels for graphs with continuous attributes by Yasuo Tabei
NIPS2013読み会: Scalable kernels for graphs with continuous attributesNIPS2013読み会: Scalable kernels for graphs with continuous attributes
NIPS2013読み会: Scalable kernels for graphs with continuous attributes
Yasuo Tabei8.3K views
WABI2012-SuccinctMultibitTree by Yasuo Tabei
WABI2012-SuccinctMultibitTreeWABI2012-SuccinctMultibitTree
WABI2012-SuccinctMultibitTree
Yasuo Tabei4.3K views
Mlab2012 tabei 20120806 by Yasuo Tabei
Mlab2012 tabei 20120806Mlab2012 tabei 20120806
Mlab2012 tabei 20120806
Yasuo Tabei2.8K views
Ibisml2011 06-20 by Yasuo Tabei
Ibisml2011 06-20Ibisml2011 06-20
Ibisml2011 06-20
Yasuo Tabei896 views
Gwt presen alsip-20111201 by Yasuo Tabei
Gwt presen alsip-20111201Gwt presen alsip-20111201
Gwt presen alsip-20111201
Yasuo Tabei631 views
Lgm pakdd2011 public by Yasuo Tabei
Lgm pakdd2011 publicLgm pakdd2011 public
Lgm pakdd2011 public
Yasuo Tabei995 views
Gwt sdm public by Yasuo Tabei
Gwt sdm publicGwt sdm public
Gwt sdm public
Yasuo Tabei2.6K views
Lgm saarbrucken by Yasuo Tabei
Lgm saarbruckenLgm saarbrucken
Lgm saarbrucken
Yasuo Tabei1.2K views
Sketch sort sugiyamalab-20101026 - public by Yasuo Tabei
Sketch sort sugiyamalab-20101026 - publicSketch sort sugiyamalab-20101026 - public
Sketch sort sugiyamalab-20101026 - public
Yasuo Tabei632 views
Sketch sort ochadai20101015-public by Yasuo Tabei
Sketch sort ochadai20101015-publicSketch sort ochadai20101015-public
Sketch sort ochadai20101015-public
Yasuo Tabei1.4K views

Recently uploaded

MVP and prioritization.pdf by
MVP and prioritization.pdfMVP and prioritization.pdf
MVP and prioritization.pdfrahuldharwal141
39 views8 slides
Future of AR - Facebook Presentation by
Future of AR - Facebook PresentationFuture of AR - Facebook Presentation
Future of AR - Facebook PresentationRob McCarty
54 views27 slides
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or... by
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...ShapeBlue
128 views20 slides
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f... by
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...TrustArc
130 views29 slides
Confidence in CloudStack - Aron Wagner, Nathan Gleason - Americ by
Confidence in CloudStack - Aron Wagner, Nathan Gleason - AmericConfidence in CloudStack - Aron Wagner, Nathan Gleason - Americ
Confidence in CloudStack - Aron Wagner, Nathan Gleason - AmericShapeBlue
58 views9 slides
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue by
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlueVNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlueShapeBlue
134 views54 slides

Recently uploaded(20)

Future of AR - Facebook Presentation by Rob McCarty
Future of AR - Facebook PresentationFuture of AR - Facebook Presentation
Future of AR - Facebook Presentation
Rob McCarty54 views
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or... by ShapeBlue
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
ShapeBlue128 views
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f... by TrustArc
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc130 views
Confidence in CloudStack - Aron Wagner, Nathan Gleason - Americ by ShapeBlue
Confidence in CloudStack - Aron Wagner, Nathan Gleason - AmericConfidence in CloudStack - Aron Wagner, Nathan Gleason - Americ
Confidence in CloudStack - Aron Wagner, Nathan Gleason - Americ
ShapeBlue58 views
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue by ShapeBlue
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlueVNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue
ShapeBlue134 views
Why and How CloudStack at weSystems - Stephan Bienek - weSystems by ShapeBlue
Why and How CloudStack at weSystems - Stephan Bienek - weSystemsWhy and How CloudStack at weSystems - Stephan Bienek - weSystems
Why and How CloudStack at weSystems - Stephan Bienek - weSystems
ShapeBlue172 views
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue by ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
ShapeBlue75 views
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue by ShapeBlue
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlueCloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue
ShapeBlue68 views
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue by ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlueWhat’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
ShapeBlue191 views
Keynote Talk: Open Source is Not Dead - Charles Schulz - Vates by ShapeBlue
Keynote Talk: Open Source is Not Dead - Charles Schulz - VatesKeynote Talk: Open Source is Not Dead - Charles Schulz - Vates
Keynote Talk: Open Source is Not Dead - Charles Schulz - Vates
ShapeBlue178 views
Extending KVM Host HA for Non-NFS Storage - Alex Ivanov - StorPool by ShapeBlue
Extending KVM Host HA for Non-NFS Storage -  Alex Ivanov - StorPoolExtending KVM Host HA for Non-NFS Storage -  Alex Ivanov - StorPool
Extending KVM Host HA for Non-NFS Storage - Alex Ivanov - StorPool
ShapeBlue56 views
Migrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlue by ShapeBlue
Migrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlueMigrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlue
Migrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlue
ShapeBlue147 views
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive by Network Automation Forum
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveAutomating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Live Demo Showcase: Unveiling Dell PowerFlex’s IaaS Capabilities with Apache ... by ShapeBlue
Live Demo Showcase: Unveiling Dell PowerFlex’s IaaS Capabilities with Apache ...Live Demo Showcase: Unveiling Dell PowerFlex’s IaaS Capabilities with Apache ...
Live Demo Showcase: Unveiling Dell PowerFlex’s IaaS Capabilities with Apache ...
ShapeBlue52 views
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ... by ShapeBlue
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...
ShapeBlue48 views

SPIRE2013-tabei20131009

  • 1. 20th String Processing and Information Retrieval (SPIRE2013), Jerusalem, Israel, October 9th, 2013 Fully-Online Grammar Compression Yasuo Tabei (PREST, JST) Collaboration with Shirou Maruyama (PFI, Inc) Hiroshi Sakamoto (Kyutech) Kunihiko Sadakane (NII)
  • 2. Motivation • Large-scale and highly repetitive text collections have become ubiquitous – Personal genomes, version controlled documents, source codes in repository, reports by studentsnew • Repair = representative grammar compression – Not applicable to large-scale repetitive texts • Present a scalable grammar compression
  • 3. Straight Line Program (SLP) • Canonical form of a CFG deriving a single string • Every production rule satisfies – Right-hand side is a digram – Subscripts of the left symbol is larger than subscripts of the right symbols X5 Example: aabbabb X1➝ab X2➝X1a X3➝X1X2 X4➝X3X2 X2 a X4 X1 ab b X3 b X1 ab
  • 4. Straight Line Program (SLP) • Canonical form of a CFG deriving a single string • Every production rule satisfies – Right-hand side is a digram – Subscripts of the left symbol is larger than subscripts of the right symbols X5 Example: aabbabb N:text length X1➝ab X2➝X1a n X3➝X1X2 X4➝X3X2 X2 a X4 X1 ab h: b height X3 b X1 ab
  • 5. Grammar Compression (GC) • Build a small CFG from an input string – Size n = number of production rules • Two crucial data structures 1. Dictionary : Given Xk, returns XiXj for Xk ➝ XiXj - Array : 2nlgn bits 2. Reverse dictionary: Given XiXj, return Xk - Hash table : O(nlgn) bits X1➝ab X2➝X1a X3➝X1X2 X4➝X3X2 Access : Xk ➝ A[2k-1][2k]
  • 6. Existing grammar compression • Compression time and working space are important for scalability • Online LCA (OLCA) [CCP,2011] = efficient GC Compression Method time CCP,2011 O(N/α) SPIRE,2012 O(N/α) CPM,2013 O(Nlgn) Working space (bits) (3+α)nlgn (11/4+α nlgn 2nlgn(1+o(1))+2nlgp (p << √n) • Drawbacks : they need a large working space • Challenge : developing fast GC of smaller working space
  • 7. Fully-Online LCA (FOLCA) Direct encoding of an SLP SLP (Parse Tree) Text abaababa Partial Parse Tree Succinct Representation 12345678910 B:0010101011 L:abaX1X2 P:123469 • Smaller working space : (1+α)nlgn+n(3+lg(αn)) bits • Optimal encoding: lgn+2n+o(n) bits – Almost equal to the lower bound [CPM,2013]
  • 8. Menu • Review of Online LCA • FOLCA • Compressed hash table for smaller working space • Substring extractions • Experiments
  • 9. Basic idea of OLCA • Replace the same pairs of symbols in common substrings by the same non-terminal symbols as many as possible • Build 2-trees or 2-2-trees X2 X1 X2 X2 X3 X4 X1 X3 X4 X1 a b r a k a d a b r a k a d a b r common substrings • Iterate this procedure to novel non-terminal symbols until it builds a single parse tree
  • 10. Land mark : local feature decided by a triple of symbols ABC • B is a landmark if B belongs to one of the following : i) repetitive: A = B = C, ii) maximum: A < B > C, iii) minimum: A > B < C • Enable an bottom up construction of a parse tree in an online manner • Build a parse subtree from a sequence of symbols of length four i)B is a landmark Z ii) Otherwise Z Y ABCD A B C D
  • 11. Online construction of a parse tree • Use a queue corresponding to each level of a parse tree • Read a character, build a subtree in each queue, and enqueue a non-terminal symbol of the root to the higher queue (i) q1 is land mark enqueue z Qi+1 (ii) Otherwise z Qi+1 z z y Qi q0 q1 q2 q3 q0q1 Qi q0 q1 q2 q3 dequeue q0q1q2 enqueue dequeue
  • 12. Demonstration of OLCA Q3 d X3 1 2 d X1 X1 b X2 1 2 4 Rules X1→aa X2→ab X3→X1X1 3 4 5 Q2 3 5 Q1 Input string d 1 a a a a b a b a a a a b 2 3 4 5 Courtesy by Shirou Maruyama
  • 13. Efficiency of OLCA • The approximation ratio : O(lg2N) • Compression time : O(N/α) • Working space : (3 + α)nlgn bits • Parse tree is balanced and its height is h = O(lgN)
  • 14. Fully-Online LCA (FOLCA) • Build post-order partial parse tree (POPPT) – Partial parse tree whose internal nodes have postorder variables Parse tree POPPT • Enable direct encoding to a post-order succinct tree : nlgn + 2n + o(n) bits
  • 15. Online construction of POPPT • A replacing pair in queues are shifted to the right position of OLCA (i) q1 is land mark enqueue z Qi+1 (ii) otherwise enqueue z Qi+1 z z y Qi q0 q1 q2 q3 q4 q0q1 Qi q0 q1 q2 q3 q4 dequeue q0q1q2 dequeue • Approximation ratio is the same as that of OLCA
  • 16. Succinct encoding of POPPT • FOLCA builds POPPT in an online manner, it encodes the POPPT into dynamic RMM tree [Sadakane and Navarro,2009] – ‘0’ for a leaf and ‘1’ for an internal node – L : a label sequence for leaves POPPT Succinct tree B : 0010101011 L : abaX1X2 nlgn + 2n + o(n) bits • Simulate tree operations using rank/select dictionary : random access to Xk ➝ XiXj
  • 17. Compression of reverse dictionary : Given XiXj, it returens Xk for Xk➝XiXj • Implemented as chaining hash table – αnlgn bits for the table, n(1+α)lgn bits for the lists (α: load factor of hash table) • Observation : FOLCA generates post-order variables in increasing order – Variables in each list can be organized in increasing order. • Compress each list by gap-encoding and the delta code • Space : (1+α)nlgn + n(3+lg(αn)) bits • Access time : O(1/α)
  • 18. Substring extraction • Keep the starting position of the substring encoded by each variable Xi in position array P – Naïve representation : nlgN bits • Observation : position array is a monotonically increasing sequence [Grossi et al., 2003] • nlg(N/n)+3n+o(n) bits • Extraction time of a substring of length l is O(l+h) P Increasing
  • 19. Experiments • Ecoli (108MB) and kernel texts (247MB) from repetitive collections in pizza & chili corpus • Evaluate compression time, working space and substring extraction time • Compare FOLCA with LZend [Kreft and Navarro’10] • Applicability to 100 human genomes (300GB)
  • 20. Compression time and working space for the Ecoli text FOLCA: Spaces for hash table (H) dictionary (D) and position array (P) load H+D H+D+P factor time (sec) H (MB) (MB) (MB) 0.01 1,328 23 45 50 0.05 728 37 59 64 0.1 553 48 70 75 0.3 416 65 87 92 0.5 408 90 112 117 LZend time (sec) space (MB) 2,217 2,410
  • 21. Compression time and working space for the kernel text FOLCA: Spaces for hash table (H) dictionary (D) and position array (P) load H+D H+D+P factor time (sec) H (MB) (MB) (MB) 0.01 2,891 11 21 23 0.05 2,071 13 23 25 0.1 1,472 16 26 28 0.3 951 30 40 42 0.5 882 42 52 54 LZend time (sec) space (MB) 4,547 4,653
  • 22. Substring extraction time and working space for the kernel text Time [sec] Length 101 102 103 104 105 FOLCA LZend 0.00007 0.00026 0.00224 0.02176 0.21328 0.00002 0.00011 0.00100 0.00954 0.09215 Working space [MB] FOLCA 12 LZend 14
  • 23. Compression size for 100 human genomes (300GB)
  • 24. Compression time for 100 human genomes (300GB)
  • 25. Summary of FOLCA • Directly encode an SLP into a succinct representation of nlgn+2n+o(o) bits • Asymptotically equivalent to the information theoretic lower bound [CPM,2013] • Compressed hash table for small working space of (1+α)nlgn+n(3+lg(αn)) bits • Support substring extraction in O(l+h) time using additional space of nlg(N/n)+3n+o(n) bits