ROUGE Scores › ROUGE-W: Weighted Longest Common Subsequence

Michael BrenndoerferFebruary 23, 20267 min read
Language AI HandbookAll chapters
Part 53 of 67Evaluation Fundamentals
Chapter 408ROUGE Scores › ROUGE-W: Weighted Longest Common Subsequence
Reading section 4 of 13 · ROUGE-W: Weighted Longest Common Subsequence · 7 minSection 4 of 13 · 7 min

Book contents

Section 4 of 13 · 7 min read

ROUGE Scores › ROUGE-W: Weighted Longest Common SubsequenceOne section · Sections in this chapter4 / 13 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

Standard LCS treats all matching subsequences equally, regardless of whether the matches are consecutive or scattered. However, consecutive matches are linguistically more significant than scattered ones. "The quick brown fox" is a better match than "The fox quick brown" even if both have the same LCS length with a reference. The first preserves syntactic structure and readability, while the second is jumbled and confusing.

This limitation of standard LCS becomes apparent with a concrete example. Suppose the reference is "The committee approved the budget proposal after extended debate." Candidate A reads "The committee approved the proposal after debate" (two words omitted, but contiguous phrasing preserved). Candidate B reads "The committee debate after budget approved the proposal" (all words present but scrambled). Both candidates might reach the same LCS length relative to the reference, because LCS allows arbitrary gaps. But Candidate A is clearly better: it reads naturally and conveys the right meaning. Candidate B is in effect incomprehensible. Standard ROUGE-L would not distinguish between them.

ROUGE-W addresses this by introducing a weighting function that favors consecutive matches. The weighted LCS (WLCS) applies a penalty to gaps in the matching sequence. This keeps fragmented matches contribute less to the final score than cohesive blocks of text.

The Weighting Function

The standard ROUGE-W implementation uses a weight function that grows faster than linear with consecutive matches. For a consecutive sequence of length kk, the weight is often computed as:

w(k)=kαw(k) = k^\alpha

where:

  • kk: the length of a consecutive matching sequence
  • α\alpha: an exponent greater than 1 (typically α=1.2\alpha = 1.2 or 22), so consecutive matches contribute disproportionately more to the score than scattered matches

For example, with α=2\alpha = 2:

  • A consecutive match of 4 words contributes 42=164^2 = 16 to the score
  • Four scattered single-word matches contribute 4×12=44 \times 1^2 = 4 to the score

The superlinear weighting means that keeping matches together is worth far more than spreading them out. A system that produces a two-word consecutive match and another two-word consecutive match scores 22+22=82^2 + 2^2 = 8, whereas the same four words scattered individually score 4×1=44 \times 1 = 4. This creates an incentive for the evaluated summary to use reference phrasing in cohesive chunks rather than picking up scattered words.

The WLCS dynamic programming algorithm modifies the standard LCS recurrence to account for these weights, favoring paths that keep matches consecutive. The key modification is tracking the LCS length and the current consecutive run length. When calculating the optimal subsequence, the algorithm must now consider whether words match and whether continuing a consecutive sequence yields higher weight than starting a new scattered match. The recurrence becomes:

WLCS(i,j)={WLCS(i−1,j−1)+w(c(i,j))if xi=yjmax⁡(WLCS(i−1,j), WLCS(i,j−1))otherwise\text{WLCS}(i, j) = \begin{cases} \text{WLCS}(i-1, j-1) + w(c(i,j)) & \text{if } x_i = y_j \\ \max(\text{WLCS}(i-1, j),\ \text{WLCS}(i, j-1)) & \text{otherwise} \end{cases}

where c(i,j)c(i,j) is the length of the current consecutive run ending at positions ii and jj. The algorithm tracks this run length alongside the WLCS value, incrementing it on diagonal moves and resetting it on horizontal or vertical moves.

Out[4]:
Visualization
Two side-by-side bar charts showing weight contribution. Left bar (consecutive) reaches 16, right bar (scattered) reaches 4, with alpha equals 2.
Comparison of ROUGE-W weight contributions for consecutive versus scattered word matches. With exponent alpha equals 2, four consecutive matching words (left) contribute weight 16, while four scattered single-word matches (right) contribute only weight 4. The superlinear weighting strongly rewards cohesive phrase alignment.

When to Use ROUGE-W

ROUGE-W is particularly useful in several situations. It shines when fluency matters: you want to penalize summaries that have the right words but in jumbled order. In applications like headline generation or keyphrase extraction, where the output must read naturally, ROUGE-W gives better discrimination than standard ROUGE-L.

ROUGE-W is also appropriate for extractive summarization evaluation. When the system selects sentences from the source, consecutive matches indicate proper sentence extraction. If a system extracts a full sentence verbatim, ROUGE-W rewards it heavily; if it extracts scattered fragments, it receives a lower score despite potentially having the same LCS length. This makes ROUGE-W align better with human judgments in extractive settings.

For short summaries such as single-sentence summaries, word order carries more semantic weight. In longer documents, a few misplaced words might not obscure the meaning, but in a one-sentence summary, "Dogs eat cats" versus "Cats eat dogs" is a catastrophic error that ROUGE-W catches better than ROUGE-L.

However, ROUGE-W is less commonly used than ROUGE-1, ROUGE-2, and ROUGE-L in standard benchmark reporting, partly because the weighting parameter α\alpha requires tuning and complicates comparisons across studies. Without standardized values for α\alpha, scores become incomparable between papers, undermining the metric's utility as a universal benchmark. The practical field has largely settled on ROUGE-1, ROUGE-2, and ROUGE-L as the canonical trio, with ROUGE-W appearing primarily in specialized studies.

Out[5]:
Visualization
Diagram showing reference tokens with four scattered green words and candidate tokens below, connected by dashed alignment lines.
Illustration of scattered versus consecutive matching in ROUGE-W. The reference tokens appear on top; the four matched tokens (green) are scattered across the reference at positions 0, 3, 5, and 8, creating four isolated single-word matches. The candidate row shows the same four words pulled together, with dashed lines showing their original positions in the reference. This scatter pattern yields weight 4 under alpha equals 2, compared to weight 16 for a four-word consecutive match.