Automata and Graph Compression

Mehryar Mohri, Michael Riley, Ananda Theertha SureshISIT 2015

Abstract

We present a theoretical framework for the compression of automata, which are widely used representations in speech processing, natural language processing, and many other tasks. As a corollary, our framework further covers graph compression. We introduce a probabilistic process of graph and automata generation that is similar to stationary ergodic processes and that covers real-world phenomena. We also introduce a universal compression scheme, LZA, for this probabilistic model and show that LZA significantly outperforms other compression techniques such as gzip and the UNIX compress command for several synthetic and real data sets.

Introduction

Most contemporary compression algorithms, such as Huffman coding or the Lempel-Ziv schemes (LZ77, LZ78) used in gzip and zip, were originally designed for sequential data like text or bitstreams. However, modern data science frequently deals with structured data: web graphs where nodes are URLs and edges are links, or speech recognition lattices representing billions of possible word sequences.

When structured data is compressed using standard tools, it is typically "serialized" into a long string first. This serialization often destroys the structural patterns and topological redundancies that could make compression more efficient. The lack of a theoretical framework and a practical, "universal" algorithm that can exploit graph topology directly represents a significant gap in the field.

A simple turnstile automaton representing locked and unlocked states.

The LZA Algorithm

To address this, we introduce LZA (Lempel-Ziv for Automata). The algorithm's design is based on two primary pillars:

  1. The $\ell$-memory Probabilistic Model: Real-world automata are rarely random. Transitions leaving a state often depend on the paths that led to it, similar to $n$-gram models in natural language processing. LZA is designed to be asymptotically optimal for this "$\ell$-memory" process.
  2. Structural Dictionary Building: LZA employs a Breadth-First Search (BFS) traversal to ensure that state numbering does not affect compression, effectively handling graph isomorphism. Like LZ78, it builds a dictionary of recurring substructures—in this case, sets of transitions—rather than character sequences.
A probabilistic automaton illustrating transition probabilities.

Experimental Evaluation

LZA was evaluated against standard tools like UNIX compress (LZW) and gzip (LZ77 + Huffman) using both synthetic and real-world datasets:

  • Synthetic Data: Included Erdős-Rényi models and non-uniform out-degree models mimicking $n$-gram language models.
  • Real-World Data: Approximately 80 automata from speech recognition and NLP tasks, including large-scale language models and machine translation lattices.

Key Results

The experiments revealed that LZA is particularly effective for structured data. On synthetic "structured" automata, LZA required only 3,027 bytes, compared to 5,546 bytes for gzip. While gzip can be more efficient for very small files due to LZA's dictionary overhead, LZA consistently takes the lead once compressed sizes exceed approximately 100KB. Furthermore, a hybrid "LZA + gzip" pipeline—where LZA handles structural compression and gzip addresses bit-level redundancies—yielded the best overall performance.

Conclusion and Future Directions

LZA demonstrates that exploiting the structural "memory" of transitions allows for significantly better compression of automata and graphs than traditional sequential methods. Future work will focus on more integrated handling of complex weights and output labels in Finite State Transducers (FSTs) and optimizing the implementation for massive, multi-billion-edge graphs.

Summary updated

BibTeX
@inproceedings{mohri2015automata,
  author = {Mehryar Mohri and Michael Riley and Ananda Theertha Suresh},
  title = {{Automata and Graph Compression}},
  booktitle = {ISIT},
  year = {2015},
  url = {https://openreview.net/forum?id=F-vASgNg2oH},
}
Figure