Inferensys

Glossary

LexRank

A graph-based extractive summarization algorithm that computes sentence importance based on eigenvector centrality in a similarity graph.
Engineer reviewing vector database search results on laptop, embeddings visualization on screen, home office coding session.
EXTRACTIVE SUMMARIZATION

What is LexRank?

LexRank is a stochastic, graph-based algorithm for extractive text summarization that computes sentence importance using eigenvector centrality within a sentence similarity graph.

LexRank is an unsupervised, graph-based approach to extractive summarization inspired by Google's PageRank. It models a document as a fully connected graph where vertices represent sentences and edge weights represent pairwise cosine similarity between TF-IDF vector representations. The algorithm computes eigenvector centrality to identify the most salient sentences, selecting those that are both highly central and minimally redundant to form the summary.

The algorithm applies a stochastic threshold to the similarity matrix, retaining only connections above a user-defined cosine threshold, which introduces randomness and prevents the graph from being fully connected. A degree centrality computation or a power method iteration over the similarity matrix then ranks sentences. To ensure diversity, LexRank employs a greedy maximum marginal relevance (MMR) post-processing step, penalizing sentences too similar to those already selected.

Graph-Based Extractive Summarization

Key Features of LexRank

LexRank is a stochastic, graph-based algorithm for extractive summarization that computes sentence importance using eigenvector centrality, modeled after Google's PageRank but applied to intra-document sentence similarity graphs.

01

Eigenvector Centrality for Salience

LexRank models a document as a similarity graph where vertices represent sentences and edges are weighted by TF-IDF cosine similarity. It then applies eigenvector centrality—the same mathematical principle behind PageRank—to compute a stationary distribution over sentences. A sentence is deemed salient not merely by its own content, but by the number and importance of other sentences that are similar to it. This captures the intuition that a central, representative sentence will be heavily connected within the graph. The algorithm computes the principal eigenvector of the sentence adjacency matrix, yielding a probability distribution where higher scores indicate greater centrality to the document's core themes.

PageRank-Inspired
Mathematical Foundation
TF-IDF Cosine
Similarity Metric
02

Stochastic Thresholding for Diversity

To prevent the summary from being dominated by a single highly-connected cluster of near-duplicate sentences, LexRank incorporates a stochastic selection process. After computing the stationary distribution, sentences are selected using a greedy algorithm with a cosine similarity threshold. Once a sentence is chosen for the summary, all sentences too similar to it are temporarily suppressed. This threshold is applied stochastically, meaning the algorithm can produce different summaries on different runs, introducing controlled diversity. This mechanism directly addresses the Maximum Marginal Relevance (MMR) trade-off between centrality and redundancy without requiring an explicit query.

Stochastic
Selection Method
Redundancy-Aware
Key Property
03

Degree Centrality Baseline

The original LexRank paper by Erkan and Radev (2004) defines a simpler variant called Degree Centrality LexRank. Instead of computing the principal eigenvector, this baseline simply counts the number of sentences that exceed a similarity threshold for each candidate. The sentence with the highest degree—the most neighbors in the similarity graph—is selected first. While computationally cheaper, this method lacks the recursive reinforcement of eigenvector centrality, where a sentence gains importance from being similar to other important sentences. The full eigenvector method consistently outperforms degree centrality on ROUGE evaluation benchmarks.

O(n²)
Computational Complexity
Baseline Variant
Degree Centrality
04

Multi-Document Summarization

LexRank naturally extends to multi-document summarization by constructing a unified similarity graph across all sentences from all source documents. In this cross-document graph, sentences from different documents that discuss the same event or fact will cluster together. The eigenvector centrality computation then identifies sentences that are representative of the entire document set, not just a single document. This makes LexRank particularly effective for tasks like timeline generation from news articles or multi-case legal synthesis, where the goal is to identify the most central facts across a corpus of related legal opinions or filings.

Cross-Document
Graph Construction
Cluster-Based
Theme Identification
05

Legal Domain Application

In legal text summarization, LexRank excels at identifying ratio decidendi—the binding legal reasoning—by surfacing sentences that are structurally central to the opinion's argument graph. Legal documents exhibit high lexical repetition and formal citation structures that create dense similarity clusters around core holdings. LexRank's graph-based approach naturally identifies these clusters. However, it is limited to extractive output only; it cannot paraphrase or synthesize novel legal conclusions. For this reason, modern legal AI pipelines often use LexRank as a pre-processing step to identify salient passages before passing them to an abstractive model for final summary generation.

Extractive Only
Output Type
Pre-Processing
Modern Role
06

Comparison to TextRank

LexRank and TextRank are both graph-based extractive summarization algorithms inspired by PageRank, but they differ in key details. TextRank uses a weighted, undirected graph with edge weights based on lexical overlap and applies a modified PageRank formula with a damping factor. LexRank uses a cosine similarity matrix with a threshold to binarize edges and computes the stationary distribution via eigenvector decomposition. LexRank's stochastic thresholding step explicitly addresses redundancy, while TextRank relies on the graph structure alone. Empirically, LexRank tends to produce more diverse summaries, while TextRank is often more computationally efficient for very large document sets.

Cosine Similarity
LexRank Edge Weight
Lexical Overlap
TextRank Edge Weight
LEXICAL PRECISION

Frequently Asked Questions

Clear, technical answers to the most common questions about LexRank, its mechanisms, and its application in legal text summarization.

LexRank is a graph-based extractive summarization algorithm that computes sentence importance using eigenvector centrality in a similarity graph. It works by first representing every sentence in a document as a TF-IDF vector in a high-dimensional space. The algorithm then calculates the cosine similarity between every pair of sentences, constructing a fully connected similarity graph where nodes are sentences and edge weights represent semantic likeness. A threshold is applied to prune weak edges, and the remaining graph is treated as a stochastic matrix. LexRank then applies a variant of the PageRank algorithm, iteratively computing the stationary distribution of a random walk over this graph. Sentences that are highly similar to many other sentences receive high centrality scores, identifying them as the most salient and representative content for the extractive summary. The final summary is assembled by selecting the top-ranked sentences, typically with a redundancy penalty like Maximum Marginal Relevance (MMR) to ensure diversity.

EXTRACTIVE SUMMARIZATION COMPARISON

LexRank vs. Other Summarization Approaches

A comparative analysis of LexRank against alternative extractive and abstractive summarization methodologies for legal document processing.

FeatureLexRankMaximum Marginal RelevanceAbstractive (BART/LED)

Summarization Paradigm

Extractive

Extractive

Abstractive

Core Mechanism

Graph-based eigenvector centrality on sentence similarity matrix

Greedy selection balancing query relevance and redundancy

Sequence-to-sequence generation with encoder-decoder Transformer

Query Independence

Generates Novel Text

Handles Multi-Document Input

Factual Consistency Guarantee

High (verbatim extraction)

High (verbatim extraction)

Low (hallucination risk)

Redundancy Handling

Implicit via centrality (diverse high-centrality nodes)

Explicit via penalty term in selection objective

Implicit via cross-attention and beam search decoding

Computational Complexity

O(n²) for similarity matrix construction

O(n²) for pairwise redundancy computation

O(n²) with quadratic self-attention; O(n) with sparse attention

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.