A Deep Metric Learning Approach to Account Linking (2021)

Abstract: We consider the task of linking social media accounts that belong to the same author in an automated fashion on the basis of the content and meta-data of the corresponding document streams. We focus on learning an embedding that maps variable-sized samples of user activity–ranging from single posts to entire months of activity–to a vector space, where samples by the same author map to nearby points. Our approach does not require human-annotated data for training purposes, which allows us to leverage large amounts of social media content. The proposed model outperforms several competitive baselines under a novel evaluation framework modeled after established recognition benchmarks in other domains. Our method achieves high linking accuracy, even with small samples from accounts not seen at training time, a prerequisite for practical applications of the proposed linking framework.

## introduction the scale and anonymity of social media pose systematic challenges for manual moderation efforts @xcite . these challenges have motivated the development of automated methods to identify abusive content, such as @xcite , which considers automatically classifying hate speech, or @xcite , which deals with detecting violent extremism, both in the twitter domain. however, automatic moderation remains a difficult problem. indeed, existing methods based on hand-constructed resources such as keyword lists may fail to adapt to novel trends @xcite whereas automatic methods based on statistics of large corpora may exhibit harmful biases @xcite . additionally, individual posts may fail to contain sufficient information to reliably identify them as harmful. this work considers account-level moderation. specifically, we consider the problem of determining whether two document streams share the same author, based on samples from those streams rather than individual documents. this capability has numerous applications, such as detecting users attempting to circumvent account bans, identifying sockpuppet accounts, and detecting coordinated disinformation campaigns involving multiple authors controlling multiple accounts. as a motivating application, we consider the enforcement of account bans on anonymous platforms, such as reddit. given a new account, the problem is to automatically identify whether it matches any previously banned account, which amounts to making binary decisions about whether pairs of accounts share the same author. variations of this problem have been studied before. for example, @xcite learn a classifier to determine whether the author of a twitter comment belongs to a small, closed set of authors. in contrast, we are interested in an open-world setting, requiring binary decisions about arbitrary pairs of accounts. this introduces a number of challenges. first, any individual comment may be too short to serve as the basis for linking accounts. figure 1a illustrates this empirically using a variation of our model, where embeddings of individual comments from the same account fail to coalesce, making it difficult to assert that an account has the same author as another account. see §4 for further experimental details. therefore, we focus on aggregating information across contiguous sequences of documents. figure 1b illustrates the impact of aggregation using our full model, where aggregations of contiguous sequences of documents from the same account exhibit an approximate convergence behavior as the number of documents aggregated increases. in fact, the motivating application above requires linking accounts on the basis of samples of widely varying sizes. indeed, banned accounts typically have many documents, all of which we would like to consider, while new accounts generally have few documents, which nevertheless must be linked to banned accounts as quickly as possible to mitigate abusive behavior. the second challenge is that of spurious associations. for example, over a short period of time, an author may discuss only a single, narrow topic. while a naïve model based on word statistics alone might be sufficient to link such an account to another, this approach would fail to generalize over longer periods of time due to topic drift. both our training procedure and evaluation framework have been designed to ensure that our model learns the appropriate invariances to identify same-authorship, rather than being correct for the wrong reasons @xcite . namely, samples from an account are drawn from different time periods in each training iteration (see §2.3), while the evaluation data consists of posts by accounts not seen at training time and is future to all the training data (see §4.2). finally, the numbers of banned and new accounts may be quite large, requiring a still larger number of pairwise comparisons. for this reason, our proposed approach to account linking consists of embedding variable-sized samples from document streams into a metric space whereby samples likely to have been composed by the same author map to nearby points. under this embedding, comparisons between document streams amount to pairwise distance calculations, so our approach is highly scalable and amenable to various optimizations, such as approximate nearest neighbor methods. our primary contributions are the following: in particular, we propose benchmark datasets as well as verification metrics tailored to our application. our code, data splits, and scripts to reproduce our experiments are available at http:// github.com/noa/naacl2021 . ## learning embeddings of document streams we treat a document stream as a sequence of timestamped actions a 1 , a 2 , . . . , a l where each a i is a structure containing the data comprising an action. the possible contents of a i are specific to the document stream, but include at least a timestamp in this work we focus on textual content published on social media platforms, although the approach would easily extend to allow a 1 , a 2 , . . . , a l to contain other modalities such as images or video, which would be handled similarly. in addition, we a sample from a document stream is a contiguous subsequence of its actions. we introduce an embedding f θ in §2.1 mapping a variable-sized sample to a point in a vector space, such that the euclidean distance between the embeddings of two samples quantifies the likelihood that they belong to the same author. ## related work the separate but related problem of closed-world author attribution has received considerable attention. for example, the pan 2019 challenge (daelemans et al., 2019) employed a closed-world setting with a small number of authors that are the same at training and test time. that task also considered longer documents, obviating the need for aggregating evidence of authorship across multiple documents. generic text embedding methods such as the universal sentence encoder @xcite and bert @xcite are fit using auxiliary tasks, such as conditional language modeling. in the case of bert, this is usually followed by supervised fine-tuning for a downstream task of interest. in this work, we are interested in learning representations that are immediately useful for our account linking task. however, because a large corpus of task-specific training data may be collected without human supervision, the benefits of generative pre-training are diminished in our setting. indeed, the parameters of the text encoding are learned from a random initialization in all our experiments. our approach is further distinguished from generic embedding methods by featuring a multi-document embedding, mapping a sequence of documents to a single vector, where each document may consist of both text and metadata. the most closely related prior work is the invariant user representation (iur) proposed by andrews and bishop (2019), whose approach is broadly similar to ours, but only considers samples of a fixed size. our approach may be viewed as a generalization of that work in support of the account linking task. in addition we use a simpler dot product attention mechanism and introduce the use of scalable metric learning losses in §2.4, which enable us to train our model on an order of magnitude more data than previously considered. we validate these improvements in §4.2 using the ranking task proposed by @xcite . we also adapt iur to serve as a baseline in our primary linking task in §4.3. we believe that our treatment of account linking as a pairwise recognition task between document stream samples and our proposed general-purpose evaluation protocols are both novel. however, in prior work, there have been several platformspecific approaches to account linking. for example @xcite explore a heuristic approach to linking accounts across social media platforms. separately, on platforms with rich social network information, graph-matching methods have been explored @xcite . our focus is on content-based account linking, which is more general than prior methods we are aware of. some other related but distinct problems include detecting deceptive accounts @xcite and authorship classification of short messages @xcite . ## experiments we conduct evaluations on the two primary tasks illustrated in figure 4 . first, our ranking evaluation described in §4.2 is motivated by information retrieval needs. although ranking is not the focus of this paper, it provides an assessment of the quality of the learned embedding in terms of similarity judgements and facilitates comparison with the baseline model iur. in addition, we use the ranking evaluation to monitor training using de- ## future work this work motivates a number of interesting research questions. first, the proposed model makes use of publication times, but only avails of the hour of the day. it would be interesting to examine continuous-time variants of our encoder that incorporate relative time differences between actions when aggregating their embeddings, in light of the fact that patterns of user activity might be highly discriminative. for example, bots and spammers typically post at certain times of day and with particular frequencies. separately, the proposed data augmentation methods we use to handle variablesized samples may also be applicable in other settings, such as multi-document summarization @xcite . finally, the scores we use to determine author matches could be calibrated, providing confidence estimates associated with the account linking decisions. to our knowledge, this work is the first to demonstrate the feasibility of a general-purpose account linking framework at web scale. indeed, figure 6 shows that performance improves as the size of the target increases, suggesting a speed-accuracy trade-off that can be tuned for different application settings. expanding on an idea above, if confidence estimates were available, they could be used to inform the necessary sample sizes to achieve an acceptable level of risk. finally, we note that the generality of the proposed approach make it potentially applicable to a wide range of applications, including source code attribution @xcite @xcite , plagiarism detection @xcite @xcite , and authorship attribution in collaborative documents @xcite .