Structured Prediction and Parsing Evaluation › Labeled Attachment

Michael BrenndoerferNovember 17, 20264 min read
Language AI HandbookAll chapters
Part 7 of 67Linguistic Form: Morphology and Syntax
Chapter 49Structured Prediction and Parsing Evaluation › Labeled Attachment
Reading section 6 of 14 · Labeled Attachment · 4 minSection 6 of 14 · 4 min

Section 6 of 14 · 4 min read

Reading settings

Definitions

Choose how many terms have tooltips.

Article links

Make inline references clickable

Notes & comments

Labels add a dimension to the output space. In the lexical-root convention used for the dependency decoder, a tree with n−1n-1 lexical arcs has Ln−1L^{n-1} labeled versions if each arc can take any of the same LL labels independently. Under that assumption, naive enumeration multiplies the candidate count by Ln−1L^{n-1}. Independent local label maximization can avoid enumerating those combinations.

Decoupling Structure and Labels

Suppose the score decomposes as

s(x,y)=∑(h,m,ℓ)∈y[sarc(h,m)+slabel(ℓ∣h,m)]s(x,y) = \sum_{(h,m,\ell) \in y} \left[ s_{\text{arc}}(h,m) + s_{\text{label}}(\ell \mid h,m) \right]

where:

  • (h,m,ℓ)(h,m,\ell): a labeled arc with head hh, modifier mm, and label ℓ\ell
  • sarc(h,m)s_{\text{arc}}(h,m): the score for the unlabeled attachment of mm to hh
  • slabel(ℓ∣h,m)s_{\text{label}}(\ell \mid h,m): the score for assigning label ℓ\ell to the arc (h,m)(h,m) given the attachment

Then

max⁡ys(x,y)=max⁡yunlabeled∑(h,m)∈yunlabeledmax⁡ℓ[sarc(h,m)+slabel(ℓ∣h,m)]⏟augmented arc score\max_{y} s(x,y) = \max_{y_{\text{unlabeled}}} \sum_{(h,m) \in y_{\text{unlabeled}}} \underbrace{\max_{\ell} \left[ s_{\text{arc}}(h,m) + s_{\text{label}}(\ell \mid h,m) \right]}_{\text{augmented arc score}}

The inner label maximum is independent for each candidate arc. An arc with no legal label is unavailable to the structural decoder. Compute an augmented score and best-label backpointer for every allowed (h,m)(h,m), run the unlabeled structural decoder, and then read the stored labels for its selected arcs. With n(n−1)n(n-1) possible lexical non-self arcs and LL labels, preparation takes O(n2L)O(n^2L) comparisons; Eisner then takes O(n3)O(n^3) time. This gives O(n2L+n3)O(n^2L+n^3), excluding the model's score-computation cost. It is not an extra factor of Ln−1L^{n-1}.

The collapse is exact when both the score and the legal label assignments factor independently over the selected arcs. A constraint such as “this head has at most one nsubj dependent” couples labels across arcs and can invalidate it. In contrast, a rule that restricts one arc's labels using that arc's head POS tag is still local and can be folded into its label maximum. Coupled label models need an inference procedure for their actual interactions. The independent-label bound does not extend to arbitrary global constraints. Their representation and how they couple arcs can add to the cost.

This distinction is separate from a two-stage pipeline that first decodes only arc scores and then labels the selected arcs. Ignoring label scores during structure selection need not maximize the combined score displayed above. Whether the combined objective improves LAS is empirical and depends on training, scoring, and data; no universal accuracy gap follows from separability alone.

A simpler fixed-tree comparison makes the label-space reduction visible. On one already-selected tree with n−1n-1 lexical arcs and 40 labels, enumerating all label combinations would examine 40n−140^{n-1} assignments. Independent label maximization instead checks 40(n−1)40(n-1) scores. The plot shows this fixed-tree comparison only; preparing labels for every candidate tree edge before structural decoding has the quadratic-in-nn cost derived above.

PythonIn [7]
CollapseExpand
import numpy as np

label_n = np.arange(2, 13)
label_combinations = 40.0 ** (label_n - 1)
decoupled_checks = (label_n.astype(float) - 1) * 40.0
VisualizationOut [8]
CollapseExpand
Fixed-tree label assignments grow exponentially; independent score checks grow linearly.
Labeling one fixed tree with 40 candidate labels per lexical arc. Independent label maximization checks 40(n-1) scores instead of enumerating 40^(n-1) assignments; structural decoding and candidate-edge preparation are not included.

When Labels Interact

Three distinctions help you decide whether a label model needs richer inference:

  • Output coupling. A task-specific cardinality condition such as at most one subject label for a head depends on multiple selected arcs. An arc-local mask does not count them.
  • Local label restrictions. Restricting labels according to a candidate head/dependent POS pair remains local, even though the allowed labels differ across arcs. It does not by itself defeat independent maximization.
  • Linguistic coverage. A relative clause may lack an overt relativizer, and coordination or annotation conventions may complicate a subject-count heuristic. Do not promote such a heuristic to a universal grammar rule without examining the target scheme.

Higher-order factors can score selected sibling or grandparent combinations, while an explicit constraint may require a count or another additional state. Their complexity must be derived for the chosen model. Adjacent siblings, grandparents, and third-order grand-siblings are distinct factorizations with different possible chart designs, as the earlier table shows.

Comments

Add to the conversation

A question, a correction, or an example from your own work.

No comments yet. Be the first to share your thoughts!

Newsletter

Stay up to date

Get new articles, book updates, and notes on AI and technology.

Unsubscribe at any time. Privacy policy