Elamur Research

Learning to Rank Context for Named Entity Recognition Using a Synthetic Dataset

Paper · 2023 · Arthur Amalvy, Vincent Labatut and Richard Dufour

Summary

A line of dialogue can contain a name without giving away what it names. A sentence elsewhere in the novel might settle the question by describing the responsibilities of an institution, showing a character in action, or naming a destination. Named entity recognition identifies mentions in text and assigns them categories such as person, location, and organization. Amalvy and colleagues ask how to make evidence from an entire book available to a recognizer that reads short inputs. Their method uses simple search rules to collect possible clues, then applies a learned ranking to decide which ones the recognizer should read.

The authors begin with sentences whose entities have already been labeled. Those labels identify the kind of entity a name refers to, but they supply no judgments about which other sentences would help establish that category. The authors use Alpaca to write plausible clues with the category in mind. They also construct mismatched pairs, some using real sentences from other books and some using clues generated for other names. These paired examples teach a BERT scorer to estimate how helpful a candidate is for a particular target sentence. When the system is used on a novel, all the candidate evidence comes from the book itself. A separate recognizer assigns the labels after reading the chosen sentences with the target.

The benchmark supplies annotations for the opening chapter of each of 40 English novels. The authors make the full books searchable and find their best configuration when the recognizer receives 3 additional sentences. The resulting improvement over recognition with no retrieved text is around 1 F1 point. The learned selector generally beats simple search rules and has a small lead over rerankers trained on human judgments for passage retrieval. The aggregate result hides considerable variation. In the comparison that supplies a single additional sentence, The Black Company gains 8.1 F1 points over recognition without retrieval, the largest improvement reported for a book in that comparison.

The learned ranking benefits substantially from the option to search beyond the opening chapter. Restricting that option hurts its recognition results across several shortlist sizes, while simple rules can do better with the chapter alone when asked for only a few sentences. The experiments show that invented clues can teach a scorer to choose useful passages from authentic prose. They also expose a gap between picking promising sentences individually and assembling a good set. Several picks can give the recognizer essentially the same evidence or all clarify the same name while another mention remains difficult.

Deep dive: Learning to Rank Context for Named Entity Recognition Using a Synthetic Dataset

Amalvy and colleagues use synthetic training examples to teach a search system which sentences in a novel can help identify names in its opening chapter. · about 32 minutes to read

The problem and its context

What a sentence leaves implicit

A reader who has already encountered a character can recognize the character’s name in a terse exchange. The exchange itself may offer little evidence about the name’s type. Its grammar may show that someone is being addressed, for instance, without giving the kind of description that would make a particular label easy to assign. An institution can present a comparable problem when the narration refers to it in passing. A fuller account of what it does may appear in a different passage. These are cases where the words needed for a local judgment can be distributed across a story.

The paper’s recognition task concerns the mentions that occur in a target sentence. The system needs to locate those mentions and give each one the appropriate category. Evidence for the boundaries of a name and evidence for its type can come from different places. A mention may be easy to delimit while its type remains uncertain. An occurrence elsewhere might give a fuller description, show the named entity participating in an activity, or place it in a relation that makes the category easier to infer. The authors build their retrieval task around this last part of the recognition decision, the disambiguation of entity type.

In earlier work on literary recognition, Amalvy and colleagues examined context at both local and document scale. As the present paper describes it, losing access to context elsewhere in the document came at a cost to recognition. That result motivates a practical question. If a recognizer can read only a small part of a book for any given prediction, how should a system decide which part to show it? Reading adjacent sentences is a plausible default, since adjacent sentences frequently develop the same scene. The range of a scene still differs from the range over which a book introduces, describes, and revisits its names.

Why recognition and search have different ranges

The paper starts from the use of pretrained Transformers for entity recognition. It mentions BERT and LUKE as examples of systems that can reach high F1 on the task. Their accuracy on manageable inputs leaves a separate obstacle for books. The cost of ordinary attention grows quadratically with sequence length. The authors take entire novels as a case where this restriction prevents the recognizer from considering the full document directly. BERT and LUKE

Research on efficient attention addresses the cost of reading long inputs by changing how attention is computed. The authors refer to approaches with subquadratic complexity and to benchmark work showing that long sequences remain difficult. Their own approach changes the input. A search can range over the book and bring back a few sentences, which can then be read together in a compact sequence. Distance in the original story consequently need not determine whether a sentence is accessible at recognition time. The search does the work of crossing that distance. Efficient Transformers and Long Range Arena

The research on context that the paper describes includes systems that retrieve from external sources. Its discussion points to work by Luo and colleagues and by Wang and colleagues, among others. A search confined to the current document offers an option when external resources are unavailable. The novel itself is the collection on which the method depends. A book can contain several informative uses of a name even if the sentence that needs labeling gives little away. Joint Entity Recognition and Disambiguation and Improving Named Entity Recognition by External Context Retrieving and Cooperative Learning

The paper also discusses a study by Luoma and Pyysalo that generated predictions under different neighboring contexts and combined them by voting. That approach draws on variation in what nearby sentences contribute. Amalvy and colleagues extend the candidate range to the document and assemble selected sentences into a single input for recognition. Earlier work by the same authors had already considered global context, using rules that needed no example judgments about relevance. The new paper investigates how to obtain the supervision for a learned selector.

The missing judgment is about a pair

An annotated occurrence of a place name tells a recognizer what label to produce. For retrieval, the useful judgment has a different form. It concerns the relationship between the sentence with that occurrence and another sentence that may help explain it. Encountering the name in both sentences can be a reason to consider the candidate. It takes a further judgment to tell whether the second occurrence provides informative evidence. A story can repeat a name many times while making its type especially clear in only a few passages.

A rule based on proximity, similar words, or a common noun can identify promising places to look. Such rules are available even when nobody has marked useful contexts in the book. They express broad ideas about where evidence may occur. The desired ranking depends more specifically on what each sentence says about an entity. The authors report that they had no annotated retrieval dataset for this document-level task. Labeling useful pairs by hand would be expensive, since another sentence can be drawn from anywhere in the document and its value depends on the particular target.

The two-stage arrangement comes from information retrieval. As the paper describes it, a relatively inexpensive retriever such as BM25 can gather candidates for a query, and a more expensive scorer can reconsider that shortlist. This second operation is reranking. The examples the authors discuss include MonoBERT and MonoT5, which score candidates after the initial search. The arrangement lets a system reserve its detailed evaluation for a fraction of the material available to search. In this application, the query is a sentence to be labeled, candidates are sentences from the same novel, and relevance means usefulness for deciding what type of entity the target contains. Passage Re-ranking with BERT and Document Ranking with a Pretrained Sequence-to-Sequence Model

To construct the missing judgments, the authors draw on systems that respond to written instructions with generated text. They describe training across multiple tasks and fine-tuning on collections of instructions as ways to develop that behavior. The paper seeks a generator that can produce a full sentence with a specific relation to a supplied name. It gives the tendency of BloomZ and mT0 to produce short responses as a reason for choosing Alpaca, which is based on Llama. The basic premise is that a researcher who knows what kind of sentence could be informative can ask for an example of that sentence, then use the example to demonstrate relevance. Finetuned Language Models Are Zero-Shot Learners, Multitask Prompted Training, Crosslingual Generalization through Multitask Finetuning, and LLaMA

The method, step by step

The input the recognizer eventually reads

The paper illustrates the process with Minas Tirith. An expression of admiration in the target tells the reader how someone regards Minas Tirith. A candidate that identifies it as the capital of Gondor supplies a different kind of information. It gives the recognizer a reason to interpret the name as a location. For the method to take advantage of such a sentence, the first search has to surface it, the scorer has to rank it highly, and the recognizer has to use its wording when assigning the target labels.

The search problem can be written in terms of a set of sentences drawn from the document.

Sᵢ ⊆ Dᵢ, |Sᵢ| = k

Here Dᵢ is the document containing the target sentence sᵢ. The index i associates the target with its source and its retrieval result. Sᵢ is the set selected for that target. The symbol ⊆ means each selected sentence belongs to the document. The bars around Sᵢ indicate the size of the set, and = gives its requested value k. The shared-noun baseline can return fewer sentences when it runs out of qualifying matches.

Once the selection is made, the authors combine the target and the chosen sentences into an ordered input they call Ŝᵢ. The hat distinguishes this input from Sᵢ, which refers only to the selected context. They retain the relative order of the sentences in Dᵢ. A sentence drawn from earlier in the book therefore goes before the target, and one drawn from later goes after it. Predicted relevance determines which sentences enter that input. Book order determines where they go.

The recognizer receives the assembled text and produces labels, of which the procedure keeps those for sᵢ. Because only the target predictions matter, a candidate can be used even when its own entities have never been annotated. A later chapter can therefore be a source of evidence while the annotated material remains concentrated in the opening chapters.

From generated examples to entity labels in a novel

The steps in order.

From generated examples to entity labels in a novelStep 1: Request clues for annotated names1. Request clues for annotated namesStep 2: Construct mismatched sentence pairs2. Construct mismatched sentence pairsStep 3: Train a scorer for context relevance3. Train a scorer for context relevanceStep 4: Collect plausible sentences from the novel4. Collect plausible sentences from the novelStep 5: Score each candidate against the target5. Score each candidate against the targetStep 6: Place selected sentences in book order6. Place selected sentences in book orderStep 7: Predict and retain the target labels7. Predict and retain the target labels

Positive examples built around the kind of entity

The task of learning which sentences to include begins with pairs of texts. One part comes from an annotated literary sentence. The other is the proposed evidence. The paper represents the training records as follows.

(sᵢ, sⱼ, y)

The parentheses group the fields of a record, and the commas separate them. The indexed symbol sᵢ is the target, while sⱼ is the candidate being judged in relation to it. The index j identifies the candidate and i identifies the target. The final field y records the relevance judgment.

y = 1 if sⱼ is relevant to sᵢ, and y = 0 otherwise

Here y is the label for the relationship between sⱼ, the candidate, and sᵢ, the target. The equals signs assign the values. The value 1 denotes a positive pairing, and 0 denotes a negative one. The test is directional. A candidate is relevant if it can help with entity recognition in the target. Whether the target would be useful evidence in the reverse direction is a separate question.

To create a positive record, the authors take a target from the recognition training data and select an annotated entity in it. The class tells them which kinds of clues they can request. The labels are PER for a person, LOC for a location, and ORG for an organization. The authors identify descriptions as useful for all these classes. They also use a person’s action as evidence for PER, and a traveler’s movement toward a named destination as evidence for LOC. A description is the pattern they use for ORG.

The prompts turn these choices into recognizable situations. For a description, the generator is told what kind of entity the name stands for and asked to produce a sentence that characterizes it by name. In the paper’s One-Eye example, a generated sentence attributes insight and a mysterious character to One-Eye. Those details make the name readable as a person, which is the relevant property for the training pair. The example works as a demonstration of the type of evidence the authors seek even though the procedure allows invented details.

For the action prompt, the generator uses the specified character as an actor and mentions that character in the sentence. The paper gives Croaker as an example. The target is part of an exchange, while the generated response depicts Croaker walking and whistling. That piece of prose can help identify what sort of name Croaker is without supplying the missing parts of the original conversation. Where the target already provides some evidence, the generated sentence can still illustrate a more explicit cue.

The movement prompt gives a location a different role. The generator invents a character and describes that character going to the named place. In the example for Necropolitan Hill, the result introduces a named traveler and makes the hill his destination. Both names are present, and their roles in the sentence carry the distinction the authors want the scorer to learn. A general instruction to say something about Necropolitan Hill would leave the nature of that evidence less controlled.

A positive record thus links an authentic target to a new sentence written with the annotation in view. The category can be used during construction because it is already known for the training target. At prediction time, the scorer receives the sentence whose labels are unknown and has to recognize a useful relation from the wording of the pair. Providing the label at generation time gives the authors a way to create examples of useful evidence ahead of that decision.

The authors produce one positive example for each distinct entity string. The unit here is the name as written. A frequent string has the same allowance during generation as a string with few appearances. This prevents a often mentioned character from supplying a positive example at every occurrence. It also makes the check after generation straightforward. The authors discard an output if the candidate omits the target name. The check ensures that retained candidates contain an explicit point of contact with the target. Their assigned usefulness comes from the prompt and construction procedure.

Negatives from other books and other prompts

For the first kind of negative, the authors pair a target with a sentence sampled randomly from a different document. This supplies a piece of genuine narrative prose with a low expected connection to the target. It might mention a name or it might contain none. The paper illustrates the procedure by pairing a target about the Italian Catherine with a sentence about Alice trying to find an exit while swimming. Both sentences can give a reader information in their original settings. The sampled one has little bearing on the target it has been paired with.

This procedure creates a difference between positives and negatives that the scorer can learn too readily. Positive generated sentences have to mention an entity. Randomly selected sentences can lack one. The authors observed that training with only the random negatives made the scorer rely too heavily on whether a context contained an entity. That behavior could look successful in training while giving the scorer a poor basis for choosing among several named passages in a novel.

For the second kind of negative, the authors reuse a generated positive context. They replace the context of one positive pair with a context generated for another target.

(sᵢ, sⱼ, 1) → (sᵢ, sₖ, 0)

In the record to the left of the arrow, sᵢ is the target, sⱼ is its generated clue, and 1 marks the pair as positive. The arrow indicates the replacement operation. In the record to the right, sᵢ is unchanged, sₖ is a generated context borrowed from another pair, and 0 marks the new pairing as negative. The subscripts j and k distinguish the original and borrowed contexts. In this expression the subscript k identifies a borrowed sentence, while the standalone k in the search procedure is a count. Parentheses and commas have the same grouping and separating roles as in the training record.

The reused statement contains an entity because it originally served as a positive clue. Since the authors give distinct strings a single positive example apiece, a borrowed sentence has a good chance of being about a different name. Their illustration takes a target about reaching Klausenburgh and couples it with a description of Forley. The description has the form of a useful clue and includes a name. Its pairing with Klausenburgh gives the scorer a reason to pay attention to whose type the clue could establish.

The two procedures give the training set negatives with different properties. A random draw can teach the scorer to reject prose that bears little relation to the target at all. A swapped context can be fluent, explicit about an entity, and shaped like a positive example. It tests whether the useful-looking sentence belongs with that target. The label in both cases comes from the way the pair was formed. The paper describes sampling and swapping as mechanisms for producing likely mismatches, with no independent relevance judgment attached to each authentic or invented sentence.

The generator and the learned score

Alpaca-7b and Alpaca-13b each supply a version of the training collection. The collection generated with Alpaca-7b contains 2,716 examples, and the one generated with Alpaca-13b has 2,722 examples. The authors attribute the unequal totals to the filter that rejects positives missing the entity string. They say omissions were rare. The paper makes the synthetic retrieval data and accompanying code available under a free license.

Generation occasionally produced a detail that the target sentence had left unstated. For Gandalf the Grey, an output identified him as a wizard without receiving that information in the input. The authors suggest that this may reflect knowledge acquired during pretraining. For the retrieval procedure, the example shows that a generated clue need not come completely from words in the target. The instruction supplies the desired role of the context, and the generator can fill it with plausible details or information it already associates with the name.

The component that learns from the resulting pairs is BERT with a regression head, an output component for estimating a numerical value. It produces estimated relevance between 0 and 1. The architecture illustration puts [CLS] before the target, [SEP] between the target and the candidate, and another [SEP] after the candidate. These are input markers in the illustrated pair. They separate the roles of the two pieces of text that the scorer evaluates together.

During training, a positive or negative label gives the scorer an example at an endpoint of the relevance scale. Later, its estimated scores give an order over the candidates for a target. This use of the score is relative. A candidate that ranks ahead of another has priority when the system fills its context allowance. There is no conversion in the paper from a difference in estimated relevance to a predicted change in the recognizer’s F1.

The authors train the reranker for 3 epochs, or passes over the training data. They give the learning rate, which sets the scale of training updates, as follows.

2 × 10⁻⁵

The coefficient is 2, × indicates multiplication, and 10 is the base raised to the negative exponent ⁻⁵. The recognizer uses the same learning rate. It receives 2 epochs of fine-tuning with a classification head, which produces labels instead of a relevance value. The recognizer uses the bert-base-cased checkpoint from the Transformers software library. The two BERT components consequently have different jobs and different training targets. Transformers

From the novel to a small set of clues

When the trained scorer is applied to the literary benchmark, the document is the source of candidates. The method begins with simple ways of identifying potentially helpful sentences. BM25 supplies matches based on textual similarity. The samenoun heuristic looks for a noun that occurs in both the candidate and the target, using NLTK to identify nouns. Nearby sentences enter through separate searches on either side of the target. This supplies candidates from the immediate passage even when those sentences would do poorly under a lexical match.

Each source is given a quota n. The paper describes the nominal number of initial candidates with the following expression.

4n

The coefficient 4 counts the candidate sources. BM25 and samenoun each count as a source, and the preceding and following sentences count separately. The symbol n gives the quota for each source. Placing it next to the coefficient denotes multiplication. The stated size is nominal because different sources can find the same sentence. The procedure removes repeated candidates before scoring. The shared-noun rule can also have fewer matches available than the count requested from it.

The configuration search varies the per-source quota over the following settings.

n ∈ {4, 8, 12, 16, 24}

The symbol n still denotes the quota for a source. The membership symbol ∈ indicates that a tested value comes from the set enclosed in braces, with commas separating the alternatives. The authors vary the final selection size k from 1 to 8. The quota determines how many opportunities the scorer has to find a clue. The final count determines how much material the recognizer will receive.

For each authentic candidate on the shortlist, the scorer estimates relevance to the same target. The method keeps the highest-ranked candidates up to k, orders the resulting passages with the target, and asks the recognition component for labels. A sentence can reach the final input through any of the initial sources. Its source serves to get it considered. The learned score determines whether it survives the comparison with the other candidates.

This staging matters whenever an initial rule misses a useful sentence. The scoring stage can bring a candidate forward in the ranking only after the search has found it. Conversely, a search that finds promising sentences can still supply poor context if its selection favors weak evidence. Both decisions influence the words the recognizer receives, and the recognizer’s use of those words is what ultimately determines the measured outcome.

Experiments and results

The benchmark and what its scores measure

The recognition data come from the English literary corpus originally assembled by Dekker and colleagues and subsequently corrected and expanded by Amalvy and colleagues. The labeled material consists of the opening chapters of 40 novels. The benchmark covers persons, locations, and organizations. The authors split the texts into sentences and obtain the full novels so that a candidate can come from outside the labeled chapters. The resulting setup combines a limited stretch of annotated targets with a much larger body of searchable prose.

This choice gives a specific meaning to recognition with full-book context. The cases being scored are sentences in the annotated chapters. The evidence used to make those predictions can come from anywhere in the novels under the book-wide condition. The experiment can measure the effect of access to later material without requiring gold labels for those later sentences.

The authors use the default evaluation mode of seqeval. Precision expresses how many predicted entities are correct, while recall expresses how much of the annotated set the system recovers. F1 combines the two. That combined score can favor a retrieval setting that corrects enough missed mentions to justify some additional wrong predictions, or penalize a setting where the extra mistakes outweigh the entities it recovers. Reporting precision and recall separately later helps the authors examine how this balance changes.

The experiments report means over 5 folds. The authors also average 3 runs for retrieval methods with random choices. This applies to samenoun, which draws from qualifying sentences, and to the random selectors. The recognizer is held fixed across the retrieval comparisons. This lets the authors observe how changing the supplied evidence affects the predictions of the same recognition component.

What goes into the comparisons

The no-retrieval baseline shows how the recognition component performs with the target alone. The surrounding baseline includes adjacent sentences. BM25 chooses matches according to its own similarity ranking, while samenoun selects from sentences with a shared noun. Each of these search rules can put more text in front of the recognizer. Comparing them with the trained scorer tests whether a judgment learned from sentence pairs improves the choice.

The paper also tests random selection after the initial search. The pooled random reranker draws k sentences from the combined candidates. The bucket version uses the following rule for each source.

k/4

Here k is the requested number of retained sentences, the slash means division, and 4 is the number of source buckets. The expression states the intended share from each heuristic. The pooled selector can draw its context from whichever sources the random sample happens to favor. The bucket selector is designed to give the sources equal representation. Both rely on the earlier search to put potentially useful sentences within reach.

The supervised comparison uses MonoBERT-large and MonoT5 trained on MS MARCO, which supplies human passage retrieval judgments. For the conventional retrieval setup, each reranker receives 16 candidates from BM25. The authors also run each reranker with candidates gathered by all the heuristics. This gives the passage-trained scorers access to the same kinds of initial matches as the paper’s own system. The combined-pool conditions are the closest comparisons for asking how the supervised scorers perform when their training was aimed at different tasks.

Aggregate gains and the result for a single book

In the tuning experiment, the strongest configuration uses the training collection generated by Alpaca-7b, a quota of n = 8 candidates per source, and a final selection of k = 3. In the comparison against the unsupervised baselines, the neural system also reaches its peak with k = 3. The authors report a gain of around 1 F1 point on recognition in the annotated chapters relative to the target-only condition. That gain concerns performance on literary entities after retrieval and recognition have both taken place.

Simple approaches often help as well. In the comparison with the target-only baseline, exceptions to the general benefit occur when surrounding or BM25 supplies 6 sentences or more. The learned method generally finishes ahead of the heuristics across the conditions the authors compare. Its improvement therefore comes in a setting where much of the benefit of context is already accessible through inexpensive search, and where the way the context is selected can make longer inputs less helpful.

The authors examine individual titles with k = 1. This test asks what happens when each selector can add only one candidate to the target. The learned method ties or surpasses the unsupervised alternatives and the no-retrieval condition for 50% of the novels, reported as 20 out of 40. The statistic includes ties. It describes how frequently the learned selector is among the best configurations in that particular comparison, while the aggregate F1 gain measures the size of a recognition improvement across the benchmark.

In the same single-context comparison, The Black Company has an improvement of 8.1 F1 points over the no-retrieval baseline. It is the largest such gain among the books in the test. Its condition differs from the aggregate peak with k = 3. The book result shows how much difference selecting just one passage could make in that title. The per-book variation also means that a reader should expect no uniform improvement of that size across novels.

The supervised rerankers all perform better than the random selectors. The result indicates that the initial rules tend to produce a pool from which a learned judgment can choose more effectively than a draw by chance. The synthetic-data reranker slightly exceeds the other supervised methods, with the authors describing the results as close. The comparison gives concrete support to the idea that relevance examples built for the recognition task can compete with supervision from a human-annotated retrieval collection designed for another task.

In that comparison, using multiple search rules before reranking generally works better than using BM25 alone. Shared nouns and adjacent sentences offer routes into the shortlist that a BM25 ranking can miss. In the authors’ view, the result suggests that using BM25 alone for the initial search could cause it to miss important evidence. Improving the scorer and improving the chances that it encounters a useful sentence are distinct ways of improving the final recognition input.

A relevance score on a pair and an F1 score on names

For the chosen reranker, the paper reports 98.01 F1 on the evaluation portion of the synthetic context retrieval data. The decisions being evaluated there concern which constructed pairs count as relevant. Literary recognition F1 concerns the predicted spans and types in annotated book sentences. The synthetic evaluation shows how well the scorer handles pair labels assigned by the construction procedure. The downstream experiment tests whether the training carries over to a useful choice among sentences that authors of novels wrote for their own narratives.

The paper gives example scores for a target mentioning the Ministry of Truth. A candidate describing the areas for which the ministry is responsible reaches the top of the score range. A candidate about Winston going towards the stairs reaches the bottom. The first sentence relates to the named institution as well as giving some grounds for interpreting it as an organization. The second belongs to the narrative but offers a different focus. These are alternative context settings for the same target.

Predicted context relevance for two candidates for the Ministry of Truth target in the literary corpus

The learned reranker favors the ministry’s remit as evidence for the target over Winston’s movement.

Predicted context relevance for two candidates for the Ministry of Truth target in the literary corpusCandidate about Winston and the stairs: 0.0Candidate about Winston and the stairs0.0Candidate about the ministry’s remit (this paper): 1.0Candidate about the ministry’s remit(this paper)1.0
The numbers
System or settingPredicted relevance
Candidate about Winston and the stairs0.0
Candidate about the ministry’s remit (this paper)1.0

The scores illustrate the pairwise decision the authors want from the scorer. General belonging to the same story cannot account for this preference. A candidate’s connection to the institution and the information it adds about that institution give a more direct explanation. These are illustrative judgments made by the trained reranker. The paper’s recognition comparisons concern what happens over the annotated chapters after the chosen evidence has actually been used.

What the ablations show

A bigger shortlist and a longer input change different things

The authors’ configuration sweep varies both how many initial candidates the reranker can inspect and how many of those candidates enter the recognition input. Their finding that n = 4 is too small concerns the former choice. With a small quota, the search may fail to put enough good candidates in front of the scorer. The authors offer that as a likely explanation for the lower performance. They measure the recognition outcome, leaving the number of truly useful sentences missed by the search unknown.

A larger quota tends to help at high values of k. When a recognizer will receive a relatively large set of sentences, a deeper pool can give the ranker a better chance of filling it with useful material. The strongest results still sit with k between 2 and 5. This is consistent with a scorer that can use a broader choice of candidates to make a small final set better. The two counts control different things. Changing n can improve the options for a given slot in the final input. Changing k fills additional slots, including with candidates that had ranked below the initial selection.

The sweep establishes that both choices affect the outcome. It also gives context for the weaker results when a heuristic returns many neighbors or many BM25 matches. An extra sentence may contain a clue, repeat information already present, or occupy part of the input with less relevant prose. The paper’s F1 measurements reflect the recognizer’s response to the resulting input. They do not identify which of those possibilities applies to each additional sentence.

The larger Alpaca variant makes little downstream difference

The generator comparison holds the basic construction procedure in place while changing the Alpaca variant that supplies the generated text. Alpaca-7B has 7 billion parameters and Alpaca-13B has 13 billion. Each resulting collection trains a BERT reranker. The outcome used for the comparison is literary recognition after that reranker has selected real context, so the experiment asks whether the change at generation time has a consequential effect through the entire pipeline.

The paper finds very little difference in recognition performance between the two generator variants over the candidate quotas surveyed. The chosen configuration uses the smaller one. The clues requested by the prompts have readily identifiable forms, such as describing a person by name or placing a location at the end of a journey. It is plausible that both variants supply enough of these examples for the scorer to learn, but the experiment gives no separate measure of the quality or variety of what they write. Its result concerns the final scores for these particular training collections and the tested literary task.

This comparison also clarifies what the authors varied. Enlarging the generator changes the examples available to the scorer. It leaves the recognition component and the general process of selecting test candidates in place. The small observed effect therefore belongs to the choice between these generators for this method. It does not establish how another kind of prompt or another source of synthetic supervision would behave.

The context-window comparison contrasts searching the target’s opening chapter with searching the full novel. It covers BM25, the shared-noun rule, and learned reranking. For the neural configuration, the authors run the comparison at multiple shortlist sizes.

n ∈ {4, 8, 12}

Here n is the quota per heuristic in this comparison. The symbol ∈ indicates membership in the set written inside the braces, and commas separate the tested quotas. At each search range, the final count of sentences supplied to the recognizer is varied as well.

BM25 can perform better with the chapter alone when asked for a small number of sentences. Beyond 2 selected sentences from the chapter, performance falls sharply. The decline is less pronounced with access to the entire book. The authors suggest a possible saturation effect. The chapter can provide a few close matches. Once those are included, further high-ranking matches from the same chapter may supply little additional evidence. Whole-book search gives BM25 more places to find candidates as the requested count rises.

The shared-noun rule shows a similar initial preference for the chapter. The paper suggests that nouns recurring within the immediate chapter have a better chance of referring to the same entities or events relevant to the target. With a sufficiently large selection, the pattern reverses. For k greater than 4, book-wide search does better. One explanation offered by the authors is that drawing more matches from the wider pool improves the odds of including a sentence that genuinely helps. The observation concerns the behavior of the rule under its sampling process, and the explanation remains an interpretation.

The learned reranker has a different response to the chapter restriction. Its recognition performance drops substantially compared with book-wide search, and the drop persists across the tested quotas. This provides evidence that its ranking can exploit useful options made available outside the chapter. The recognizer still reads a short input under either condition. A benefit from opening the search range can arise because different sentences reach that input, even though recognition continues to operate over a limited sequence.

These patterns explain why selecting a search range depends on the way the candidates are chosen. For a simple match, a chapter can favor candidates sharing the immediate narrative subject and exclude a large set of superficial matches from elsewhere. A learned scorer has a further opportunity to judge the available sentences after that initial search. Its results suggest that access to the richer pool matters in this setting. The experiment does not locate the relevant sentences within that larger range or report how far from the target the useful selections usually lie.

What changes when a selector sees extra text

The authors also break out precision and recall for the unsupervised methods and the learned one. Retrieval generally raises recall. The reported exception is surrounding at k = 8. Precision can fall for any of the methods at some context sizes. The recognizer can therefore find more of the entities marked in the benchmark while a greater share of what it predicts is wrong. This helps explain why the sign of a change in F1 can depend on how many sentences a method selects.

The precision and recall curves do not trace altered predictions back to particular words or candidates. They do show that the aggregate F1 gain can come with an uneven trade between recovering missed entities and keeping current predictions accurate. A method that adds evidence for finding a name may also alter the interpretation of other words in the target. The analysis provides the overall balance of those effects for each setting.

The comparisons against random selection give a separate control. Draws from a heuristic pool already benefit from a search restricted to plausible sentences. The stronger scores for supervised selectors show that ranking adds value after this restriction. Comparisons with a BM25-only pool show how changing the search can also make a difference before that ranking takes place.

Other design choices receive qualitative treatment. The authors explain the tendency they observed when negatives came only from random draws and why swapped clues could counter it. They give no recognition score for a version that removes swapping. Similarly, the descriptions, actions, and movements illustrate different kinds of positive evidence, but there are no separate F1 estimates for removing each prompt type. The controlled results identify effects for the generator variants, the search range, and the choice and size of the candidate and context sets.

Limitations

Limits the authors identify

The authors explicitly identify independent scoring as a limitation. The scorer estimates the relevance of each sentence to the target in isolation from the other candidates. A sentence that gives a helpful class cue can score highly. A different sentence can earn an equally high place for supplying essentially the same information. Removing repeated entries on the shortlist handles the case where several heuristics return the same sentence. It leaves intact the redundancy of different sentences that provide equivalent evidence.

This problem has two consequences in the authors’ discussion. Repeated information can increase the recognizer’s input length and inference cost without helping the prediction. Also, if several mentions in the target need clarification, the highest-ranked candidates can spend the whole context allowance on the same mention. A separately scored candidate is judged against a target that still lacks the other clues. The scoring procedure gives it no way to account for what the recognizer is already going to see.

The paper proposes an iterative direction for addressing this. After choosing a candidate, a system could add it to the text that the scorer considers and judge the remaining candidates against the expanded input. A later choice could then depend on information supplied by an earlier one. The paper presents this as a possibility for future study and gives no result for it. It remains an open question whether conditioning the ranking on previous selections would improve recognition enough to justify the extra scoring work.

The authors also acknowledge costs at both stages. They describe the retrieval cost as growing linearly with the number of sentences in the searched document. The shortlist bounds the number of detailed pair evaluations that follow, and every added context sentence can increase the cost of running the recognizer. The method avoids full attention over a sequence containing the complete novel by searching at document scale and reading a shorter input. The study reports prediction quality rather than timings or resource use, leaving the practical cost of those choices unquantified.

A third limitation concerns bias. The authors point to biases involving gender, religion, and age in Llama, which provides the basis for Alpaca. If those patterns affect the descriptions or actions that Alpaca generates, they can enter the collection that teaches the scorer what useful evidence looks like. The authors identify this as a possible route for bias to affect context selection. They give no measurement of how often it occurs or its effect on individual groups in the literary evaluation. On Biases in Language Generation

Limits apparent from the experimental setup

The annotated targets are opening-chapter sentences in English novels. Book-wide search can retrieve text that comes after them, including clues that a reader following the story in order has yet to encounter. The results apply to the setting where the book is already available at prediction time. They leave separate questions about targets drawn from later chapters and applications that can search only the text seen so far. Changing either condition can change what evidence is available at the point of prediction.

The benchmark covers person, location, and organization. The clue types are informed by the distinctions among those categories. A traveler arriving at a named destination is particularly suited to demonstrating location evidence. Another recognition inventory could require different relations or evidence expressed at a different scale. The authors propose applying synthetic retrieval data to other language tasks where evidence can lie elsewhere in the document. That proposal assumes some prior understanding of what a helpful candidate would look like in the new task. The literary experiment establishes the approach for the setup the authors designed around these classes.

There is also a gap between a constructed relevance label and a demonstrated effect on a recognition decision. The check on positive generation confirms that the target string occurs in the context. A generated description could pass that check while saying little about the entity’s class. A swapped or randomly selected candidate can occasionally have an informative connection despite being assigned a negative label. These possibilities follow from the construction rules. The paper does not estimate their frequency. The synthetic evaluation tests agreement with the assigned pair labels, while testing on the novels gives a separate, downstream measure of whether training on them is useful.

The comparison with passage rerankers speaks to a practical choice of available supervision. The trained systems differ in their task and training data, and the comparison includes different reranking architectures. In particular, the study has no set of human judgments of what helps recognition in the same literary contexts, which is the data gap that motivates generation. A comparison against such judgments with the same architecture could address how much the labeling process itself matters. The measured slight lead concerns the particular synthetic system and passage-trained baselines the authors run. The reported comparisons give means and the variation across books, with no uncertainty estimate for that small supervised edge.

Finally, the end-to-end score leaves room for several explanations of an error. A novel may provide little illuminating evidence for a target. A passage may exist and fail to reach the initial candidates. A useful candidate may rank too low, or it may be selected and then have little effect on the labels. Restricting the search range and changing the selector help probe these stages in aggregate. Since the authentic candidates have no independent relevance labels, the experiments cannot attribute individual failures to a particular stage. What they measure most directly is whether the combined search, ranking, and recognition procedure gives more accurate predictions in the annotated chapters.

What came after

The survey on generative information extraction cites Amalvy and colleagues. The connection to information extraction is through the training material. In Amalvy and colleagues’ procedure, generation gives the retriever examples of what evidence might look like, and the evidence used for prediction comes from the original document. The output of the recognition task is still a set of labels assigned to text.

The citation establishes that the study entered the survey’s coverage of the field. The details of how the survey treats the method, including whether it discusses the literary experiments, remain unspecified. The paper itself leaves two directions open for subsequent study. One is to choose clues in light of the other clues already selected. The other is to generate retrieval supervision for different tasks whose predictions depend on information elsewhere in a document.

Cite

Cite as Arthur Amalvy, Vincent Labatut and Richard Dufour. 2023. Learning to Rank Context for Named Entity Recognition Using a Synthetic Dataset. Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.18653/v1/2023.emnlp-main.642

@inproceedings{amalvy2023learning,
  title = {{Learning to Rank Context for Named Entity Recognition Using a Synthetic Dataset}},
  author = {Arthur Amalvy, Vincent Labatut and Richard Dufour},
  booktitle = {Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  doi = {10.18653/v1/2023.emnlp-main.642},
  url = {https://doi.org/10.18653/v1/2023.emnlp-main.642}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/amalvy-2023-learning-rank-context-named-entity/