NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

String Re-writing Kernel

Fan Bu, Hang Li, Xiaoyan ZhuACL 2012

Abstract

Learning for sentence re-writing is a fundamental task in natural language processing and information retrieval. In this paper, we propose a new class of kernel functions, referred to as string re-writing kernel, to address the problem. A string re-writing kernel measures the similarity between two pairs of strings, each pair representing re-writing of a string. It can capture the lexical and structural similarity between two pairs of sentences without the need of constructing syntactic trees. We further propose an instance of string re-writing kernel which can be computed efficiently. Experimental results on benchmark datasets show that our method can achieve better results than state-of-the-art methods on two sentence re-writing learning tasks: paraphrase identification and recognizing textual entailment.

Introduction

In Natural Language Processing (NLP), determining if two sentences are paraphrases or if one entails the other is a core challenge. Historically, researchers have used two main approaches:

  1. Lexical methods: These look at word overlap (bag-of-words). They are fast but ignore sentence structure (e.g., "The dog bit the man" vs. "The man bit the dog").
  2. Syntactic methods: These rely on dependency trees or parse trees. While they capture structure, they are computationally expensive and highly sensitive to errors made by the parser.

The String Re-writing Kernel (SRK) addresses the gap between these two by capturing the structural "essence" of a sentence transformation without the overhead and fragility of full syntactic parsing.

Methodology

The authors introduce the String Re-writing Kernel (SRK). Instead of comparing two strings directly, an SRK compares two pairs of strings. It defines similarity based on the number of common "re-writing rules" that can be applied to both pairs.

Illustration of a re-writing rule template (A) and a concrete example (B) showing active-to-passive transformation.

The kb-SRK Instance

Because calculating every possible re-writing rule is computationally intractable, the authors propose a specific version called the k-gram bijective SRK (kb-SRK). Its key features include:

  • Fixed Length: It looks at patterns of length k.
  • Wildcards: It uses wildcards (placeholders) to represent flexible parts of a sentence.
  • Bijective Mapping: It enforces a one-to-one relationship between wildcards in the source and target strings, ensuring the structural "logic" of the re-writing is preserved.
Representation of bijective mapping between wildcards in the kb-SRK instance.

Efficient Computation

The paper provides an algorithm that avoids explicitly calculating high-dimensional feature vectors. By transforming the problem into "lists of doubles" (pairs of characters from the source and target), they reduce the complexity to $O(kn^2)$, where $n$ is the sentence length. This makes it practical for real-world applications.

Experimental Setup

The researchers evaluated their method on two standard benchmarks:

  • MSR Paraphrase Corpus (MSRP): A dataset of 5,801 sentence pairs from news articles, labeled as paraphrases or not.
  • RTE-3 (Recognizing Textual Entailment): A dataset where the goal is to determine if a "hypothesis" sentence can be logically inferred from a "premise" sentence. They supplemented this with data from RTE-1 and RTE-2 for training.

Key Results

  • Paraphrase Identification: On the MSRP dataset, the kb-SRK achieved an accuracy of 76.3%, outperforming previous state-of-the-art models, including those using complex syntactic trees.
  • Textual Entailment: On RTE-3, the method reached 65.1% accuracy. This is particularly impressive because it outperformed many systems that involve significantly more "feature engineering" and external semantic resources.
  • Synergy with Lexical Features: The authors found that combining SRK with simple unigram precision/recall (PR) features led to the best performance, suggesting that SRK captures structural nuances that simple word-counting misses.

Discussion

The "aha moment" of this work is treating the relationship between two sentences as the primary object of study. By comparing $(S_1, T_1)$ to $(S_2, T_2)$, the model learns what a "good" transformation looks like across different contexts. The use of wildcards and bijective mapping allows the model to capture structural similarity (like active-to-passive voice changes) purely through string manipulation, bypassing the need for a separate syntactic parser. This makes the method robust to informally written text where traditional parsers often fail.

Conclusion

The String Re-writing Kernel offers a powerful and efficient alternative to syntactic parsing for sentence re-writing tasks. While performance is sensitive to window size $k$ and doesn't inherently capture deep semantics (like synonyms) without external resources, its ability to model structure through string manipulation marks a significant advancement in NLP kernel methods.

Summary updated

BibTeX
@inproceedings{bu2012string,
  author = {Fan Bu and Hang Li and Xiaoyan Zhu},
  title = {{String Re-writing Kernel}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2012},
  url = {https://openreview.net/forum?id=SJW_0ig_WS},
}
Figure