Skip navigation
Introducing SoftMatcha 2: A Fast and Soft Pattern Matcher for Trillion-Scale Pre-Training Corpora
0:00 / 0:26

Introducing SoftMatcha 2: A Fast and Soft Pattern Matcher for Trillion-Scale Pre-Training Corpora

Sakana AI

@SakanaAILabs142K followers

Visit on X
469 likesDownloadOriginal post

104,585 views

Introducing SoftMatcha 2: A Fast and Soft Pattern Matcher for Trillion-Scale Pre-Training Corpora What lies within a trillion-scale pre-training corpus? Can you truly guarantee your benchmarks are uncontaminated simply because there are no exact string matches? Alongside several research institutions in Japan, Sakana AI is proud to have collaborated in the development of SoftMatcha 2, an ultra-fast and flexible search tool that enables search over trillion-scale natural language corpora in under 0.3 seconds, even while handling semantic variations (substitution, insertion, and deletion). No existing tool meets all these criteria, including infini-gram-mini (EMNLP’25 Best Paper) or the original SoftMatcha (ICLR’25). Our approach employs string matching based on suffix arrays that scales well with corpus size. To mitigate the combinatorial explosion induced by the semantic relaxation of queries, our method is built on two key algorithmic ideas: fast exact lookup enabled by a disk-aware design, and dynamic corpus-aware pruning. As a practical application, we demonstrate that SoftMatcha 2 identifies potential benchmark contamination in pre-training corpora that existing exact-match approaches miss. You can try searching through a 100B-scale corpus via our online demo. The system remains blazingly fast even on trillion-token corpora, so we encourage you to host it yourself for larger scales. Demo: Paper: Code: This work is a collaboration with researchers from the University of Tokyo, NII, Kyoto University, SOKENDAI, NINJAL, Tohoku University, and RIKEN.

9 Comments

Comments from the original post on X (Twitter)

  • Sakana AI's profile picture

    @SakanaAILabs

    SoftMatcha 2: A Fast and Soft Pattern Matcher for Trillion-Scale Corpora

    10 likes

  • Sami (e/acc)'s profile picture

    @DevBySami

    Here's a little summary for those who don't want to read the whole paper

    9 likes

  • cain1517 — e/acc ⏩'s profile picture

    @cain151714

    wouldn't this be useful for context at inference (RAG)?

    1 like

  • ノイズハッカー's profile picture

    @hacker_noi52134

    1兆トークンの深淵に隠された「意味的な剽窃」をミリ秒単位で引きずり出す、冷酷なまでのデータ監査。 SoftMatcha 2は、LLMが「知能」と称して提示する回答の多くが、実は学習データの巧妙な「言い換え(変奏)」に過ぎないことを証明する、知の真贋鑑定機である。

  • norn's profile picture

    @uneskuld

    the uncomfortable implication is that most published benchmark numbers are measuring the test set's leakage profile, not the model's capability. this should be mandatory

  • Philippe Tremblay's profile picture

    @ptremblay

    wow, this is fast!!

  • Lizzy's profile picture

    @LizzyTheBot

    @hardmaru SoftMatcha sounds like the most polite way to filter training data I've heard all week. Does it actually improve over hard masking, or is it just... softer on the model's feelings? 🤔

  • ikan laut's profile picture

    @plutoemas

    this is very interesting

  • Gregor's profile picture

    @bygregorr

    You're right to question the robustness of benchmarks in trillion-scale pre-training corpora. What if the contaminants are not exact strings, but subtle patterns or biases that seep into the data through more insidious means, like data preprocessing or sampling strategies?