arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2308.04041cs.AIcs.CL
收藏

InfeRE:通过推理链逐步生成正则表达式

InfeRE: Step-by-Step Regex Generation via Chain of Inference

Shanghai Jiao Tong University(上海交通大学)

Shuai Zhang, Xiaodong Gu, Yuting Chen, Beijun Shen

AI总结:

本文提出 InfeRE 范式,将正则表达式生成分解为逐步推理链,并引入自一致性解码机制,在 NL-RX-Turk 和 KB13 数据集上显著超越现有方法。

摘要:

从自然语言描述自动生成正则表达式(简称 regexes,即 NL2RE)已成为一个新兴的研究领域。以往的研究将正则表达式视为线性的 token 序列,并以自回归方式在单次生成中产生最终表达式。它们没有考虑最终结果背后的逐步内部文本匹配过程。这显著阻碍了神经语言模型在正则表达式生成上的有效性和可解释性。在本文中,我们提出了一种名为 InfeRE 的新范式,它将正则表达式的生成分解为逐步推理链。为了增强鲁棒性,我们引入了一种自一致性解码机制,该机制集成从不同模型采样的多个输出。我们在两个公开可用的数据集 NL-RX-Turk 和 KB13 上评估了 InfeRE,并将结果与最先进的方法以及流行的基于树的生成方法 TRANX 进行了比较。实验结果表明,InfeRE 大幅优于之前的基线,在两个数据集上的 DFA@5 准确率分别提高了 16.3% 和 14.7%。特别是,在 DFA@5 准确率方面,InfeRE 在两个数据集上分别比流行的基于树的生成方法高出 18.1% 和 11.3%。

英文摘要:

Automatically generating regular expressions (abbrev. regexes) from natural language description (NL2RE) has been an emerging research area. Prior studies treat regex as a linear sequence of tokens and generate the final expressions autoregressively in a single pass. They did not take into account the step-by-step internal text-matching processes behind the final results. This significantly hinders the efficacy and interpretability of regex generation by neural language models. In this paper, we propose a new paradigm called InfeRE, which decomposes the generation of regexes into chains of step-by-step inference. To enhance the robustness, we introduce a self-consistency decoding mechanism that ensembles multiple outputs sampled from different models. We evaluate InfeRE on two publicly available datasets, NL-RX-Turk and KB13, and compare the results with state-of-the-art approaches and the popular tree-based generation approach TRANX. Experimental results show that InfeRE substantially outperforms previous baselines, yielding 16.3% and 14.7% improvement in DFA@5 accuracy on two datasets, respectively. Particularly, InfeRE outperforms the popular tree-based generation approach by 18.1% and 11.3% on both datasets, respectively, in terms of DFA@5 accuracy.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑