Search-Based Regular Expression Inference on a GPU
Mojtaba Valizadeh, Martin Berger
摘要
Regular expression inference (REI) is a supervised machine learning and program synthesis problem that takes a cost metric for regular expressions, and positive and negative examples of strings as input. It outputs a regular expression that is precise (i.e., accepts all positive and rejects all negative examples), and minimal w.r.t. to the cost metric. We present a novel algorithm for REI over arbitrary alphabets that is enumerative and trades off time for space. Our main algorithmic idea is to implement the search space of regular expressions succinctly as a contiguous matrix of bitvectors. Collectively, the bitvectors represent, as characteristic sequences, all sub-languages of the infix-closure of the union of positive and negative examples. Mathematically, this is a semiring of (a variant of) formal power series. Infix-closure enables bottom-up compositional construction of larger from smaller regular expressions using the operations of our semiring. This minimises data movement and data-dependent branching, hence maximises data-parallelism. In addition, the infix-closure remains unchanged during the search, hence search can be staged: first pre-compute various expensive operations, and then run the compute intensive search process. We provide two C++ implementations, one for general purpose CPUs and one for Nvidia GPUs (using CUDA). We benchmark both on Google Colab Pro: the GPU implementation is on average over 1000x faster than the CPU implementation on the hardest benchmarks.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 4 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- HieraSynth: A Parallel Framework for Complete Super-Optimization with Hierarchical Space Decomposition 引用了 A Concurrent Approach to String Transformation Synthesis
- Repairing Regex-Dependent String Functions 引用了 TRANSREGEX: Multi-modal Regular Expression Synthesis by Generate-and-Repair
- TRANSREGEX: Multi-modal Regular Expression Synthesis by Generate-and-Repair 引用了 FlashRegex: Deducing Anti-ReDoS Regexes from Examples
- Scalable FSM parallelization via path fusion and higher-order speculation 引用了 Why GPUs are Slow at Executing NFAs and How to Make them Faster
引用它的顶会 Paper4
- LTL Learning on GPUsMojtaba Valizadeh, Nathanaël Fijalkow, Martin BergerCAV 2024 · 9 次引用
- A Concurrent Approach to String Transformation SynthesisYuantian Ding, Xiaokang QiuPLDI 2025 · 5 次引用
- Repairing Regex-Dependent String FunctionsNariyoshi Chida, Tachio TerauchiASE 2024 · 3 次引用
- HieraSynth: A Parallel Framework for Complete Super-Optimization with Hierarchical Space DecompositionSirui Lu, Rastislav BodíkOOPSLA 2025
它引用的 Paper5
- Rewrite rule inference using equality saturationChandrakana Nandi, Max Willsey, Amy Zhu, Yisu Remy Wang 等OOPSLA 2021 · 35 次引用
- Why GPUs are Slow at Executing NFAs and How to Make them FasterHongyuan Liu, Sreepathi Pai, Adwait JogASPLOS 2020 · 31 次引用
- FlashRegex: Deducing Anti-ReDoS Regexes from ExamplesYeting Li, Zhiwu Xu, Jialun Cao, Haiming Chen 等ASE 2020 · 17 次引用
- TRANSREGEX: Multi-modal Regular Expression Synthesis by Generate-and-RepairYeting Li, Shuaimin Li, Zhiwu Xu, Jialun Cao 等ICSE 2021 · 16 次引用
- Scalable FSM parallelization via path fusion and higher-order speculationJunqiao Qiu, Xiaofan Sun, Amir Hossein Nodehi Sabet, Zhijia ZhaoASPLOS 2021 · 16 次引用
相关 Paper
- Interleaved Bitstream Execution for Multi-Pattern Regex Matching on GPUsTianao Ge, Xiaowen Chu, Hongyuan LiuMICRO 2025 · 4 次引用
- New Regular Expressions on Old AcceleratorsJackson Woodruff, Michael F. P. O'BoyleDAC 2021 · 3 次引用
- Answering Regular Path Queries through ExemplarsKomal Chauhan, Kartik Jain, Sayan Ranu, Srikanta Bedathur 等VLDB 2022 · 7 次引用
- Generating Pragmatic Examples to Train Neural Program SynthesizersSaujas Vaduguru, Daniel Fried, Yewen PuICLR 2024 · 7 次引用
- HybridSA: GPU Acceleration of Multi-pattern Regex Matching using Bit ParallelismAlexis Le Glaunec, Lingkun Kong, Konstantinos MamourasOOPSLA 2024 · 6 次引用
