Near-Duplicate Text Alignment under Weighted Jaccard Similarity
Yuheng Zhang, Miao Qiao, Zhencan Peng, Dong Deng
Abstract
Near-duplicate text alignment is the task of identifying all subsequences (i.e., substrings) in a collection of texts that are similar to a given query. Traditional approaches rely on seeding-extension-filtering heuristics, which lack accuracy guarantees and require many hard-to-tune parameters. More recent methods leverage min-hash techniques. They propose to group all the subsequences in each text by their min-hash and index the groups. When a query arrives, they can use the index to find all the min-hash sketches that are similar to the query's sketch and then return the corresponding subsequences as the results efficiently. Thus these methods guarantee to identify all subsequences whose estimated Jaccard similarity with the query exceed a user-provided threshold. However, these methods only support unweighted Jaccard similarity, which cannot capture token importance or frequency, limiting their effectiveness in real-world scenarios where tokens carry weights, such as TF-IDF.
In this paper, we address this limitation by supporting weighted Jaccard similarity using consistent weighted sampling. We design an algorithm MonoActive to group all subsequences in a text by their consistent weighted sampling. We analyze the complexity of our algorithm. For raw count term frequency (where a token's weight is proportional to its frequency in the text), we prove MonoActive generates O ( n + n log
f T
) groups (each group occupies O (1) space) in expectation for a text with n tokens, where f T is the maximum token frequency in the text. We further prove that our algorithm is optimal, meaning that any algorithm must generate Ω( n + n log f T ) groups in expectation. Extensive experiments show that MonoActive outperforms the state-of-the-art by up to 4.7× in speed and reduces index size by up to 30%, with superior scalability.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext ed3e8db5-bf7d-4112-b838-0b8658180b84Builds on7
- Deduplicating Training Data Makes Language Models BetterKatherine Lee, Daphne Ippolito, Andrew Nystrom, Chiyuan Zhang et al.ACL 2022 · 844 citations
- Quantifying Memorization Across Neural Language ModelsNicholas Carlini, Daphne Ippolito, Matthew Jagielski, Katherine Lee et al.ICLR 2023 · 158 citations
- TxtAlign: Efficient Near-Duplicate Text Alignment Search via Bottom-k Sketches for Plagiarism DetectionZhizhi Wang, Chaoji Zuo, Dong DengSIGMOD 2022 · 14 citations
- Allign: Aligning All-Pair Near-Duplicate Passages in Long TextsWeiqi Feng, Dong DengSIGMOD 2021 · 13 citations
- Near-Duplicate Sequence Search at Scale for Large Language Model Memorization EvaluationZhencan Peng, Zhizhi Wang, Dong DengSIGMOD 2023 · 11 citations
Related papers
- Near-Duplicate Text Alignment with One Permutation HashingZhencan Peng, Yuheng Zhang, Dong DengSIGMOD 2025 · 5 citations
- LSHAlign: All-Pair Near-Duplicate Text Alignment via Locality-Sensitive HashingYuheng Zhang, Zhencan Peng, Miao Qiao, Wei Zhang et al.SIGMOD 2026
- Consistent Sampling Through Extremal ProcessPing Li, Xiaoyun Li, Gennady Samorodnitsky, Weijie ZhaoWWW 2021 · 16 citations
- Rejection Sampling for Weighted Jaccard Similarity RevisitedXiaoyun Li, Ping LiAAAI 2021 · 27 citations
- C-MinHash: Improving Minwise Hashing with Circulant PermutationXiaoyun Li, Ping LiICML 2022 · 16 citations
