What GPT Knows About Who is Who (2022)

Abstract: Coreference resolution – which is a crucial task for understanding discourse and language at large – has yet to witness widespread benefits from large language models (LLMs). Moreover, coreference resolution systems largely rely on supervised labels, which are highly expensive and difficult to annotate, thus making it ripe for prompt engineering. In this paper, we introduce a QA-based prompt-engineering method and discern generative , pre-trained LLMs’ abilities and limitations toward the task of coreference resolution. Our experiments show that GPT-2 and GPT-Neo can return valid answers, but that their capabilities to identify coreferent mentions are limited and prompt-sensitive, leading to inconsistent results.

## introduction coreference resolution (cr) aims to identify and cluster all words (i.e., mentions) that refer to the same entity or event. solving this task is essential for natural language understanding, as mismatched references will lead to bias. recent improvements in cr have been incremental @xcite @xcite , compared to other nlp tasks that have demonstrated more real-world impact. one reason is the limited training corpora. for example, one of the primary datasets, ecb+ @xcite , contains only 984 documents, including 6,833 mentions and 2,741 clusters. moreover, this dataset was built around 43 news topics ten years ago, potentially leading to generalization problems for the state-of-the-art (sota) models. when dealing with low-resource tasks, there is an emerging trend to perform prompt engineering with pre-trained lms. unlike fine-tuning @xcite , prompt engineering does not update the pre-trained model's weights when completing the downstream task. instead, one transforms the downstream task to match the original task of the pre-trained model @xcite . for example, for machine translation, one can create prompts such as "english: i love bread. french:" and input them to a generative lm (e.g., gpt-2). if the pre-trained model encountered similar patterns during training, it should be able to generate the translated french sentence. nevertheless, to the best of our knowledge, there is scarce research on applying this approach to coreference resolution @xcite . to better understand if pre-trained lms can help resolve coreferences, we construct a qa-based prompting method and experiment with both gpt-2 @xcite and gpt-neo @xcite . by using this prompting methodology, we measure if these models can predict whether two mentions are coreferent. for evaluation, we use the ecb+ dataset, which provides gold mentions and clustering labels. we compare the results with unsupervised and supervised coreference resolution models, including a classic rule-based system @xcite , the seminal end-to-end neural model @xcite , and a recent sota model @xcite . ## related work prompt-based learning prompt-based learning is a fast-growing area in nlp, as it can reduce the need to fine-tune models and rely on supervised labels. according to the survey by liu et al., over 120 papers have been published since 2019, which collectively demonstrates effectiveness toward many different tasks: text classification @xcite , factual probing @xcite , question-answering @xcite , and more. nevertheless, to the best of our knowledge, only one prompt-based learning paper concerned cr. specifically, sanh et al. introduces t0, a zero-shot generalization of t5 @xcite . the authors convert various supervised datasets into task-specific prompts, figure 1 : an example of prompt-based learning for cr. the green block represents the prefix, which serves as the description of the cr task and remains unchanged throughout an experiment for all inputs x. the purple block is the unfilled prompt, which changes for each input x and serves as the prediction. moreover, in each block, the yellow part is the prompting function while the blue and red parts are the original data x and y, respectively. traditional cr models similar to other nlp tasks, most cr models can be categorized as being either unsupervised or supervised. a commonly used unsupervised model is the multi-pass sieve model @xcite . this rule-based system extracts entity mentions and clusters them by applying 13 "filters" in successive manner. amongst supervised models, e2e-coref @xcite is the seminal end-to-end neural model. this model performs within-document cr and was trained on the ontonotes (conll-2012) dataset. building on this architecture, @xcite performs cross-document cr for entities and events by training on the ecb+ dataset and using roberta @xcite as an encoder. although supervised models offer significant improvements over unsupervised models, they are expensive to train; most sota models have o(n 4 ) complexity, where n is the length of each document. ## methodology this section introduces our prompt-based learning method for cr. typically, cr models can be broken down into three sub-tasks: ( 1 building on the approach introduced by @xcite , we define our input x as [text, m 1 , m 2 ] and output y as a binary label. specifically, m 1 and m 2 are a pair of gold mentions in a document, and the text are the sentences containing those mentions. for example, in figure 1 , within each green box, the successive blue parts are text, m 1 , m 2 , respectively. we define a prompting function f , which takes x as input and produces a question prompt q x (equation 1 ). further details about f are in appendix a. moreover, to allow the model to understand the task, we use few-shot learning @xcite by constructing a filled prefix. in particular, we select k examples, a, from the training dataset and feed these examples into the same prompting function f . then, we append the true label ('yes' or 'no') to the outputs, yielding the filled prefix q a (equation 2 ). to be clear, each individual prefix q @xmath0. last, adding the unfilled prompt q x to the filled prefix q a will give us the full prompt for data point x. this allows us to get a prediction z without updating any parameters θ in the pre-trained lm. since we use pre-trained lms directly, without fine-tuning, we do not have control over its output; the model can generate invalid answers beyond our desired outputs, 'yes' or 'no'. therefore, we repeat the process m times to get a more robust prediction z. to mitigate the bias of one specific f , we average the output of n different prompt formulas to get the final prediction (equation 4 ). to generate a prefix x 0 , we experiment with three data sources: the training sets of wsc @xcite and ecb+ @xcite , and a simple dataset that we manually generated. the wsc dataset was used in the research most similar to ours, t0 @xcite , which we compare against while using much smaller pretrained lms (i.e., gpt-2 and gpt-neo). as mentioned, ecb+ provides more natural and comprehensive references than wsc. our manually generated dataset uses 10 very simple examples -allowing one to discern the impact on performance. when using the ecb+ dataset, we only considered pairs of mentions that are within the same or successive sentences. when evaluating our model, we considered all mention-pair combinations, [m 1 , m 2 ], within said sentences. relying on the gold mentions, we obtain a dataset with 17832 candidate mention pairs, among which 7.86% are positive samples. finally, we apply 5 prompt functions from @xcite to generate the full prompts. models we used three traditional cr models as baselines: multi-pass sieve @xcite , the seminal end-to-end neural model (e2e-coref ) @xcite , and a sota extension (the streamlining model) @xcite . respectively, these models represent three categories: a rulesbased model, a supervised model trained on a different dataset, and a supervised model trained on the same dataset. in terms of implementations, we use the corenlp toolkit for the multi-pass sieve model @xcite and allennlp @xcite for e2e-coref. since there is no publicly available pre-trained streamlining model @xcite , we fully train the model from scratch using a v100 gpu on google colab. to fairly compare with other models, we set a 0.5 threshold for the pairwise scorer in the streamlining model. we evaluate all models by their mention pairwise scorers, not their clustering decisions. limited by our computational resources, we choose gpt-2 and gpt-neo-125m as our pretrained lms foot_0 . during inference, the output token length is set to 1, since our expected output is one word (i.e., 'yes' or 'no'). to generate more robust results, the repetition parameter m is set to 5. we ran our text generative models with multiple temperature settings ranging from 0 to 1, none of which produced significant changes. we settled on using a value of 0.7, to limit the greediness of the generated responses. in terms of few-shot learning, we experimented with @xmath1, 2, 4, 10} and display the results from the 4-shot setting since it produces the best accuracy. to reduce bias introduced by prefixes, we ensure each prefix has equally-balanced samples. for example, for the 4-shot setting, the filled prefix will have 2 positive examples and 2 negative examples. ## results and analysis we first question if gpt-based models can produce valid answers. in figure 1 , we observe that gpt-2 predicts 'yes' or 'no' for over 93.7% samples when at least 2 filled prefixes are provided. however, although the answers are valid, they are inaccurate. in figure 2 , we plot the distribution of predicted labels for each model, where the red bars denote the distribution of positive examples (ground truth), and the blue bars denote negative ones (ground truth). traditional cr models generally predict low values for negative examples, indicated by blue bars being concentrated at 0. as for positive examples, e2e-coref shows better precision since more positive examples are classified correctly at 1. yet, gpt-2 seems to be both sensitive to prompts and unstable over the repetitions of each prompt. furthermore, gpt-neo's predictions are inaccurate and no better than random, even though it predicts consistent results for multiple runs with the same prompt. similar conclusions can be drawn from pos and entity types while the overall performance indicates that gpt models are comparable to a random model, we hypothesize that for some subset of mention pairs, gpt might perform better. to investigate, we conducted experiments based on part-of-speech (pos) tags and named-entity types. figure 3 shows that both gpt-2 and gpt-neo can capture coreferent relationships relatively better when the second mention is a pronoun. moreover, this trend is stronger when the first mention is a pronoun or a proper noun. nonetheless, e2e-coref performs better than both gpt models across all pos tags, and the gap is widest when the second mention is a nominal noun phrase. as for named entities, figure 4 shows that both gpt-2 and gpt-neo perform better in precision when one mention is of type person. moreover, gpt-neo can identify coreferent relationships more precisely if the second mention is non-gpe locations (i.e., loc). however, their precision scores are far lower than the scores from classical cr models. in particular, both the multi-pass sieve model and e2e-coref model reach the highest precision when a mention is a product object (e.g., vehicle, food) or a norp object (e.g., nationality, religious or political group). mention similarity in addition to inspecting how performance varies with mention types, we also considered how performance is affected by mentions' similarity. using pre-trained bert (devlin et al., 2018), we encode each mention into span representations by averaging its tokens' last hidden states. then, we measure cosine similarity between mention pairs. figure 5 shows that f1 scores generally improve as the semantic similarity increases. although, the multi-pass sieve model maintains a low f1 because it is a rule-based model that tends to predict false for most samples -which yields a high accuracy for unbalanced datasets. the e2e-coref model performs well on mentions that are not so similar, while the performance of streamlining model improves drastically as similarity is greater than 50%. however, both gpt-2 and gpt-neo yield low f1 (approximately 0.2) for mention pairs with less than 70% similarity. when considering mentions of higher similarity, gpt-based models can achieve over 0.4 f1 score. ## conclusion in this paper, we rely on prompt-based learning to analyze how much gpt-like models know about coreference resolution. despite the popularity of prompting in recent nlp research, we find that llms perform poorly on this task without finetuning. nonetheless, these models achieve relatively better performance for specific types of mentions, including pronouns and person objects, and mention pairs with high similarity.