Inferensys

Glossary

Graph-Based Parsing

A parsing paradigm that scores all possible dependency arcs in a sentence simultaneously to find the highest-scoring maximum spanning tree, often using the Chu-Liu/Edmonds algorithm.
Knowledge engineer constructing knowledge base on laptop, document hierarchy visible, casual office setup.
DEPENDENCY PARSING

What is Graph-Based Parsing?

A parsing paradigm that scores all possible dependency arcs in a sentence simultaneously to find the highest-scoring maximum spanning tree.

Graph-based parsing is a syntactic analysis paradigm that defines the parsing problem as finding the highest-scoring directed spanning tree over all possible dependency arcs in a sentence. Unlike transition-based methods that process words sequentially, graph-based parsers score every potential head-dependent relationship globally and decode the optimal structure using the Chu-Liu/Edmonds algorithm for maximum spanning trees.

This approach naturally handles non-projective parses with crossing arcs, making it suitable for languages with free word order. First-order arc-factored models assume edge independence for tractability, while higher-order parsing incorporates sibling and grandparent features to capture richer syntactic contexts at increased computational cost.

GLOBAL OPTIMIZATION

Key Characteristics of Graph-Based Parsing

Graph-based parsing defines dependency parsing as a search for the maximum spanning tree over a complete directed graph, scoring all possible arcs simultaneously rather than making incremental greedy decisions.

01

Maximum Spanning Tree Decoding

The core algorithmic insight: treat every word as a node and every possible directed arc as a scored edge. The parser's job is to find the tree that maximizes the sum of arc scores. This is solved efficiently using the Chu-Liu/Edmonds algorithm for directed graphs, guaranteeing the globally optimal tree under the arc-factored model. Unlike transition-based methods, this avoids error propagation from early greedy decisions.

O(n²)
Time Complexity
02

Arc-Factored Score Decomposition

Graph-based parsers typically assume first-order factorization: the score of a complete dependency tree is simply the sum of its individual arc scores. This independence assumption makes global search computationally tractable.

  • Arc score: Computed via a learned function (e.g., biaffine attention) over head-dependent pairs
  • Trade-off: Enables exact inference but cannot capture sibling or grandparent interactions
  • Higher-order extensions: Add factors for adjacent arcs to model richer syntactic contexts
03

Non-Projectivity Handling

A major advantage of graph-based parsing is native support for non-projective trees. The Chu-Liu/Edmonds algorithm finds the maximum spanning tree in a general directed graph without enforcing projectivity constraints.

  • Crossing arcs: Required for languages with free word order (Czech, Dutch, German)
  • Projective variants: Eisner's algorithm provides O(n³) decoding when projectivity is enforced
  • Practical impact: Graph-based parsers consistently outperform transition-based systems on non-projective treebanks
04

Biaffine Attention Scoring

Modern neural graph-based parsers use deep biaffine attention to compute arc scores. For each token pair (i, j), a bilinear transformation scores how likely word j is to be the head of word i:

  • Architecture: BiLSTM or Transformer encodes each word into a contextualized vector
  • Head and dependent representations: Separate feedforward layers produce distinct vectors for each role
  • Biaffine classifier: score(i→j) = h_i^T · U · d_j + W · [h_i; d_j] + b
  • Label prediction: A second biaffine layer assigns dependency relation labels (nsubj, dobj, etc.)
05

Deep Biaffine Parser (Dozat & Manning)

The canonical neural graph-based architecture that achieved state-of-the-art results across multiple treebanks. Key design choices:

  • No feature engineering: Learns everything from word embeddings and character-level CNNs
  • Deep biaffine scoring: Replaces simple dot-product attention with learned bilinear transformations
  • Dropout on embeddings and hidden states: Critical regularization for small treebank sizes
  • Performance: Achieved 95.7% UAS and 94.1% LAS on English Penn Treebank, setting a new standard for dependency parsing accuracy
06

Graph-Based vs. Transition-Based Trade-offs

The two parsing paradigms represent a fundamental accuracy-efficiency trade-off:

  • Graph-based strengths: Global optimization, natural non-projectivity, higher accuracy on standard benchmarks
  • Transition-based strengths: Linear-time O(n) complexity, incremental processing suitable for streaming, easier integration with dynamic oracles
  • Convergence: Modern neural transition-based parsers with beam search approach graph-based accuracy while maintaining speed advantages
  • Production choice: spaCy uses transition-based for speed; Stanza offers graph-based for accuracy
PARSING PARADIGM COMPARISON

Graph-Based vs. Transition-Based Parsing

A technical comparison of the two dominant approaches to data-driven dependency parsing, contrasting their decoding strategies, computational properties, and architectural assumptions.

FeatureGraph-Based ParsingTransition-Based Parsing

Decoding Strategy

Global optimization over all possible arcs; finds the Maximum Spanning Tree (MST) via Chu-Liu/Edmonds algorithm

Greedy or beam-search sequence of local shift-reduce actions (SHIFT, LEFT-ARC, RIGHT-ARC)

Scoring Model

Arc-factored or higher-order; scores all O(n²) possible arcs simultaneously

History-based classifier; scores the next action given the current parser state (stack, buffer, partial arcs)

Complexity (Inference)

O(n³) for naive projective; O(n²) for Eisner algorithm; O(n²) for Chu-Liu/Edmonds non-projective

O(n) for greedy deterministic; O(n * B) for beam search with beam width B

Non-Projectivity Handling

Native support via Chu-Liu/Edmonds; non-projective arcs are scored and selected naturally

Requires explicit SWAP action or pseudo-projective transformations; greedy decoders struggle with crossing arcs

Error Propagation

Low; all arcs are scored globally, so a single local error does not cascade to subsequent decisions

High in greedy mode; an early incorrect action corrupts the parser state for all subsequent decisions

Training Objective

Margin-based or max-likelihood over correct tree vs. all possible trees; often uses hinge loss on tree scores

Multi-class classification of oracle action sequences; dynamic oracles allow exploration of non-gold states

Representative Implementations

MSTParser, Deep Biaffine Parser (Dozat & Manning), TurboParser

MaltParser, spaCy Dependency Parser, Arc-Eager/Arc-Standard systems

Feature Representation

Dense neural embeddings (BiLSTM, Transformer) with biaffine attention over all head-dependent pairs

Sparse indicator features (word, POS, arc labels) over parser state history; modern variants use neural state embeddings

GRAPH-BASED PARSING

Frequently Asked Questions

Clear, technical answers to common questions about graph-based dependency parsing, covering the core algorithms, evaluation metrics, and architectural decisions that define this NLP paradigm.

Graph-based parsing is a syntactic analysis paradigm that scores all possible dependency arcs in a sentence simultaneously to find the highest-scoring maximum spanning tree. Unlike transition-based methods that process words sequentially, a graph-based parser constructs a complete, weighted directed graph where nodes represent words and edges represent potential head-dependent relationships. A factored model assigns a score to each possible arc based on extracted features, and a decoding algorithm—typically the Chu-Liu/Edmonds algorithm—finds the tree that maximizes the sum of these scores. This global optimization allows the parser to consider long-range dependencies without the error propagation issues inherent in greedy left-to-right decisions, making it particularly effective for languages with free word order.

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.