Coreference Resolution: Tracking Who's Who in Text
Who does "she" refer to?
Read this sentence: "Dr. Patel told the nurse that she would need to review the chart before the surgery." Who is "she" — Dr. Patel or the nurse? English gives you no grammatical marker to resolve this; you need world knowledge, discourse conventions, and often genuine ambiguity tolerance to even answer it. Coreference resolution is the NLP task of identifying every mention in a text that refers to the same real-world entity and grouping them into clusters — one cluster per entity.
This matters constantly in practice: a document might refer to a company first by its full legal name, then by an abbreviation, then by "the firm," then by "it." Any system that needs to actually understand what a document is saying — a summarizer, a question-answering system, a legal document reviewer — needs to know these all point to the same entity.
The vocabulary: mentions, antecedents, clusters
A mention is any span of text that refers to an entity — a proper name ("Marie Curie"), a common noun phrase ("the scientist"), or a pronoun ("she"). An antecedent is an earlier mention that a later mention (typically a pronoun) refers back to. The goal of coreference resolution is to partition all mentions in a document into clusters, where each cluster contains every mention referring to the same entity.
The specific case of a pronoun referring back to an earlier noun phrase is called anaphora resolution, and it's the subcase most people picture when they think of this task — but coreference is broader. It also includes cases like cataphora (a pronoun appearing before its referent: "Before she spoke, Maria took a breath"), and resolving between two full noun phrases ("Apple" and "the Cupertino-based company" referring to the same entity without any pronoun involved).
Note
Why coreference is genuinely hard
Several things make this task harder than it first appears. Winograd Schema-style ambiguity: sentences like "The city councilmen refused the demonstrators a permit because they feared violence" vs. "...because they advocated violence" flip the correct referent of "they" based purely on world knowledge about who typically fears vs. advocates violence — no syntactic cue distinguishes the two cases. Long-distance dependencies: an entity introduced in paragraph one might be referred to again five paragraphs later, well beyond the context window many earlier models could consider. Cluster-level consistency: resolving each pronoun independently can produce globally inconsistent clusters (two mentions each resolved to a different, mutually exclusive antecedent), so the task is really a joint clustering problem, not a sequence of independent binary decisions.
Modern approaches: end-to-end neural coreference
Older systems resolved coreference in stages — detect mentions, then score each pronoun against candidate antecedents with a separate classifier. Modern systems, starting with the end-to-end neural coreference model (Lee et al., 2017) and its transformer-based successors, score every possible span in the document as a potential mention, then jointly learn mention detection and antecedent scoring in a single model trained end-to-end. A transformer encoder produces contextual representations for every span, and a scoring function estimates how likely each pair of spans is to be coreferent, with the highest-scoring compatible set of links taken as the final clustering.
Large language models bring a different strategy: prompted directly to resolve coreference ("who does 'she' refer to in this passage?"), they often do well on short, clear passages, leveraging the same broad world knowledge that helps with Winograd-style ambiguity. But they still struggle with long documents (tracking dozens of entities across many pages taxes even large context windows), with maintaining globally consistent clusters rather than resolving each mention in isolation, and with evaluation — it's easy to get a plausible-sounding single answer and much harder to produce a complete, correct clustering of every mention in a long document.
Approaches to coreference resolution
| Approach | How it works | Strength | Weakness |
|---|---|---|---|
| Rule-based (Hobbs-style) | Hand-coded syntactic search heuristics | Interpretable, no training data needed | Brittle; fails on world-knowledge cases |
| Mention-pair classifiers | Binary classifier scores each mention-antecedent pair | Simple, trainable with limited data | No global consistency across clusters |
| End-to-end neural (span-based) | Jointly score all spans and antecedent links | State of the art on standard benchmarks | Expensive over long documents (many candidate spans) |
| LLM-prompted resolution | Ask a large language model directly | Strong world knowledge, no task-specific training | Inconsistent on long documents; hard to evaluate at scale |
Note
What's next
Coreference resolution is about tracking entity identity across a document — a precondition for many higher-level tasks. One of the biggest consumers of that kind of document-level understanding is summarization: compressing a long text into a shorter one while preserving who did what. The next lesson covers extractive and abstractive summarization.
I build these systems professionally.
Whether it's a RAG pipeline, analytics migration, or AI workflow — let's talk.