ROUGE Scores › ROUGE-L: Longest Common Subsequence
Language AI HandbookAll chapters ROUGE Scores › ROUGE-L: Longest Common SubsequenceOne section · Sections in this chapter3 / 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
While n-gram recall is intuitive, it has a significant limitation: it requires exact n-gram matches. If a candidate summary uses synonymous phrases or slightly reorders words, ROUGE-N treats these as complete failures even when the meaning is preserved. Consider a reference stating "The President announced new economic policies yesterday" and a candidate reading "Yesterday, the President announced new economic policies." A human would recognize these as nearly identical in meaning, but ROUGE-2 would score them poorly because the word "yesterday" has moved, breaking the bigrams "policies yesterday" and introducing "Yesterday the" which does not appear in the reference.
This fragility of n-gram windows motivates a more flexible matching approach. Rather than requiring words to appear in fixed-size windows, what if we could find the longest chain of words that appears in both texts, in the same order, regardless of what other words intervene? This is precisely the idea behind the Longest Common Subsequence.
ROUGE-L addresses this by using the Longest Common Subsequence (LCS). A subsequence is a sequence that appears in the same relative order but not necessarily consecutively. For example, "the cat sat" is a subsequence of "the fluffy cat lazily sat," while "cat the" is not (wrong order). The LCS finds the longest chain of words that appears in both texts while maintaining sequence integrity. It offers flexibility that rigid n-gram windows cannot give.
The LCS is computed using dynamic programming in time, where and are the lengths of the two sequences. The algorithm builds a table where cell stores the length of the longest common subsequence of the first tokens of the reference and the first tokens of the candidate. If the tokens at positions and match, the LCS extends by one from the diagonal cell; otherwise it takes the maximum of the left and upper cells, representing the best LCS achievable by dropping one token from either sequence.
LCS-Based F-measure
ROUGE-L computes precision and recall based on the LCS length between candidate and reference :
where:
- : the recall based on the longest common subsequence
- : the precision based on the longest common subsequence
- : the length (in words) of the reference summary
- : the length (in words) of the candidate summary
- : the length of the longest common subsequence between candidate and reference
These are then combined into an F-measure:
where:
- : the recall based on the longest common subsequence (defined above)
- : the precision based on the longest common subsequence (defined above)
- : a parameter controlling the relative importance of precision versus recall; when is large (typically ), recall is weighted more heavily. In standard implementations, is often set such that recall is weighted more than precision (e.g., ), though many implementations use (standard F1)
The use of F-measure rather than pure recall is an important departure from ROUGE-N. Because the LCS can be short relative to the candidate length (imagine a candidate that rambles extensively but contains a small core that matches the reference), precision becomes relevant. If we only measured recall, a candidate containing the entire reference embedded in a much longer document would score perfectly, even though most of the candidate is irrelevant. The F-measure balances these concerns, rewarding summaries that efficiently capture the reference content without excessive verbosity.
Don't confuse subsequence with substring. A substring requires consecutive words, while a subsequence allows gaps. "climate change" is a substring of "addressing climate change requires action" but only a subsequence of "climate patterns are changing." ROUGE-L uses subsequence, which makes it more flexible than n-gram matching. This flexibility allows it to handle paraphrasing where words are interspersed with modifiers or where sentence structure varies between reference and candidate.
Why LCS Matters for Summarization
The LCS approach gives several advantages for summarization evaluation. Each advantage addresses a specific failure mode in n-gram-based metrics:
First, the LCS works well with sentence-level paraphrasing. If a candidate summary restructures a sentence while keeping key phrases in order, LCS records this similarity. For instance, if the reference says "The company reported record profits despite economic headwinds" and the candidate says "Despite economic headwinds, the company reported record profits," the LCS includes all major content words in the correct order, even though the sentence structure changed. The n-gram approach breaks down here because the fronting of "Despite economic headwinds" disrupts all the bigrams that cross the clause boundary.
Second, unlike n-grams which require arbitrary window sizes, LCS automatically identifies the longest matching sequence, effectively adapting to local similarity structures. It doesn't force us to choose between unigrams (too permissive) and bigrams (too strict); instead, it finds the natural alignment between texts. This adaptivity is especially useful when the summary length and structure differ materially from the reference.
Third, adding words to the candidate doesn't break the LCS calculation the way it breaks n-gram precision. If a candidate inserts "significant" before "profits" in the example above, ROUGE-2 would drop bigram matches around that insertion, but ROUGE-L would simply treat "significant" as a gap in the subsequence, preserving the rest of the match. This robustness to word insertion makes ROUGE-L more forgiving of paraphrases that add modifiers or clarifications.
