Sequence labeling models, such as those used for Named Entity Recognition (NER), often struggle with long-form documents where local context is insufficient for disambiguation. This paper introduces Doc-ARC (Document-Attentive Representation of Context), a method that leverages global document information by attending to multiple mentions of the same word type across a text. By incorporating long-distance cues, Doc-ARC significantly improves performance, particularly for rare and document-specific entities.
The Problem of "Short-Sighted" Models
Modern NLP models like BERT typically process text in small chunks (e.g., 512 tokens), making them "short-sighted" when dealing with long-form content like novels or scientific papers. In these contexts, a single sentence may not provide enough information to correctly label an entity. For instance, the word "Florence" could refer to a person or a city depending on context found hundreds of pages away. Doc-ARC addresses this by providing models with a "global memory" of the entire document.
Methodology: Doc-ARC
The core innovation of Doc-ARC is the use of "word-type identity" as a computationally efficient shortcut for attention. Instead of calculating dense attention across all tokens in a long document—which is computationally prohibitive—the model retrieves contextual representations of other instances of the same word.
As shown in the architecture diagram, the process involves:
- Encoding: Sentences are processed via a language model (e.g., BERT) to generate initial representations.
- Retrieval: For a target token, the model identifies the $K$ closest sentences in the document containing the same word.
- Attention: An attention-weighted sum is performed over these distant representations, incorporating a "distance embedding" to account for relative position.
- Prediction: This global context is concatenated with the local representation and passed to a final classifier for label prediction.
Datasets
The model was evaluated on three long-context datasets:
- LitBank: 100 English novels where entities often reappear over hundreds of pages.
- OntoNotes$_{1000}$: A subset of OntoNotes 5.0 filtered for documents exceeding 1,000 words.
- JNLPBA (Full-Text): A new dataset created by the authors that pairs biomedical abstracts with their corresponding full-text scientific articles, providing a massive increase in available context for technical entities.
Key Results and Analysis
Doc-ARC consistently outperforms standard baselines that lack document-level attention. On OntoNotes$_{1000}$, the static model achieved an F1 score of 84.25, a significant improvement over the 82.20 baseline.
A key finding is the relationship between TF-IDF scores and model performance. Doc-ARC excels at disambiguating words with high TF-IDF values—those that are frequent within a specific document but rare overall (like a specific character's name or a niche protein). For the rarest 1% of entities in OntoNotes, the model provided a massive 17.6 F1 point boost over the baseline. This demonstrates that global context is most critical for the very entities that local context often fails to identify.
Limitations and Future Work
While effective, Doc-ARC currently relies on exact word-type matches. It does not yet connect a name like "Florence" with pronouns ("she") or synonyms. Future work may explore integrating formal coreference resolution or semantic similarity to further broaden the scope of retrieved context. Additionally, memory constraints currently limit the "Dynamic" version of the model to smaller encoder architectures.
Summary updated