Coreference and Discourse
A text is more than a bag of sentences: entities recur under different names. Coreference resolution links every mention to the discourse entity it evokes — the linguistic background of pronouns, definite NPs, and names; mention detection; the mention-pair, mention-ranking, and entity-based architectures; a neural end-to-end span model that scores candidate antecedents; features, evaluation by the CoNLL F1, gender bias, and the neural coreference lineage.
╌╌╌╌
Consider this passage:
Victoria Chen, CFO of Megabucks Banking, saw her pay jump to $2.3 million, as the 38-year-old became the company's president. It is widely known that she came to Megabucks from rival Lotsabucks.
Her, the 38-year-old, and she all refer to one person; the company and Megabucks refer to one organization. None of these identities is stated: the reader infers them, maintaining a running model of who and what the text is about and threading each new phrase back into it.1 That model tracks two things. This lesson develops the first, coreference: the machinery that decides which expressions denote the same entity. The second, coherence — what makes a run of sentences a discourse rather than a random pile — continues in the companion lesson, coherence and discourse structure. Both build directly on the entities and relations extracted by semantic roles and information extraction; here we ask how those pieces get tied across a whole text.
Mentions, entities, and the discourse model
A mention (or referring expression) is a linguistic expression the writer uses to point at something — her, Victoria Chen, the company. The thing pointed at is the referent, a discourse entity. Two mentions that point at the same entity corefer.1 Interpreting a text means incrementally building a discourse model: a set of entities, their properties, and the relations among them.2 The first time an entity is named, a representation of it is evoked into the model; every later mention accesses that same representation.
Reference to an entity already in the model is anaphora, and the accessing expression is an anaphor; the earlier mention it links back to is its antecedent.2 In the passage above, she is an anaphor and Victoria Chen its antecedent. An entity mentioned only once (like Lotsabucks) is a singleton. The whole set of coreferring mentions for an entity is a coreference chain (or cluster). Our passage yields four chains:
| # | Chain | Entity |
|---|---|---|
| 1 | {Victoria Chen, her, the 38-year-old, she} | the CFO |
| 2 | {Megabucks Banking, the company, Megabucks} | the bank |
| 3 | {her pay} | a salary (singleton) |
| 4 | {Lotsabucks} | a rival (singleton) |
Note that mentions nest: her is part of the larger mention her pay, which refers to a completely different entity.2 Deciding which real-world individual a discourse entity denotes — is Washington the state, the city, or the person? — is a separate task, entity linking, typically resolved against an ontology such as Wikipedia.2 Coreference stops at the discourse entity; linking maps that entity to the world.
Linguistic background
Different kinds of referring expressions carry different loads. The choice among them is governed by information status: whether the entity is already in the discourse (given) or new, and how salient it is in the reader's mind.3
Indefinite NPs (a beautiful goose, some walnuts) usually introduce entities new to the hearer. Definite NPs (the white stallion) refer to an entity the hearer can already identify — because it was mentioned before, or because the world makes it unique (the car keys); more than half of definite NPs in newswire are non-anaphoric, naming something for the first time.3 Pronouns (she, it) are reserved for entities that are highly salient, so they can be recovered from very little linguistic material. Names can introduce or re-access entities (International Business Machines … IBM).3
The general principle is a trade between salience and explicitness: the more accessible an entity, the less material is needed to refer to it. A new entity enters with a full, informative description; as it is discussed it becomes salient, and its mentions shrink — full name, then short name, then definite description, then pronoun.
Not every noun phrase refers. Mention detection has to screen out several non-referring structures that look like mentions:3
- Appositives — CFO of Megabucks Banking describing Victoria Chen — add a parenthetical description, they do not name a new entity.
- Predicative / prenominal NPs — in her pay jumped to $2.3 million, the $2.3 million predicates a property, it is not a distinct entity.
- Expletive (pleonastic) pronouns — the it in it is raining or the cleft It was Emma Goldman who… refers to nothing.
- Generics — I love mangos. They are very tasty. — they names the class of mangos, not any particular set.
Properties of the anaphor/antecedent relation
Several soft constraints and preferences shape which antecedent an anaphor takes.4 They are useful both as features and as a checklist for error analysis.
| Property | What it says | Example |
|---|---|---|
| Number agreement | anaphor and antecedent agree in number | the chefs ↛ she |
| Person agreement | agree in first/second/third person | third-person he needs a third-person antecedent |
| Gender / noun class | agree in grammatical gender | Maryam … She vs. the theorem … It |
| Binding constraints | reflexives corefer with the local subject; non-reflexives cannot | Janet bought herself (=Janet); Janet bought her (≠Janet) |
| Recency | recent mentions are more salient | later map preferred as antecedent of it |
| Grammatical role | subjects outrank objects outrank obliques | he prefers the subject of the prior sentence |
| Verb semantics | some verbs bias toward subject or object | John telephoned Bill. He… (=John) vs. John criticized Bill. He… (=Bill) |
| Selectional restrictions | verbs constrain their arguments' type | ate … it rules out the bowl, keeps the soup |
These are preferences, not laws. Number agreement in particular cannot be enforced strictly: a semantically plural organization takes they (IBM … They have been working on it), and singular they — they used for a single individual — is common and gender-neutral.4 A resolver that hard-filters on agreement throws away correct links.
The hard cases: Winograd Schemas
Some coreference decisions need world knowledge that no amount of agreement or distance can supply. The canonical illustration is the Winograd Schema: a pair of sentences differing in a single word, where that word flips the antecedent.5
By design these resist selectional restrictions and word association; the original city council … demonstrators … they feared/advocated violence turns on social stereotypes, others on physics or turn-taking.5 The Winograd Schema Challenge was proposed precisely to push NLP toward common-sense reasoning. Large pretrained language models, fine-tuned on such sentences, now solve a large fraction of the original set (they have absorbed a great deal of world knowledge), which has driven the field to build harder successor datasets.5
Mention detection
The first stage of a coreference system finds the spans that constitute mentions.6 Detectors are deliberately high-recall: they over-propose and filter later. A common recipe runs a parser and a named-entity tagger and takes every NP, possessive pronoun, and named entity. On the running passage this yields about 13 candidates:
More recent detectors are even more generous: the span-based neural model below enumerates all n-gram spans up to length 10 and prunes them later.6 Most of these are not referring expressions, so every detector needs a way to filter pleonastic pronouns, appositives, and predicate nominals. Some filtering is rule-based — regular expressions catch pleonastic it in It is likely that… or It seems that….6 But rules alone are insufficient, so modern systems add a learned component: a referentiality, anaphoricity (is this NP an anaphor?), or discourse-new classifier, using features of the candidate — head word, definiteness, animacy, length, position.6
Hard filtering, though, hurts: set the anaphoricity threshold high and recall collapses; set it low and precision collapses.6 Modern systems therefore skip the separate filtering stage and fold mention detection, anaphoricity, and coreference into one end-to-end model with a single loss — the design developed below. Even so, wrongly marking pleonastic it and other non-referential NPs as coreferent remains a leading error source, so referentiality detection is still an open problem.6
Architectures for coreference
Given the mentions, how do we cluster them? Three classic architectures differ along two axes: whether a decision is made per mention or per entity, and whether candidate antecedents are compared against each other by ranking.7
The mention-pair model
The simplest architecture trains a binary classifier on a pair of mentions — a candidate anaphor and a candidate antecedent — that outputs the probability they corefer.8
Training needs a heuristic to avoid drowning in negatives (most mention pairs do not corefer). The standard choice: for each anaphor , one positive pair with the closest antecedent, and one negative pair for each mention between and .8 At test time, the trained classifier runs over prior mentions and links, then transitive closure of the pairwise links gives the clusters. Two clustering rules are common:
The mention-pair model is simple but has two flaws. It never directly compares two candidate antecedents, so it cannot be trained to pick the better of two plausible ones; and it looks only at mention pairs, ignoring the entity (the rest of the cluster).8 The next two models each repair one flaw.
The mention-ranking model
The mention-ranking model compares all candidate antecedents at once and picks
the single best.9 For anaphor it introduces a variable ranging over
: every prior mention plus a special dummy
that means has no antecedent
— either discourse-new or non-referential.
Folding into the choice set is what lets anaphoricity be learned jointly
with coreference instead of by a separate classifier.9
Training is trickier than the mention-pair case: the gold data gives the whole
cluster, not the single correct
antecedent, so the best antecedent is
latent.9 The standard solution gives credit to any legal antecedent by
summing their probabilities in the loss — the objective we write out for the neural
model below. At test time one softmax per anaphor yields a distribution over
antecedents; transitive closure of the argmax links produces the clustering.9
Entity-based models
Both models above decide about mentions. Entity-based models instead link a
mention to a previous entity (cluster), which lets a decision use the whole
cluster's evidence.10 A mention-ranking model becomes an entity-ranking
model by ranking over clusters rather than mentions. Feature-based versions add
cluster features: the cluster size, or its shape — the sequence of mention
types, so {Victoria, her, the 38-year-old} has shape P-Pr-D for
Proper-Pronoun-Definite. Neural versions learn cluster representations, e.g. with an
RNN over the cluster's mentions.10 Entity-based models are more expressive,
but in practice the cluster-level information has not bought large gains, so
mention-ranking remains the most common choice today.10
Features
Before neural representation learning, coreference classifiers ran on hand-built features, and these still complement neural models.11 For an anaphor and a candidate antecedent, features come in three groups: features of the anaphor, features of the antecedent, and features of the pair. The table shows representative values for the pair (Victoria Chen, she):
| Feature | Value | Meaning |
|---|---|---|
| Head word | Victoria / she | head (or head embedding) of antecedent / anaphor |
| Attributes | Sg-F-A-3-PER / Sg-F-A-3-PER | number, gender, animacy, person, NE type |
| Length | 2 / 1 | length in words |
| Grammatical role | Sub / Sub | subject, object, or oblique |
| Mention type | P / Pr | Proper / Definite / Indefinite / Pronoun |
| Sentence distance | 1 | sentences between the two |
| Mention distance | 4 | mentions between the two |
| Exact string match | F | strings identical |
| Head match | T | shared head word |
| Cosine | — | cosine between antecedent and anaphor embeddings |
The features prior work finds most useful are exact string match, head-word agreement, and mention distance, plus attribute match and i-within-i for pronouns, and word inclusion and cosine for nominals and names.11Conjunctions of features matter: moving from single features to conjunctions raised F1 by about 4 points in one study.11 Neural systems with contextual embeddings no longer benefit from shallow lexical features like string or head match, but they still gain from mention length, distance, and genre.11
A neural mention-ranking algorithm
The state-of-the-art e2e-coref family does mention detection and coreference in
one span-based network.12 Given a document of words it considers all
spans (in practice up to width ) and assigns each
span an antecedent . For a pair of spans
the model produces a coreference score that decomposes into
three parts — whether is a mention, whether is a mention, and whether is
's antecedent:
Fixing the dummy score gives a clean abstain rule: predict the highest-scoring antecedent if any non-dummy score is positive, otherwise take and start a new chain.12 The antecedent distribution is a softmax over the choice set :
Span representations
Both and need a vector for a span. The representation captures three tokens: the span's first word, its last word, and its most important (head) word.12 Run the document through an encoder (e.g. BERT) to get token embeddings , and represent span as
where is an attention-weighted sum of the span's tokens that learns to concentrate on the head word. The attention weight for token comes from a learned vector and a feedforward net, normalized over the span:
Mention and antecedent scores
Two feedforward nets turn spans into scores. The mention score reads one span; the antecedent score reads a pair and includes the element-wise product as an explicit similarity signal (plus a feature vector for distance, speaker, and genre):
At inference, prunes the candidate list to a manageable few high-scoring mentions before any antecedent scores are computed — the pruning that makes the span-pair problem tractable.12
Learning
Because the gold labels give clusters, not single antecedents, the model uses a latent-antecedent loss: for span it maximizes the total probability of any legal gold antecedent. Let be the mentions in 's gold cluster and the spans before ; the correct antecedents are . Summing the negative log of that total probability over all mentions gives the training loss:12
If span is in no gold cluster, its only legal antecedent is . A forward pass then gives each document's antecedent distribution, and transitive closure over the argmax links yields the final clustering. The learned head-finding attention tends to land on the true syntactic head, even though no head supervision is provided — the model discovers that head words are useful for coreference purely from the clustering signal.12
The latent-antecedent loss on numbers
The summed loss differs from an ordinary softmax cross-entropy in a way that is easy to miss. Resolve she against the choice set , where the gold cluster for she contains both Victoria Chen and her. Suppose the model's scores produce this softmax over the four candidates:
An ordinary classifier would have to name one target and pay a penalty for the
probability it put on the other correct antecedent — but her and Victoria Chen
are equally correct, and forcing a choice between them is arbitrary. The
latent-antecedent loss instead sums the gold probabilities before the log:
. Mass on
either legal antecedent reduces the loss identically, so the model is never told
which of the two to prefer; it only has to keep total mass off Megabucks and
. This is the numerical meaning of the best antecedent is latent
: the
objective marginalizes over the unknown correct link rather than committing to one.
Evaluation
Coreference is scored model-theoretically: compare the system's hypothesis
chains against gold reference chains and report precision and recall. There
is no single obvious way to do this, so several metrics coexist — each measuring a
slightly different notion of same clustering
.13
| Metric | Unit compared | Character |
|---|---|---|
| MUC | coreference links (pairs) | link-based; ignores singletons; biased toward large chains |
| B³ | mentions | per-mention precision/recall, summed with weights |
| CEAF | entities | aligns hypothesis and gold entities |
MUC precision is common links over links in , recall is common links over links in ; because it counts only links, singletons never contribute, and merging everything into few big chains inflates the score.13 B³ fixes this by working per mention: for mention with reference chain and hypothesis chain , precision is and recall is , weighted and summed over all mentions.13
Scoring MUC and B³ on a worked example
Take one gold chain of four mentions, , and a system that correctly groups the first three but splits off the fourth into its own singleton: , . Compute both metrics on this one error.
MUC counts coreference links, where a chain of mentions contributes links (a spanning tree over the cluster). Gold has links; the system's chains have links, and both of those (–, –) are also gold links. So MUC recall is (two of three gold links recovered) and MUC precision is (both proposed links are correct), giving .
B³ works per mention. For each mention it computes precision and recall from its own hypothesis and reference chains, then averages over all four mentions. For , , : their hypothesis chain is and reference chain , so , precision , recall . For : its hypothesis chain is , reference , so , precision , recall . Averaging: precision , recall , so . The single split costs slightly more under B³ than MUC here, because B³ makes the three correctly-grouped mentions each pay a recall penalty for the missing , whereas MUC charges only the one missing link — the reason a single metric misleads and the CoNLL average is reported.
A subtlety in comparing systems: datasets differ in whether they annotate singletons. OntoNotes, the most-used English corpus, does not, which raises scores because singletons — 60–70% of all entities — are the hardest mentions to tell apart from non-referential NPs.14
Gender bias in coreference
Coreference models inherit the biases of their embeddings and training data.15 The WinoBias dataset adapts the Winograd paradigm to expose this: each sentence pairs a stereotypically male and a stereotypically female occupation with a gendered pronoun that cannot be disambiguated by gender, only by the coreference structure.
Systems of every architecture — rule-based, feature-based, and end-to-end neural — resolve pro-stereotypical pronouns more accurately than anti-stereotypical ones, on average about 21 F1 points worse in the anti-stereotypical case.15 One root cause is that female entities are underrepresented in OntoNotes. A gender-swapping augmentation — build a copy of the corpus with every male entity swapped to female and vice versa, and retrain on the union, with debiased embeddings — removes the WinoBias gap without hurting OntoNotes accuracy.15 The GAP dataset provides a gender-balanced benchmark of ambiguous pronouns drawn from Wikipedia, on which modern systems still resolve feminine pronouns worse than masculine ones.15
The neural coreference lineage
The e2e-coref model began a line of work in which each successive paper removed a
specific bottleneck.
Lee et al. (2017) introduced the end-to-end span model itself: no external mention detector, no separate anaphoricity classifier, just the span enumeration, the first/last/head-attention span representation, and the summed latent-antecedent loss of this lesson.16 It was the first system to jointly learn mention detection and coreference and reached about 67 CoNLL F1 on OntoNotes, then state of the art.
Lee et al. (2018) attacked the model's central inefficiency: with a first-order scorer, whether span links to ignores what already links to, so the model cannot enforce cluster-level consistency, and enumerating all span pairs is . Their coarse-to-fine pruning scores pairs cheaply, keeps only the top antecedents per span, then rescores those with the expensive model; a higher-order inference step then refines each span's representation using its current antecedent distribution, iterated a few times, which lets a decision see the emerging cluster.17 This pushed OntoNotes past 73 F1.
Joshi et al. / SpanBERT (2019) swapped the encoder. Replacing the ELMo/LSTM stack with BERT, and then with SpanBERT — a variant pretrained by masking and predicting contiguous spans rather than individual tokens, which matches coreference's span-centric structure — lifted OntoNotes to roughly 79 F1 with no change to the coreference architecture.18 The result underlined a theme from the dependency-parsing lesson: much of the recent gain came from the representation, not the clustering algorithm.
Wu et al. / CorefQA (2020) reframed the task entirely. Instead of scoring span
pairs, it treats each mention as a question (who does she refer to?
) and runs
a span-extraction question-answering model to find its antecedents in the
document.19 Posing coreference as QA lets it inherit large QA pretraining data
and a bidirectional scoring of the mention and candidate, and it reached about 83 F1
on OntoNotes. The trajectory — from hand-built mention detectors and pairwise
classifiers to a single span network, to pruning and higher-order inference, to
span-pretrained encoders, to a QA formulation — is a compression of the whole
architecture into the encoder plus a light scoring head, exactly the direction the
mention-ranking model pointed toward.
Where this continues
Coreference resolution is a running tally of who and what a text is about. We detected mentions, walked through the mention-pair, mention-ranking, and entity-based architectures, built the neural end-to-end span model that scores candidate antecedents directly off a pretrained encoder, scored it with the CoNLL F1, and traced the gender bias and the neural lineage that compress the whole pipeline into an encoder with a light scoring head.
That is only the entity half of tracking a discourse. What makes a run of sentences cohere — the relations between clauses, the continuity of salient entities, and shared topic — continues in coherence and discourse structure, where coherence is measured, in part, over the coreference chains recovered here.
Footnotes
- Jurafsky & Martin, Speech and Language Processing (3rd ed.), Ch. 21 — Coreference Resolution: mentions (referring expressions) and referents; two mentions corefer when they denote the same discourse entity, as with Victoria Chen and she. ↩ ↩2
- Jurafsky & Martin, Ch. 21 intro — the discourse model: mentions evoke an entity into the model on first use and access it thereafter; anaphora, anaphor, antecedent, singleton, coreference chain; nested mentions; entity linking maps a discourse entity to a real-world individual (e.g. Wikipedia). ↩ ↩2 ↩3 ↩4
- Jurafsky & Martin, §21.1 — Coreference Phenomena: Linguistic Background: indefinite, definite, pronoun, and name referring expressions; information status and the given–new/accessibility scale; non-referring appositives, predicatives, expletives, and generics. ↩ ↩2 ↩3 ↩4
- Jurafsky & Martin, §21.1.4 — Linguistic Properties of the Coreference Relation: number/person/gender agreement, binding constraints, recency, grammatical role, verb semantics, selectional restrictions; the difficulty of enforcing number agreement, and singular they. ↩ ↩2
- Jurafsky & Martin, §21.8 — Winograd Schema problems: minimal pairs differing in one word that flip the preferred antecedent; the Winograd Schema Challenge; pretrained language models now solve much of the original set, motivating harder datasets. ↩ ↩2 ↩3
- Jurafsky & Martin, §21.3 — Mention Detection: high-recall proposal of NPs, possessives, and named entities (or all n-gram spans); rule-based filters for pleonastic it; learned referentiality/anaphoricity/discourse-new classifiers; hard filtering hurts, so systems fold detection into an end-to-end model. ↩ ↩2 ↩3 ↩4 ↩5 ↩6
- Jurafsky & Martin, §21.4 — Architectures for Coreference Algorithms: the Ng (2010) categorization by mention- vs. entity-based decisions and by whether ranking is used. ↩
- Jurafsky & Martin, §21.4.1 — The Mention-Pair Architecture: a binary coreference classifier over a candidate anaphor/antecedent pair; the Soon et al. training-sample heuristic; closest-first vs. best-first clustering; its two flaws (no comparison of candidates, no entity view). ↩ ↩2 ↩3
- Jurafsky & Martin, §21.4.2 — The Mention-Rank Architecture: a softmax over all prior mentions plus a dummy for
no antecedent
, learning anaphoricity jointly with coreference; latent gold antecedents; transitive closure to cluster. ↩ ↩2 ↩3 ↩4 - Jurafsky & Martin, §21.4.3 — Entity-based Models: linking a mention to a prior entity/cluster; cluster size and shape features; learned cluster representations; entity-based models are more expressive but have not yielded large gains, so mention-ranking remains most common. ↩ ↩2 ↩3
- Jurafsky & Martin, §21.5 — Classifiers using hand-built features: features of the anaphor, antecedent, and pair (head word, attributes, length, grammatical role, mention type, distance, string/head match, cosine); the importance of feature conjunctions; which features still help neural models. ↩ ↩2 ↩3 ↩4
- Jurafsky & Martin, §21.6 — A neural mention-ranking algorithm (the Lee et al. 2017
e2e-corefmodel): all spans up to width ; the score with ; span representation from first/last/head-attention vectors; feedforward mention and antecedent scores with ; the latent-antecedent (summed) loss; learned head attention. ↩ ↩2 ↩3 ↩4 ↩5 ↩6 - Jurafsky & Martin, §21.7 — Evaluation of Coreference Resolution: model-theoretic comparison of hypothesis and reference chains; the link-based MUC, mention-based B³, and entity-based CEAF metrics; the CoNLL F1 as their average, computed with reference implementations. ↩ ↩2 ↩3 ↩4
- Jurafsky & Martin, §21.2 — Coreference Tasks and Datasets: OntoNotes does not label singletons, which are 60–70% of entities and hard to distinguish from non-referential NPs, raising scores relative to corpora that include them. ↩
- Jurafsky & Martin, §21.9 — Gender Bias in Coreference: the WinoBias paradigm; systems of all architectures do ~21 F1 worse in the anti-stereotypical case; gender-swapping data augmentation with debiased embeddings removes the gap; the GAP gender-balanced benchmark. ↩ ↩2 ↩3 ↩4
- Lee et al. (2017),
End-to-end Neural Coreference Resolution,
EMNLP 2017. Thee2e-corefmodel: enumerate spans up to a width bound, represent each by first/last/head-attention vectors, score with , and train with the summed latent-antecedent loss; the first system to learn mention detection and coreference jointly, ~67 CoNLL F1 on OntoNotes. ↩ - Lee et al. (2018),
Higher-order Coreference Resolution with Coarse-to-fine Inference,
NAACL 2018. Coarse-to-fine antecedent pruning to tame the span-pair cost, plus higher-order inference that iteratively refines each span's representation from its antecedent distribution to enforce cluster-level consistency; raised OntoNotes past ~73 F1. ↩ - Joshi et al. (2019),
BERT for Coreference Resolution: Baselines and Analysis,
EMNLP 2019, and Joshi et al. (2020),SpanBERT: Improving Pre-training by Representing and Predicting Spans,
TACL. Replacing the encoder with BERT and then SpanBERT (pretrained by masking contiguous spans) lifted OntoNotes to roughly 79 F1 without changing the coreference architecture. ↩ - Wu et al. (2020),
CorefQA: Coreference Resolution as Query-based Span Prediction,
ACL 2020. Reformulates coreference as question answering — each mention becomes a query and a span-extraction QA model finds its antecedents — inheriting QA pretraining data and bidirectional scoring; about 83 F1 on OntoNotes. ↩
╌╌ END ╌╌