Skip to main content
QUICK REVIEW

[Paper Review] Identifying document similarity using a fast estimation of the Levenshtein Distance based on compression and signatures

Peter Coates, Frank Breitinger|arXiv (Cornell University)|Jul 21, 2023
Topic ModelingComputer Science5 citations
TL;DR

This paper proposes a fast estimation of Levenshtein Distance (LD) for large documents by compressing them into signatures using a lossy compression algorithm, then computing LD on these compact signatures. The method achieves significant speedups—up to C² for compression ratio C—while maintaining high accuracy, especially for dissimilar documents and deletions, enabling practical similarity detection in digital forensics and plagiarism detection.

ABSTRACT

Identifying document similarity has many applications, e.g., source code analysis or plagiarism detection. However, identifying similarities is not trivial and can be time complex. For instance, the Levenshtein Distance is a common metric to define the similarity between two documents but has quadratic runtime which makes it impractical for large documents where large starts with a few hundred kilobytes. In this paper, we present a novel concept that allows estimating the Levenshtein Distance: the algorithm first compresses documents to signatures (similar to hash values) using a user-defined compression ratio. Signatures can then be compared against each other (some constrains apply) where the outcome is the estimated Levenshtein Distance. Our evaluation shows promising results in terms of runtime efficiency and accuracy. In addition, we introduce a significance score allowing examiners to set a threshold and identify related documents.

Motivation & Objective

  • Address the quadratic time complexity of exact Levenshtein Distance (LD) computation, which limits its use for large documents (e.g., >100 KB).
  • Enable practical similarity detection in digital forensics and plagiarism detection where exact LD is too slow for large-scale data.
  • Provide an approximate yet accurate estimation of LD without requiring access to original documents, using only signatures derived from compression.
  • Introduce a significance score to help examiners set thresholds for identifying related documents based on estimated LD.
  • Improve upon existing approximate matching (AM) techniques by offering a more interpretable and quantifiable similarity metric than binary or heuristic-based scores.

Proposed method

  • Compress input documents into compact signatures using a user-defined lossy compression algorithm (LCA), reducing document size by a configurable compression ratio C.
  • Generate a 'signature' that includes the compressed digest, file size, and metadata (e.g., filename), enabling document identification and size-based filtering.
  • Compute the Levenshtein Distance (LD) on the signatures instead of the original texts, leveraging the fact that signatures are orders of magnitude shorter.
  • Use the resulting LD on signatures as an estimated Levenshtein Distance (eLD), which scales approximately as C² faster than exact LD on original documents.
  • Apply constraints such as requiring documents to be within a factor of 10 in size to improve estimation accuracy, especially for deletions and insertions.
  • Introduce a significance score based on the eLD to allow examiners to set thresholds for identifying related documents, enhancing forensic usability.

Experimental results

Research questions

  • RQ1Can a lossy compression-based signature approach provide a fast and accurate estimation of Levenshtein Distance for large documents?
  • RQ2How does the estimation accuracy of eLD vary across different types of text modifications (e.g., insertions, deletions, substitutions)?
  • RQ3To what extent does document size similarity affect the reliability of the eLD estimation, and can this be mitigated with additional constraints?
  • RQ4Can the proposed method effectively detect related documents even when they contain large blocks of identical or near-identical text?
  • RQ5How does the method compare in performance and accuracy to existing approximate matching techniques in digital forensic applications?

Key findings

  • The proposed method achieves a speedup of approximately C² for a compression ratio C, enabling LD estimation on documents hundreds of times larger than feasible with exact LD.
  • Estimations are highly accurate for dissimilar documents of the same size and perform well in detecting deletions, with minimal deviation from true LD values.
  • The method maintains high accuracy when documents are of similar size (within a factor of 10), suggesting that size normalization improves estimation reliability.
  • The significance score enables examiners to set thresholds to identify related documents, enhancing practical utility in digital forensics and plagiarism detection.
  • The approach is particularly effective for medium to large texts such as books and long articles, where exact LD becomes impractical due to quadratic runtime.
  • Future work is needed to evaluate performance on binary data (e.g., compiled programs, videos) and to refine the δ calculation for improved accuracy across diverse data types.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.