# User Migration across Multiple Social Media Platforms

Ujun Jeong School of Computing and Augmented Intelligence, Arizona State
University, {ujeong1, anirmal1, kjha9<EMAIL_ADDRESS>Ayushi
Nirmal11footnotemark: 1 Kritshekhar Jha11footnotemark: 1 Xu Tang Department of
Economics, W. P. Carey School of Business, Arizona State University,
<EMAIL_ADDRESS>H. Russell Bernard Institute for Social Science Research,
Arizona State University<EMAIL_ADDRESS>Huan Liu11footnotemark: 1

###### Abstract

After Twitter’s ownership change and policy shifts, many users reconsidered
their go-to social media outlets and platforms like Mastodon, Bluesky, and
Threads became attractive alternatives in the battle for users. Based on the
data from over 16,000 users who migrated to these platforms within the first
eight weeks after the launch of Threads, our study examines: (1)
distinguishing attributes of Twitter users who migrated, compared to non-
migrants; (2) temporal migration patterns and associated challenges for
sustainable migration faced by each platform; and (3) how these new platforms
are perceived in relation to Twitter. Our research proceeds in three stages.
First, we examine migration from a broad perspective, not just one-to-one
migration. Second, we leverage behavioral analysis to pinpoint the distinct
migration pattern of each platform. Last, we employ a large language model
(LLM) to discern stances towards each platform and correlate them with the
platform usage. This in-depth analysis illuminates migration patterns amid
competition across social media platforms.

Keywords: Platform Migration, User Behavior Study, Twitter, Bluesky, Threads,
Mastodon

##  1 Introduction

In the years since the 1997 launch of Bolt and Six Degrees, social media have
become online hubs, offering many avenues for communication, entertainment,
and information [2]. Users are increasingly mobile, migrating between
platforms as their needs, preferences, and interests evolve, driving intense
competition among social media platforms for user attention. One example is
the substantial migration from Twitter to Mastodon following Twitter’s
ownership change [10, 24]. With the emergence of other platforms, like Threads
and Bluesky, users are questioning whether their current “cyber hometown” is
the best choice [21].

Prior research has examined the motivations behind platform migration and
typical behaviors of migrants–the pushes and pulls, as they are known in the
social science literature [6, 9, 10]. Here, we extend this research to
examine: (1) the varying engagement levels of migrating users based on their
new platform choice; (2) the competitive dynamics between platforms seeking
user attention and what influences their success; and (3) the perspectives of
migrants towards each platform and how these perspectives associate with user
behaviors.

Figure 1: The migration flow between Twitter and its alternatives: Mastodon,
Bluesky, and Threads. The dashed lines represent the shift of user attention
across these platforms.

To collect data on platform migrants, we identified the account handles of
16,000 users who initiated migration from Twitter to Bluesky, Threads, and
Mastodon, focusing on user profiles and their activities within the first
eight weeks after the official launch of Threads on July 5, 2023. For those
who did not migrate from Twitter, our sampling techniques leveraged network
traffic analysis between Twitter and its counterparts, ensuring the chances of
precise selection of non-migrants.

Our study is motivated by three questions:

  * •

RQ1: What characteristics distinguish migrant groups and non-migrants on
Twitter?

  * •

RQ2: What patterns of migration reveal the relationships between Twitter and
other platforms?

  * •

RQ3: After attempting to leave Twitter, did users sustain their engagement
with their new platforms?

With respect to RQ1, we analyzed the behavioral traits of migrants to Bluesky,
Threads, and Mastodon. We quantified their influence scores and compared them
to those of non-migrants to determine the level of presence of these migrant
groups on Twitter. This revealed that many users migrated despite their high
level of presence on the prior platform.

Regarding RQ2, we examined the evolving migration patterns with users’ active
status between Twitter and various pairs of platforms. Specifically, we
measured the power of attraction and inertia to understand source platform to
destination platform behavior.

Concerning RQ3, we assessed the perspectives of migrants on brand loyalty by
analyzing the texts in their posts. Paradoxically, although the use of Twitter
has increased over time, there was a distinct lack of loyalty expressed
towards Twitter. We also examined the correlation between their loyalty and
platform usage patterns to understand the power of inertia in choosing their
primary social media platform.

Our main contributions are as follows:

  * •

We curated a dataset of 16,000+ users migrating from Twitter to Bluesky,
Threads, and Mastodon, following those platforms’ terms of service.

  * •

To our knowledge, this is the first study to examine the differences among
multiple migrant groups (based on their chosen platforms) and contrast them
with non-migrants.

  * •

Our comparative analysis of migration shows that, despite the rhetoric to the
contrary, migrants have a strong inertia for Twitter over other platforms.

##  2 Related Work

###  2.1 Human Migration and Platform Migration.

Across the social sciences, the push-pull theory is widely used to explain
human migration. The theory assumes that for every migration event, there are
factors pushing people away from their home territory and factors pulling them
towards a new home [15, 14]. This can be applied to the migration of users
between social media platforms [23]. Unlike physical movement, where one is
constrained to a single location at a time, the digital world allows users to
engage with multiple platforms simultaneously. Such a dynamic calls for a
refined classification of online migrants [12]. In economics, the concept of
“service switching” parallels this phenomenon, portraying online users as
shoppers exploring various platforms to find their preferred choice [7, 8].
The study of platform migration necessitates an understanding of usage
patterns and the dynamics of competing options [3, 6].

###  2.2 Large-scale Online Migrations.

Historically, substantial migrations between social media platforms have been
observed, such as the shift from MySpace to Facebook [20] and from Facebook to
Instagram [9]. Often, these shifts stem from perceived deficiencies in one
platform and the emergence of superior features in another that better cater
to user needs. The main drivers for this migration include push factors, such
as low quality of service and bad experiences in social interactions, and pull
factors, such as the presence of attractive new features and highly
influential users on another platform. [9]. On Reddit, user migrations
occurred as a response to moderation, such as deplatforming [17, 19] or policy
changes [16]. Recently, Twitter’s ownership change spurred a mass migration of
users to Mastodon [13]. However, doubts arose about whether Mastodon could
retain these users [10], prompting users to explore alternatives such as
Bluesky and Threads.

Our research differs from previous studies on platform migration by examining
the dynamics of user migration across multiple platforms, focusing on users’
perspectives on inter-platform relationships. This study underlines potential
factors for users reverting to their prior platform and challenges in platform
migration.

Figure 2: The trend of deleted and suspended migrants’ accounts on Twitter
over time. The red dashed line marks the date Twitter announced its rebranding
to “$\mathbb{X}$”.

##  3 Preliminaries

In social media and migration studies, two types of migration are defined [9,
15]: (1) Permanent migration, where users transition to a new platform,
deactivate their original account, and exclusively engage on the new platform;
and (2) Temporary migration, where users maintain a presence on both platforms
but switch their focus between them.

#### Permanent Migration

If user $u$ was a member of platform $p_{1}$ at time $t$ and is no longer on
$p_{1}$ at time $t^{\prime}$, but has joined $p_{2}$, then user $u$ is
considered to have permanently migrated from platform $p_{1}$ to $p_{2}$.

#### Temporary Migration

If user $u$ is a member of $p_{1}$ before time $t$ and is found on platforms
$p_{1}$ and $p_{2}$ at a later time $t^{\prime}$. That user is considered to
have temporarily migrated from platform $p_{1}$ to $p_{2}$.

Every day at 6 AM, we checked the status of 16,079 user profiles for signs of
permanent migration through actions like profile deletion or suspension on
Twitter. As shown in Figure 2, only 1.6% (270 out of 16,279) deleted their
accounts on August 7th, 2023. Most of these migrations occurred after
Twitter’s rebranding to “$\mathbb{X}$”, implying that rebranding either
precipitated or intensified this move [11].

In accordance with the GDPR guidelines111https://gdpr.twitter.com/en.html, we
refrained from gathering information on individuals who deactivated their
Twitter accounts. We only verified the existence of their accounts using the
Twitter API. As a result, our remaining study emphasizes temporary
migration—users who migrated to new platforms but might return to Twitter
later on.

Table 1: Statistics on user migration from Twitter to other platforms. Bluesky
and Threads operate on a single server or a cluster of servers, given their
early stage of deployment.

Destination Platform | # Migrant | # Server (Domain)
---|---|---
Bluesky | 1,062 | 1 (bsky.social)
Threads | 679 | 1 (threads.net)
Mastodon | 14,268 | 18,605 (mastodon.social, etc.)

##  4 Data Collection

From July 1 to August 27, 2023, we identified a total of 16,279 migrants.
After removing 270 migrants with deleted or suspended accounts, we were left
with 16,009 migrants with unique handles. We further verified that none of
these users had accounts on the destination platform before establishing their
Twitter accounts.

###  4.1 Collecting Migrants from Twitter to Destination Platforms.

To map users to their alternate social media accounts, we employed a platform-
specific approach: (1) For Bluesky, by targeting keywords “bsky.social” and
“bsky.app”, we extracted relevant Bluesky handles from Twitter profiles; (2)
For Threads, we used “threads.net” as our primary keyword filter, from which
we derived associated Threads handles; and (3) For Mastodon, we began by
gathering a complete list of 18,605 Mastodon server domains via the API from
instances.social. By using these domains as keywords, we identified Twitter
profiles linked to Mastodon handles.

Noticing that Twitter users often include other account handles in their
profiles, we examined their display names to pinpoint handles from different
platforms. This approach avoids confusion, as handles mentioned in tweets may
refer to other users [24, 10]. Table 1 displays the count of detected migrants
for each platform. The fewest migrations were noted from Twitter to Threads,
likely the result of Twitter’s recent action of hiding tweets containing URLs
that link to
Threads222https://www.washingtonpost.com/technology/2023/08/15/twitter-x-
links-delayed/.

###  4.2 Collecting Non-migrants from Twitter.

We utilized Semrush333https://www.semrush.com/, a tool designed for network
traffic and competitor analysis to estimate non-migrants. The results are
shown in Figure 3, which indicates users active across Twitter, along with
Bluesky, Threads, and Mastodon. The maximum contribution from the targeted
platforms to Twitter’s total traffic is 2.48%, when there are no overlaps
among them. Based on this, we randomly sampled 20,000 unique active users who
tweeted at least once on Twitter between July and August 2023 to minimize the
inclusion of those migrant users to Bluesky, Threads, and Mastodon.

Figure 3: Network traffic analysis for July-August 2023 between Twitter and
the targeted domain. Overlaps show users accessing both domains from the same
IP address.

###  4.3 Collecting Profiles and Posts of Migrants from Multiple Platforms.

We gathered profiles of detected migrants from both Twitter and the respective
destination platforms and compiled posts made within our study’s timeframe.
For Bluesky, we amassed 98,352 posts from Twitter and 285,174 posts from
Bluesky. Threads migrants contributed 67,740 posts on Twitter and 9,955 posts
on Threads. As for Mastodon, we recorded 190,328 posts and collected 229,083
posts from Mastodon. All data we collect is encrypted at the field level in
our database to ensure anonymity.

Table 2: Ranking of migrant groups and non-migrants across five user metrics.
The inequality symbol denotes a significant disparity, while the equality
symbol indicates no significant disparity as assessed by ANOVA test at
$p<0.05$.

User Metric | Statistical Ranking
---|---
followers_count | Threads $>$ Bluesky $>$ (Mastodon $=$ Non-migrant)
friends_count | Threads $>$ Bluesky $>$ Mastodon $>$ Non-migrant
listed_count | (Bluesky $=$ Threads) $>$ Non-migrants $>$ Mastodon
favorites_count | Mastodon $>$ (Non-migrant $=$ Threads) $>$ Bluesky
statuses_count | Mastodon $>$ (Bluesky $=$ Threads) $>$ Non-migrant

We used the platform’s APIs. Twitter’s official API provides comprehensive
access to tweets, user profiles, tweets, retweets, and various metadata
elements, ensuring a detailed view of user activities. Bluesky, aiming to
develop a decentralized standard for social media, also offers its official
API444https://atproto.com/guides/overview/ based on the AT protocol, which was
instrumental in accessing public posts and profile details. Mastodon, being an
open-source and federated platform, offers its official
API555https://docs.joinmastodon.org/api/ based on ActivityPub protocol. Since
Threads does not provide an official API, we manually collected the text
contents of public user profiles and posts through the platform’s web
interface666https://www.threads.net/ (released August 24, 2023).

##  5 Distinguishing between Migrant Groups and Non-migrants on Twitter (RQ1)

For this question, we analyzed a range of user characteristics, from basic
metrics such as the number of followers to intricate measures of user
influence. We then compared migrant groups and non-migrants on Twitter.

###  5.1 Comparing Profile Metrics.

Twitter offers metrics for user
profile777https://developer.twitter.com/en/docs/twitter-api/data-
dictionary/object-model/user. We investigated five of these, namely
followers_count, friends_count, listed_count, favorites_count, and
statuses_count. We examined the variations in these metrics among the migrant
groups (Bluesky, Threads, and Mastodon) in comparison to non-migrants on
Twitter with a multiple comparisons ANOVA test and Tukey’s HSD post-hoc test.
Table 2 shows the rankings across migrant groups and non-migrants based on the
targeted platform. Migrant groups of Threads and Bluesky consistently
demonstrate stronger network engagement compared to other groups. Their
notably higher values in both followers_count and friends_count underscore a
wider and more interactive network presence.

Figure 4: Box plots show influence scores for migrants (Bluesky, Threads,
Mastodon) and non-migrants (Twitter) with interquartile ranges. Red dots
indicate group means.

###  5.2 Comparing Influence Metrics.

Building on prior research that assessed user influence on Twitter [1, 4], we
utilized both a user-level score, represented as $S_{u}$, and a score for
user’s posts, denoted by $S_{\mathcal{P}_{u}}$. Based on this, we calculate
the influence score as follows:

(5.1) $\displaystyle S_{u}=\frac{u_{\\#followers}+u_{\\#lists}}{2},$
$\displaystyle
S_{\mathcal{P}_{u}}=\frac{1}{|\mathcal{P}_{u}|}\sum_{p\in\mathcal{P}_{u},}\frac{p_{\\#retweets}+p_{\\#favorites}}{2},$
$\displaystyle IS_{u}=w_{profile}\times S_{u}+w_{posts}\times
S_{\mathcal{P}_{u}}$

where $IS_{u}$ denotes the influence score for user $u$. The weights are set
as $w_{profile}=0.5$ and $w_{posts}=0.5$ to ensure a balanced combination.

Figure 4 depicts the distribution of influence scores between migrants and
non-migrants. The median and mean scores for migrant groups (Bluesky, Threads,
and Mastodon) were greater than those of non-migrants on Twitter, suggesting
that highly engaged Twitter users might consider migration. Furthermore,
Bluesky migrants displayed higher median and mean scores compared to other
migrant groups, suggesting that users with high influence scores may prefer to
explore Bluesky than the other platforms.

Summary (RQ1) Migrant groups’ varied characteristics show each platform
attracted its distinct audience. Though migrants had a stronger Twitter
presence than non-migrants, they also explored new platforms.

Figure 5: Active user trends comparing Twitter with (1) Bluesky, (2) Threads,
and (3) Mastodon. The blue line signifies Twitter-only users, the red line for
other platform-only, and the green line for those using both. The red dashed
line marks Threads’ launch date. $y$-axis indicates the portion of active
users relative to the total number of migrants on each platform.

##  6 Understanding Relationships between Twitter and Alternative Platforms
(RQ2)

We conducted an analysis comparing individuals active on Twitter to those on
alternative platforms. Our goal is to discern the dynamics and relationships
between Twitter and its competitors as they vie for users’ attention in the
competitive landscape of social media.

###  6.1 Comparing Active Users between Twitter and Alternatives.

To understand how competition evolved over time between Twitter and the three
other platforms, we counted the number of active users based on the following
definition:

#### Active User

For a platform $p$, let a user be $u\in U_{p}$. Given a time interval
$\delta=t^{\prime}-t$ where $t^{\prime}>t$, the user $u$ is active on platform
$p$ at time $t^{\prime}$ if the user engaged in posting or resharing since
time $t$.

Figure 5 depicts the active users between Twitter and alternative platforms
among the studied migrants. Initially, migrants from Twitter to Bluesky
favored exclusive Bluesky usage, and this trend held strong until July 18,
2023, with a marked decrease afterward. Conversely, the population of users
either staying dedicated to Twitter or leveraging both platforms saw a
consistent increase. This suggests that relying solely on Bluesky did not
fully cater to users’ needs.

Second, from the launch of Threads on July 5, 2023, until July 13, 2023, there
is a consistent rise in the number of active users either adopting Threads
exclusively or using it alongside Twitter. After just a week, the number of
active users on Threads began to decrease, illustrating the “shiny object
effect”, where individuals are drawn to the allure of the latest novelty,
experiencing a brief surge of joy from its acquisition, only to soon shift
their attention elsewhere [18].

Last, the active users between Twitter and Mastodon do not show any dramatic
changes for either platform. This stasis may be because users already
experienced mass migration from Twitter to Mastodon, especially after Elon
Musk’s takeover of Twitter on October 27, 2022 [10]. The limited user overlap
indicates that Mastodon operates independently of Twitter, and migrants to
Mastodon typically divide into groups focused either on Twitter or Mastodon.

###  6.2 Evaluating the Association between Twitter and Alternatives.

To understand the associations between Twitter and other platforms through the
number of active migrants, we utilized Yule’s Q, a statistical measure for
assessing the association between two or more binary or nominal variables
[22]. We used this measure to analyze the presence or absence of users on
Twitter compared to its competing platforms. Yule’s Q offers valuable insights
into whether Twitter usage reflects or influences behavior on the other
platforms. On a scale ranging from -1 to 1, values close to 1 indicate a
complementary relationship and values nearing -1 suggest a substitute
relationship.

To define Yule’s Q in terms of a specific time period, we segmented the
cumulative count of active users within interval $\delta$ starting from date
$t$. We gauged active users on platforms $A$ and $B$ based on the subsequent
metrics: $U_{A,t,\delta}$ is the number of users who only used Platform $A$,
not appearing on Platform $B$. Conversely, $U_{B,t,\delta}$ is the number of
users using only Platform $B$, absent on Platform $A$. Meanwhile,
$U_{AB,t,\delta}$ is the number of users using both platforms and $U_{\neg
A\neg B,t,\delta}$ is the number of users not using both platforms.

(6.2) $Q_{t,\delta}=\frac{{(U_{AB,t,\delta}\times U_{\neg A\neg
B,t,\delta})-(U_{A,t,\delta}\times U_{B,t,\delta})}}{{(U_{AB,t,\delta}\times
P_{\neg A\neg B,t,\delta})+(U_{A,t,\delta}\times U_{B,t,\delta})}}$

Figure 6: Yule’s Q trend between Twitter and (1) Bluesky, (2) Threads, and (3)
Mastodon with three different intervals. Blue represents daily trends
($\delta=\text{1 day}$), orange for weekly trends ($\delta=\text{1 week}$),
and green for monthly trends ($\delta=\text{4 weeks}$).

Figure 6 depicts the evolution of Yule’s Q over daily, weekly, and monthly
intervals. The Yule’s Q for Twitter and Bluesky consistently rises across
intervals, transitioning from approximately 0.1 to around 0.3, highlighting
Bluesky’s complementary relationship with Twitter and its benefit from this
association. Twitter and Threads display fluctuating Yule’s Q values at both
daily and weekly intervals. However, the monthly trend reveals a noticeable
drop from approximately 0.3 to 0.2, suggesting a shift in user preference back
towards Twitter. The relationship between Twitter and Mastodon remains steady,
centering around Yule’s Q value of 0.3 across all intervals, suggesting a
complementary role and a stable migration pattern for Mastodon users.

Summary (RQ2) Migrants explored alternative platforms, but many could not show
long-term success, leading migrants to return to Twitter. Yet, Bluesky
migrants perceive Twitter as a primary complement, leading to distinct
activity levels compared to Threads and Mastodon.

##  7 Did Migrants Really Leave Twitter? (RQ3)

While frequent use of a platform does not necessarily signify user
satisfaction, as many users continue to use the platform due to a lack of
alternatives, we investigated the link between platform usage and migrants’
loyalty.

###  7.1 Brand Loyalty of Users Towards Platforms.

Considering this uncertainty, we assessed the brand loyalty of users towards
each platform, through textual analysis of their posts. Since there are no
stance detection algorithms or datasets for assessing the brand loyalty of
users, we employed ChatGPT (GPT-4) to categorize stances as loyal, neutral, or
disloyal, given GPT-4’s proven proficiency in stance detection [25].

We used the advanced features of GPT-4 to evaluate and predict the brand
loyalty of migrants towards each platform through our customized prompt for
target-based stance detection, detailed in the Appendix. We first extracted
posts that mentioned specific platforms and grouped them by users. Evaluating
our method, two coders classified the stances of 400 random users, achieving a
significant Cohen’s Kappa of 76.27% and an F1 score of 79.42% in our stance
detection task.

Figure 7: The brand loyalty among migrants on various platforms, determined by
stance from their aggregated posts.

Figure 7 presents the distribution of brand loyalty among users across various
platforms. Mastodon leads with 37% loyalty among its migrants, surpassing
figures from Twitter (11%), Bluesky (13%), and Threads (5%). Notably, Twitter
has the highest level of expressed disloyalty (52%) among migrants. However,
the majority of migrants on Bluesky, Threads, and Mastodon remain neutral, in
contrast to a wider spectrum of stances on Twitter. This suggests that users
are currently uncertain about their opinions on these newer platforms.

###  7.2 Rhetoric in Loyal and Disloyal Migrants.

Figure 8: Word clouds of migrants’ hashtags based on two stances towards
Twitter: Loyal (Blue) and Disloyal (Red).

Figure 8 depicts the distribution of hashtags among different platform migrant
groups. Unsurprisingly, a universal trend is evident across all disloyal
migrants: hashtags such as #RIPTwitter and #TwitterIsDead dominate the
conversation. Loyal Bluesky migrants showcase their group affinity with
#LibraryTwitter and #FilmTwitter on loyal and disloyal migrants, respectively.
Loyal Threads migrants, in contrast, emphasize their artistic and sports-
related affinities through hashtags such as #ArtistsOnTwitter and
#MetsTwitter, and also comment on Twitter’s new brand name and its logo with
#TwitterX and #TwitterLogo. Loyal Mastodon migrants showcase a broader
academic spectrum among loyal migrants compared to Bluesky and Threads.
However, their disloyal counterparts predominantly focus on migration-specific
hashtags including #TwitterMigration and #Fediverse, and IT-related hashtags
such as #Opensource and #ActivityPub.

###  7.3 State Dependencies for Disloyal Migrants.

In economics, state dependence reflects the propensity of a consumer to remain
consistent with a prior choice [5]. We begin by defining the total number of
activities on platform $A$ as follows:

(7.3) $T^{\prime}_{A,t}=T_{A,t}+\lambda$

where $T_{A,t}$ is the cumulative count of a user’s activities on platform $A$
at date $t$. These activities encompass both postings and resharing behaviors
(e.g., tweet and retweet). We introduce a smoothing factor, denoted by
$\lambda=1$, to ensure $T^{\prime}_{A,t}$ is not considered as zero.

Subsequently, we calculate the prior, likelihood, and marginal values for
state dependency as outlined below:

(7.4)
$P(A_{t})=\frac{T^{\prime}_{A,t}}{T^{\prime}_{A,t-1}+T^{\prime}_{B,t-1}}$

(7.5)
$P(D|A_{t})=\frac{T^{\prime}_{A,t-1}}{T^{\prime}_{A,t}+T^{\prime}_{B,t}}$

(7.6) $\displaystyle P(D)=P(D\mid A_{t})\times P(A_{t-1})$
$\displaystyle\hskip 14.22636pt+P(D\mid B_{t})\times P(B_{t-1})$

Finally, we employ the Bayesian approach to determine the state dependency for
platform $A$ at time $t$ by updating the posterior in the following manner:

(7.7) $P(A_{t}\mid D)=\frac{P(D\mid A_{t})\times P(A_{t-1})}{P(D)}$

Figure 9: State dependencies of users disloyal towards Twitter. We compared
Twitter and its counterparts: (1) Bluesky, (2) Threads, (3) Mastodon. The blue
line represents the average state dependency of individuals preferring Twitter
over its counterpart, while the orange line represents the opposite. The red
dashed line marks when Twitter rebranded to “$\mathbb{X}$”.

Figure 9 depicts state dependencies of disloyal migrants over time,
highlighting different trends among platforms. We observed that there is a
convergence for Twitter and Bluesky, a divergence for Twitter and Threads, and
a parallelism between Twitter and Mastodon. These patterns for Bluesky and
Threads were intensified after July 22, 2023, coinciding with Elon Musk’s
announcement of Twitter’s rebranding to “$\mathbb{X}$”. These differences
highlight the platform’s impact on the migrants’ activities, although we
focused on migrants expressing a similar stance of disloyalty to Twitter.

Examining platform-specific dynamics, Bluesky witnessed two notable
convergences in state dependency on July 22 (0.5) and August 24 (0.5), which
suggests identical state dependencies between Twitter and Bluesky. Following
the rebranding to “$\mathbb{X}$”, Twitter experienced a temporary decline in
state dependency, but Bluesky migrants gradually reverted to Twitter. This
shift is indicated by fluctuations in state dependency from July 1 (0.62) to a
brief dip on July 8 (0.5), followed by a resurgence peaking on July 24 (0.58).
Conversely, migrants to Mastodon maintained a consistently lower dependency on
Twitter, hinting at reduced sensitivity to external events related to
Twitter’s changes.

Summary (RQ3) Migrants displayed a broader spectrum of brand loyalty towards
Twitter than other platforms, with many showing wavering commitment.
Nevertheless, their activities on Twitter consistently overshadowed their
activity on platforms like Bluesky and Threads.

##  8 Limitations

First, our dataset is composed of migrants who voluntarily disclosed their
identities on other platforms, suggesting a possible inclination towards more
open communication and active engagement with peers. This potential selection
bias could represent migrants with a more heightened online presence. Second,
we centered on migration patterns from Twitter to other platforms, without
considering migration between alternative platforms. This specific direction
was chosen due to technical constraints, including the limited search features
of Bluesky’s API’s and Threads’s lack of a publicly accessible API, which
hindered our ability to track migrations from Bluesky or Threads to other
platforms. Last, we examined the first eight weeks after Threads’ launch,
which experienced a significant user
influx888https://www.reuters.com/technology/metas-twitter-rival-threads-
hits-100-mln-users-record-five-days-2023-07-10/. This period might not capture
earlier shifts from Twitter to Mastodon [10]. Long-term analysis of Twitter
data from these times was constrained by API
pricing999https://developer.twitter.com/en/docs/twitter-api/getting-
started/about-twitter-api, imposing substantial fees for retrieving users’
tweets and retweets.

##  9 Conclusion & Future Work

Our analysis shows that Bluesky cleverly capitalized on the conflicts between
Twitter and two of its competitors, such as Threads and Mastodon. With a lot
of overlap and association in usage with Twitter’s user base, Bluesky secured
its spot in the competitive landscape. New platforms, such as Threads,
initially benefit from the “shiny object effect,” attracting users with their
novelty. However, retaining these early enthusiasts proves challenging,
especially when many still remain active on Twitter. While some initial
migration barriers might be short-lived, the enduring pull of established
platforms like Twitter is evident. Even if users voice intentions to switch,
deep-seated inertia often keeps them anchored, either out of habit or due to
perceived shortcomings in newer platforms.

In future work, we will explore attitudes towards Twitter and its proprietor.
While a portion of its user base longs for the older version of Twitter,
different segments of the user base already show highly varied levels of
dissatisfaction with Twitter’s owner. We will also probe the structural
determinants of brand loyalty on social platforms. Factors such as user
interface design, social media fatigue, and distinct social interactions
unique to each platform can greatly sway user choices. To validate these
findings, we will conduct online surveys using opt-in panels. Finally, we will
delve deeper into the facets of brand loyalty, examining satisfaction,
emotional connections, and perceived platform value, to understand the forces
that keep users loyal or drive them away.

##  10 Data Collection Policy

We collected data from the designated social media platforms using their
public interfaces. We are aware of the forthcoming alteration to Twitter’s
terms of service101010https://twitter.com/en/tos, effective September 29,
2023. In line with this, our data collection strictly employed Twitter’s
official API, adhering to their guideline of using the currently published
interfaces by Twitter. Furthermore, we manually sourced text data from Threads
due to the absence of its public API. We ensured user privacy by anonymizing
personal data during our analysis. Upon acceptance of our article, we will
share user IDs and codes for mapping migrants, but will not share other data
without the platform’s consent.

##  11 Acknowledgments

This work received support from the Office of Naval Research, under Award No.
N00014-21-1-4002. Opinions, interpretations, conclusions, and recommendations
within this article are solely those of the authors.

## References

  * [1] I. Anger and C. Kittl, Measuring influence on twitter, in Knowledge Management and Knowledge Technologies, 2011.
  * [2] B. Auxier and M. Anderson, Social media use in 2021, Pew Research Center, (2021).
  * [3] J. J. Azose and A. E. Raftery, Estimation of emigration, return migration, and transit migration between all pairs of countries, PNAS, (2019).
  * [4] M. Cha, H. Haddadi, F. Benevenuto, and K. Gummadi, Measuring user influence in twitter: The million follower fallacy, in ICWSM, AAAI Press, 2010\.
  * [5] J.-P. Dubé, G. J. Hitsch, and P. E. Rossi, State dependence and alternative explanations for consumer inertia, The RAND Journal of Economics, (2010).
  * [6] C. Fiesler and B. Dym, Moving across lands: Online platform migration in fandom communities, HCI, (2020).
  * [7] M. Givon, Variety seeking through brand switching, Marketing Science, (1984).
  * [8] A. C. Hou, C.-C. Chern, H.-G. Chen, and Y.-C. Chen, ‘migrating to a new virtual world’: Exploring mmorpg switching through human migration theory, Computers in Human Behavior, (2011).
  * [9] A. C. Hou and W.-L. Shiau, Understanding facebook to instagram migration: a push-pull migration model perspective, Information Technology & People, (2020).
  * [10] U. Jeong, P. Sheth, A. Tahir, F. Alatawi, H. R. Bernard, and H. Liu, Exploring platform migration patterns between twitter and mastodon: A user behavior study, arXiv preprint arXiv:2305.09196, (2023).
  * [11] K. L. Keller, Conceptualizing, measuring, and managing customer-based brand equity, Journal of marketing, (1993).
  * [12] S. Kumar, R. Zafarani, and H. Liu, Understanding user migration patterns in social media, in AAAI, AAAI Press, 2011.
  * [13] L. La Cava, L. M. Aiello, and A. Tagarelli, Get out of the nest! drivers of social influence in the# twittermigration to mastodon, arXiv preprint arXiv:2305.19056, (2023).
  * [14] E. S. Lee, A theory of migration, Demography, (1966).
  * [15] P. Levitt and B. N. Jaworsky, Transnational migration studies: Past developments and future trends, Annual Review of Sociology, (2007).
  * [16] J. N. Matias, Going dark: Social factors in collective action against platform operators in the reddit blackout, in Human Factors in Computing Systems, 2016.
  * [17] C. Monti, M. Cinelli, C. Valensise, W. Quattrociocchi, and M. Starnini, Online conspiracy communities are more resilient to deplatforming, arXiv preprint arXiv:2303.12115, (2023).
  * [18] J. Roberts, Shiny objects: why we spend money we don’t have in search of happiness we can’t buy author: James a, HarperOne, (2011).
  * [19] R. Rogers, Deplatforming: Following extreme internet celebrities to telegram and alternative social media, European Journal of Communication, (2020).
  * [20] M. Torkjazi, R. Rejaie, and W. Willinger, Hot today, gone tomorrow: on the migration of myspace users, in ACM workshop, 2009.
  * [21] M. V. Valero, Thousands of scientists are cutting back on twitter, seeding angst and uncertainty, Nature, (2023).
  * [22] G. U. Yule, Vii. on the association of attributes in statistics: with illustrations from the material of the childhood society, Philosophical Transactions of the Royal Society of London. Series A, Containing Papers of a Mathematical or Physical Character, (1900).
  * [23] C. Zengyan, Y. Yinping, and J. Lim, Cyber migration: An empirical investigation on factors that affect users’ switch intentions in social networking sites, in System Sciences, IEEE, 2009.
  * [24] H. B. Zia, J. He, A. Raman, I. Castro, N. Sastry, and G. Tyson, Flocking to mastodon: Tracking the great twitter migration, arXiv preprint arXiv:2302.14294, (2023).
  * [25] C. Ziems, W. Held, O. Shaikh, J. Chen, Z. Zhang, and D. Yang, Can large language models transform computational social science?, arXiv preprint arXiv:2305.03514, (2023).

Appendix

Utilizing OpenAI API’s function calling feature, we designed a prompt for a
structured output in a few-shot setting, providing loyal and disloyal
examples. This incorporated information about Twitter’s rebranding to
“$\mathbb{X}$”,and the launch of Meta’s new social media named Threads. The
prompt is shown below:

Title: Stance Detection Prompt for GPT-4 Objective:
Determine the stance of a given text towards a specified target platform.
Instructions:
For the provided text and target(s), classify the stance as one of the
following: Loyal, Disloyal, or Neutral Keynotes:
\- There are four platforms that can be targeted for the stance: Twitter,
Bluesky, Threads, and Mastodon. \- Twitter is now called “$\mathbb{X}$” and is
owned by Elon Musk. \- “Threads” is a new social media platform under the Meta
umbrella, founded by Mark Zuckerberg. \- Always provide a stance for each
specified target. \- Provide the response in JSON format. Example:
Input: “Twitter is dead. I love Bluesky” Output: {Twitter: Disloyal, Bluesky:
Loyal}


# Group Testing under Superspreading Dynamics

Stratis Tsirtsis  Abir De  IIT Bombay
<EMAIL_ADDRESS>Lars Lorch  Manuel Gomez Rodriguez

###### Abstract

Testing is recommended for all close contacts of confirmed COVID-19 patients.
However, existing group testing methods are oblivious to the circumstances of
contagion provided by contact tracing. Here, we build upon a well-known semi-
adaptive pool testing method, Dorfman’s method with imperfect tests, and
derive a simple group testing method based on dynamic programming that is
specifically designed to use the information provided by contact tracing.
Experiments using a variety of reproduction numbers and dispersion levels,
including those estimated in the context of the COVID-19 pandemic, show that
the pools found using our method result in a significantly lower number of
tests than those found using standard Dorfman’s method, especially when the
number of contacts of an infected individual is small. Moreover, our results
show that our method can be more beneficial when the secondary infections are
highly overdispersed.

## Introduction

As countries around the world learn to live with COVID-19, the use of testing,
contact tracing and isolation (TTI) has been proven to be as important as
social distancing for containing the spread of the disease [1]. However, as
the infection levels grow, TTI reaches a tipping point and its effectiveness
quickly degrades as the health authorities lack resources to trace and test
all contacts of diagnosed individuals [2]. In this context, there has been a
flurry of interest on the use of group testing—testing groups of samples
simultaneously—to scale up testing under limited resources.

The literature on group testing methods has a rich history, starting with the
seminal work by Dorfman [3, 4, 5]. However, existing methods [6, 7], including
those developed and used in the context of the COVID-19 pandemic [8, 9, 10,
11, 12, 13, 14, 15, 16], are oblivious to the circumstances of contagion
provided by contact tracing and assume statistical independence of the samples
to be tested. This assumption can be seemingly justified by classical
epidemiological models where the number of infections caused by a single
individual follows a Poisson distribution. However, in COVID-19, there is
growing evidence suggesting that the number of secondary infections caused by
a single individual is _overdispersed_ —most individuals do not infect anyone
but a few _superspreaders_ infect many in infection hotspots [17, 18, 19, 20,
21, 22, 23]. Overdispersion has been also observed in MERS and SARS [24, 25,
26]. In this work, our goal is to develop group testing methods that are
specifically designed to use the information provided by contact tracing and
are effective in the presence of overdispersion.

More specifically, we build upon a well-known semi-adaptive pool testing
method, Dorfman’s method with imperfect tests [27, 5]. In Dorfman’s method,
samples from multiple individuals are first pooled together and evaluated
using a single test. If a pooled sample is negative, all individuals in the
pooled sample are deemed negative. If the pooled sample is positive, each
individual sample from the pool is then tested independently. However, rather
than modeling the probability that each individual sample is positive using an
independent Bernoulli distribution as in Dorfman’s method, we assume that: (i)
the samples to be tested are all the contacts of a diagnosed individual during
their infectious period, who are identified using contact tracing, and (ii)
the number of true positive samples, _i.e._ , secondary infections by the
diagnosed individual, follows an overdispersed negative binomial distribution
[22, 23]. Given any arbitrary set of pools, we then compute the average number
of tests and the expected number of false negatives and false positives under
our model. Finally, we introduce a dynamic programming algorithm to
efficiently find the set of pools that optimally trade off the average number
of tests, false negatives and false positives in polynomial time. Experiments
using a variety of reproduction numbers and dispersion levels in secondary
infections, including those observed for COVID-19, show that the pools found
using our method result in a significantly lower average number of tests than
those found using standard Dorfman’s method, especially when the number of
contacts of an infected individual is small. Moreover, our results show that
our method can be particularly beneficial when the number of secondary
infections caused by an infectious individual is highly overdispersed.

## Methods

### Modeling overdispersion of infected contacts

Previous work have mostly built on the assumption that the number of
infections $X$ caused by a single individual follows a Poisson distribution
with mean $r$, so $X\sim\text{Pois}(r)$, where $r$ is often called the
effective reproduction number. However, having equal mean and variance, the
Poisson is unable to capture settings where the number of cases to be tested
for exhibits higher variance. Following recent work in the context of COVID-19
[19, 22], we instead model $X$ using a generalized negative binomial
distribution. For a (standard) negative binomial distribution,
$X\sim\text{NBin}(k,p)$ can be interpreted as the number of successes before
the $k$-th failure in a sequence of Bernoulli trials with success probability
$p$. For a generalized negative binomial distribution, $k>0$ can take real
values and the probability mass function is given by

$\displaystyle P(X=n)$
$\displaystyle=\frac{\Gamma(n+k)}{\Gamma(k)n!}p^{n}(1-p)^{k},$

where $k$ is called the dispersion parameter and parameterizes higher variance
of the distribution for small $k$. Since $\mathbb{E}[X]=kp/(1-p)$, we assume
in this work that the number of secondary infections $X$ is distributed as
$X\sim\text{NBin}\left(k,p\right)$ with $p=r/(k+r)$, hence parameterizing $X$
via its mean $\mathbb{E}[X]=r$ and dispersion parameter $k$. Under this
parameterization, $\text{Var}[X]=r(1+r/k)$, which is greater than the variance
of the Poisson $r$ for $k<\infty$. For $k\rightarrow\infty$, the sequence of
random variables $X_{k}\sim\text{NBin}(k,r/(k+r))$ converges in distribution
to $X\sim\text{Pois}(r)$, making the negative binomial a suitable
generalization of the Poisson for modeling secondary infections.

Assuming we test all contacts of a diagnosed individual during their
infectious period, we have prior information about the maximum number of
possible infections $N$ in practice. In this setting, we will write

$\displaystyle q_{r,k,N}(n):=P(X=n\,|\,X\leq N)\quad\text{when}\quad
X\sim\text{NBin}\left(k,r/(k+r)\right).$ (1)

Here, note that $P(X=n\,|\,X\leq N)=P(X=n)/P(X\leq N)$ if $n\leq N$ and 0
otherwise.

### Pooling contacts of a positively diagnosed individual

In this context, our goal is to identify infected individuals among all
contacts $\mathcal{N}$ of a positively diagnosed individual via testing, where
$|\mathcal{N}|=N$. For events concerning each individual $j\in\mathcal{N}$, we
define the following indicator random variable:

$\displaystyle I_{j}$ $\displaystyle={\mathbbm{1}[\text{individual $j$ is
infected}]}$

In addition, for each pool of individuals ${\mathcal{S}}\subseteq\mathcal{N}$,
we define the number of infected in ${\mathcal{S}}$ as
$I({\mathcal{S}}):=\sum_{j\in{\mathcal{S}}}I_{j}$. Following our assumption on
the distribution of the number of secondary infections, we define

$\displaystyle P(I(\mathcal{N})=n)=q_{r,k,N}(n)$

Let $T({\mathcal{S}})={\mathbbm{1}[\text{test of pool ${\mathcal{S}}$ is
positive}]}$. To account for the sensitivity $s_{e}$ (_i.e._ , true positive
probability) and specificity $s_{p}$ (_i.e._ , true negative probability) of
tests, we parameterize the conditional probabilities as

$\displaystyle P(T({\mathcal{S}})=1\,|\,I({\mathcal{S}})>0)$
$\displaystyle=s_{e}$ $\displaystyle
P(T({\mathcal{S}})=0\,|\,I({\mathcal{S}})=0)$ $\displaystyle=s_{p}$

In the above, following the literature on the group testing [5], we assume
that the sensitivity of pool tests is independent of the exact number of
infected individuals in the pool. Moreover, while dilution has been shown to
often be negligible [28], the effect can easily be addressed by making the
conditional $T({\mathcal{S}})\,|\,I({\mathcal{S}})$, dependent on the
corresponding pool size $|{\mathcal{S}}|$.

### Dorfman testing under overdispersion of infected contacts

Dorfman testing proceeds by pooling individuals into non-overlapping
partitions of $\mathcal{N}$ and first testing the combined samples of each
pool using a single test. Every member of a pool is marked as negative if
their combined sample is negative. If a combined sample of a pool is positive,
each individual of the pool is subsequently tested individually to determine
who exactly is marked positive in the pool.

Let $D^{{\mathcal{S}}}_{j}$ denote the indicator random variable for the event
that individual $j$ is marked as infected in pool
${\mathcal{S}}\subseteq\mathcal{N}:|{\mathcal{S}}|>1$ after Dorfman testing.
Then, $D^{{\mathcal{S}}}_{j}$ can be expressed as

$\displaystyle D^{{\mathcal{S}}}_{j}$
$\displaystyle={\mathbbm{1}[T({\mathcal{S}})=1\cap T(\\{j\\})=1]},$

_i.e._ , taking value 1 if and only if the combined sample of pool
${\mathcal{S}}$ is first tested positive _and_ the sample of individual $j$ is
tested positive in the second step. In the simple case of $|{\mathcal{S}}|=1$,
we have $D^{{\mathcal{S}}}_{j}=T(\\{j\\})$.

#### Expected number of tests

Let $K({\mathcal{S}})$ be the number of tests performed when testing pool
${\mathcal{S}}$ as described above. Then, the expected number of tests
$\mathbb{E}[K({\mathcal{S}})]$ due to a pool ${\mathcal{S}}$ is:

$\displaystyle\mathbb{E}[K({\mathcal{S}})]$
$\displaystyle=\begin{cases}1+f({\mathcal{S}})&|{\mathcal{S}}|>1\\\
1&|{\mathcal{S}}|=1\end{cases}$

where $f({\mathcal{S}})$ is given by

$\displaystyle f({\mathcal{S}})$
$\displaystyle=|S|\Big{[}1-P\big{(}T({\mathcal{S}})=0\big{)}\Big{]}$
$\displaystyle=|S|\Bigg{[}1-\sum_{s=0}^{|{\mathcal{S}}|}P\big{(}T({\mathcal{S}})=0\,|\,I({\mathcal{S}})=s\big{)}P\big{(}I({\mathcal{S}})=s\big{)}\Bigg{]}$
$\displaystyle=|S|\Bigg{[}1-\sum_{s=1}^{|{\mathcal{S}}|}P\big{(}T({\mathcal{S}})=0\,|\,I({\mathcal{S}})=s\big{)}\sum_{n=s}^{N}P\big{(}I({\mathcal{S}})=s\,|\,I(\mathcal{N})=n\big{)}P\big{(}I(\mathcal{N})=n\big{)}$
$\displaystyle\quad\quad\quad-P\big{(}T({\mathcal{S}})=0\,|\,I({\mathcal{S}})=0\big{)}\sum_{n=0}^{N}P\big{(}I({\mathcal{S}})=0\,|\,I(\mathcal{N})=n\big{)}P\big{(}I(\mathcal{N})=n\big{)}\Bigg{]}$
$\displaystyle=|S|\Bigg{[}1-\sum_{s=1}^{|{\mathcal{S}}|}(1-s_{e})\sum_{n=s}^{N}\frac{\binom{n}{s}\binom{N-n}{|{\mathcal{S}}|-s}}{\binom{N}{|{\mathcal{S}}|}}q_{r,k,N}(n)-s_{p}\sum_{n=0}^{N}\frac{\binom{N-n}{|{\mathcal{S}}|}}{\binom{N}{|{\mathcal{S}}|}}q_{r,k,N}(n)\Bigg{]}$

where the last step follows from the fact that
$I({\mathcal{S}})\,|\,I(\mathcal{N})=n\sim\text{HGeom}(N,n,|{\mathcal{S}}|)$,
our assumption about $\mathbb{P}(I(\mathcal{N})=n)$ and our assumptions about
$T({\mathcal{S}})$.

#### Expected number of false negatives

To compute the number of false negatives, we distinguish between two cases. If
$|{\mathcal{S}}|=1$, _i.e._ , the pool consists of only one person, there is
no distinction between a group test and an individual test. Therefore, a false
negative can occur only if the person is infected and the test turns out
negative. Thus,

$\mathbb{E}[FN({\mathcal{S}})]=(1-s_{e})P(I({\mathcal{S}})=1)=(1-s_{e})\sum_{n=1}^{N}\frac{n}{N}q_{r,k,N}(n)$

If $|{\mathcal{S}}|>1$, a pooled test is performed and, if it turns out
positive, individual tests are performed afterwards. The expected number of
false negatives in this case is

$\mathbb{E}[FN({\mathcal{S}})]=\sum_{s=1}^{|{\mathcal{S}}|}s\,P(T({\mathcal{S}})=0\,|\,I({\mathcal{S}})=s)P(I({\mathcal{S}})=s)+\sum_{s=1}^{|{\mathcal{S}}|}P(T({\mathcal{S}})=1\,|\,I({\mathcal{S}})=s)P(I({\mathcal{S}})=s)\,s\,(1-s_{e})$

where the first term corresponds to the case where the group test outcome is
falsely negative and the second term corresponds to the case where the group
test outcome is truly positive and the individual tests are falsely negative.
Using our assumptions about the individual probabilities, we can rewrite the
above expression as

$\displaystyle\mathbb{E}[FN({\mathcal{S}})]=\sum_{s=1}^{|{\mathcal{S}}|}s(1-s_{e})P(I({\mathcal{S}})=s)+\sum_{s=1}^{|{\mathcal{S}}|}s(1-s_{e})s_{e}P(I({\mathcal{S}})=s)=\sum_{s=1}^{|{\mathcal{S}}|}s(1-s_{e}^{2})\left[\sum_{n=s}^{N}\frac{\binom{n}{s}\binom{N-n}{|{\mathcal{S}}|-s}}{\binom{N}{|{\mathcal{S}}|}}q_{r,k,N}(n)\right]$

#### Expected number of false positives

We likewise distinguish between the two cases for computing the number of
false positives. Again, if $|{\mathcal{S}}|=1$, there is no distinction
between a group test and an individual test. Therefore, a false positive can
occur only if the person is not infected and the test turns out positive.
Thus,

$\mathbb{E}[FP({\mathcal{S}})]=(1-s_{p})P(I({\mathcal{S}})=0)=(1-s_{p})\sum_{n=0}^{N-1}\frac{N-n}{N}q_{r,k,N}(n)$

If $|{\mathcal{S}}|>1$, a group test is performed and, after a positive
result, individual tests are performed subsequently. Truly negative subjects
are falsely classified as positive if the corresponding group test outcome is
positive and the subject’s subsequent individual test outcome is positive,
_i.e._ ,

$\mathbb{E}[FP({\mathcal{S}})]=\sum_{s=0}^{|S|-1}P(T({\mathcal{S}})=1\,|\,I({\mathcal{S}})=s)P(I({\mathcal{S}})=s)(|{\mathcal{S}}|-s)(1-s_{p})$

Finally, under our assumptions about the individual probabilities, we rewrite
the above expression as

$\displaystyle\mathbb{E}[FP({\mathcal{S}})]$
$\displaystyle=(1-s_{p})P(I({\mathcal{S}})=0)|{\mathcal{S}}|(1-s_{p})+\sum_{s=1}^{|S|-1}s_{e}P(I({\mathcal{S}})=s)(|{\mathcal{S}}|-s)(1-s_{p})$
$\displaystyle=(1-s_{p})^{2}|{\mathcal{S}}|\left[\sum_{n=0}^{N}\frac{\binom{N-n}{|{\mathcal{S}}|}}{\binom{N}{|{\mathcal{S}}|}}q_{r,k,N}(n)\right]+\sum_{s=1}^{|{\mathcal{S}}|-1}s_{e}(|{\mathcal{S}}|-s)(1-s_{p})\left[\sum_{n=s}^{N}\frac{\binom{n}{s}\binom{N-n}{|{\mathcal{S}}|-s}}{\binom{N}{|{\mathcal{S}}|}}q_{r,k,N}(n)\right]$

### Finding the optimal pool sizes

First, we note that the expected number of tests, false negatives and false
positives only depend on the pool size. Therefore, overloading notation, for a
number of contacts $|\mathcal{N}|=N$ and pool of size $|{\mathcal{S}}|=s$, we
will write $E[K(s)]$, $\mathbb{E}[FN(s)]$ and $\mathbb{E}[FP(s)]$.

Our goal is to find the sizes $\\{s_{i}\\}$ of the optimal sets of pools that
optimally trade off the expected number of tests, false negatives and false
positives [5]:

$\underset{\\{s_{i}\\}}{\text{minimize}}\quad\sum_{i}g(s_{i})\quad\text{subject
to}\quad\sum_{i}s_{i}=N$

with

$g(s_{i})=\mathbb{E}[K(s_{i})]+\lambda_{1}\mathbb{E}[FN(s_{i})]+\lambda_{2}\mathbb{E}[FP(s_{i})],$

where $\lambda_{1}$ and $\lambda_{2}$ are given non-negative parameters,
penalizing the numbers of false negatives and false positives.

Algorithm 1 Find the sizes of the optimal set of pools under overdispersion of
infected contacts

1:Number of secondary contacts $N$, sensitivity $s_{e}$, specificity $s_{p}$,
parameters $r$, $k$, $\lambda_{1}$ and $\lambda_{2}$

2:${\mathcal{S}}_{0}\leftarrow\emptyset$

3:$h(0)\leftarrow 0$

4:for $k\in\\{1,\ldots,N\\}$ do

5:
$g(k)\leftarrow\textsc{ComputeObjective}(k,N,s_{e},s_{p},r,k,\lambda_{1},\lambda_{2})$

6:for $n\in\\{1,\ldots,N\\}$ do

7: $h(n)\leftarrow\min_{1\leq j\leq n}\left[g(j)+h(n-j)\right]$

8: $s\leftarrow\mathop{\mathrm{argmin}}_{1\leq j\leq
n}\left[g(j)+h(n-j)\right]$

9: ${\mathcal{S}}_{n}={\mathcal{S}}_{n-s}\cup\\{s\\}$

10:return ${\mathcal{S}}_{N}$

Perhaps surprisingly, we can solve the above problem in polynomial time using
a simple dynamic programming procedure. More specifically, define the
following recursive functions:

$\displaystyle h(n)$ $\displaystyle=\min_{1\leq j\leq n}[g(j)+h(n-j)]$
$\displaystyle{\mathcal{S}}_{n}$
$\displaystyle={\mathcal{S}}_{n-s}\cup\\{s\\},$

where $s=\mathop{\mathrm{argmin}}_{1\leq j\leq n}[g(j)+h(n-j)]$. Interpreting
$n$ as the number of individuals not yet assigned to a pool, using the two
recursive functions, the (sizes of the) optimal set of pools can be recovered
by computing $h(n)$ in increasing order of $n$. Algorithm 1 summarizes the
overall procedure, where the function $\textsc{ComputeObjective}(\cdot)$
precomputes the function $g(k)$ for each $k\in\\{1,\ldots,N\\}$. More
formally, we arrive at the following proposition:

###### Proposition 1

Given $N$ contacts, the set of pool sizes ${\mathcal{S}}_{N}$ returned by
Algorithm 1 are optimal.

Proof  We will prove this proposition by induction. In the base case, where
$n=1$, it is easy to see that the optimal solution is
${\mathcal{S}}^{*}_{1}=\\{1\\}$ _i.e._ , it consists of one group with size
$1$ and the minimum of the objective value is $OPT_{1}=g(1)$, while the
recursive functions trivially find the optimal solution since $h(1)=g(1)$. For
$n>1$ contacts, the inductive hypothesis is that the values $h(i)$ and sets
${\mathcal{S}}_{i}$ recovered by Algorithm 1 for all $i<n$ are optimal. Let
${\mathcal{S}}^{*}_{n}$ and $OPT_{n}$ be the optimal set of pool sizes and the
respective value of the objective function for $n$ contacts.

Suppose, for the sake of contradiction, that $OPT_{n}<h(n)$ _i.e._ , the
solution computed using the recursive functions for $n$ contacts is
suboptimal. Let
${\mathcal{S}}^{*}_{n}=\\{s^{*}_{1},s^{*}_{2},\ldots,s^{*}_{l}\\}$. Then, we
get:

$\sum_{i=1}^{l}g(s^{*}_{i})<g(s)+h(n-s)\Rightarrow\sum_{i=1}^{l}g(s^{*}_{i})<g(s^{*}_{1})+h(n-s^{*}_{1})\Rightarrow\sum_{i=2}^{l}g(s^{*}_{i})<OPT_{n-s^{*}_{1}},$

where the first step is based on the fact that $g(s)+h(n-s)\leq g(j)+h(n-j)$
for all $j:1\leq j\leq n$ and the second step is based on the inductive
hypothesis. Since $\sum_{i=2}^{l}s^{*}_{i}=n-s^{*}_{1}$, the final inequality
implies that, having $n-s^{*}_{1}$ contacts, the set of pool sizes
$\\{s^{*}_{2},\ldots,s^{*}_{l}\\}$ is strictly better than the optimal one
which is clearly a contradiction. Therefore, the values $h(n)$ and sets of
pool sizes ${\mathcal{S}}_{n}$ given by the recursive functions are optimal
for all $n:1\leq n\leq N$.

## Results and Discussion

(a) Number of tests per contact (b) Pool size (c) Percentage of tests saved

Figure 1: Performance of our method (Algorithm 1) and Dorfman’s method for
various values of the number of contacts of a diagnosed individual during
their infectious period. Panel (a) shows the number of tests per contact,
where the dots represent the average value and the error bars cover $90\%$ of
the observations. Panel (b) shows the average pool size. Panel (c) shows the
empirical distribution of the percentage of tests saved by using our method
instead of Dorfman’s method, where we exclude the highest and lowest $5\%$ of
observations. In all panels, we set the sensitivity and specificity to
$s_{e}=s_{p}=0.95$, and sample the number of secondary infections from a
truncated negative binomial distribution with mean $r=2.5$ and dispersion
parameter $k=0.1$ [19, 29, 20, 30]. For each combination of method and
parameter values, the averages and quantiles in all panels are estimated using
$100{,}000$ samples.

We perform simulations to evaluate Algorithm 1 against Dorfman’s method in its
ability to optimally trade off resources and false test outcomes in the
presence of overdispersed distributions of secondary infections. To generate
the infection states for each contact, we first fix a number of contacts $N$
and sample the number of secondary infections $n\sim q_{r,k,N}(n)$, where
$q_{r,k,N}(n)$ is a truncated negative binomial distribution as defined in Eq.
1. Then, we select $n$ of the $N$ contacts at random and set their status to
infected. To implement Dorfman’s method, we use a variation of Algorithm 1 in
which the expected numbers of tests, false negatives and false positives are
computed assuming an independent individual probability of infection
$p=\mathbb{E}_{q_{r,k,N}}[n]/N$, using the formulas derived by Abrahamian et
al. [5].

We first compare the performance of our method and Dorfman’s method at finding
the pools that minimize the number of tests (i.e.,
$\lambda_{1}=\lambda_{2}=0$) for fixed values of the reproductive number $r$
and dispersion parameter $k$ matching estimations done during the early phase
of the COVID-19 pandemic. Figure 1 summarizes the results with respect to the
number of contacts $N$ of the diagnosed individuals. The results show that our
method achieves a lower average number of tests across all values of $N$, with
its competitive advantage being greater when the number of contacts is small
and less apparent as the number of contacts is increasing. Moreover, Dorfman’
method chooses pool sizes that increase with the number of contacts while the
ones chosen by our method remain relatively constant. This leads to
significant differences between the distributions of the number of tests
performed under the two methods. For example, as shown in Figure 1(c), when
the number of contacts is $N=20$, our method is most likely to perform about
$50\%$ less tests than Dorfman’s. However, due to the more conservative pool
sizes given by Dorfman’s method, there is a small probability that our method
ends up performing more tests, sometimes even double the amount.

(a) $N=20$ (b) $N=100$ (c) $N=200$

Figure 2: Performance of our method (Algorithm 1) and Dorfman’s method for
different values of the reproductive number $r$ and dispersion parameter $k$.
Each panel shows the average percentage of tests saved by using our method
instead of Dorfman’s method. Here, we set the sensitivity and specificity to
$s_{e}=s_{p}=0.95$ and, in each experiment, we estimate the average using
$100{,}000$ samples.

(a) $s_{e}=s_{p}=0.75$ (b) $s_{e}=s_{p}=0.85$ (c) $s_{e}=s_{p}=0.95$

Figure 3: Average number of tests, false negative rate and false positive rate
achieved by our method (Algorithm 1) under different values of the parameters
$\lambda_{1}$ and $\lambda_{2}$ and different levels of specificity $s_{e}$
and sensitivity $s_{p}$. In each panel, we either penalize the false negative
rate (i.e., we vary $\lambda_{1}$ and set $\lambda_{2}=0$) or the false
positive rate (i.e., we vary $\lambda_{2}$ and set $\lambda_{1}=0$).
Accordingly, for the former, we show the false negative rate vs average number
of tests (in blue) and, for the latter, we show the false positive rate vs
average number of tests (in pink). Here, we set the number of contacts to
$N=100$ and sample the number of positive infections from a truncated negative
binomial distribution with mean $r=2.5$ and dispersion parameter $k=0.1$. In
each experiment, we estimate averages using $100{,}000$ samples.

Next, we investigate to what extent our method offers a competitive advantage
with respect to Dorfman’s method for additional values of the reproductive
number $r$ and dispersion parameter $k$ different than those estimated during
the early phase of the COVID-19 pandemic. Figure 2 summarizes the results,
which show that our method offers the greatest competitive advantage whenever
the number of secondary infections is overdispersed, i.e., $k\rightarrow 0$.
Moreover, as the number of contacts $N$ increases, the competitive advantage
is greater for larger values of the reproductive number $r$.

Finally, we explore the trade-off between the average number of tests that our
method achieves and the false positive and negative rates, under different
values of the parameters $\lambda_{1}$ and $\lambda_{2}$. Figure 3 summarizes
the results, which show that, to achieve lower false negative and false
positive rates, more tests need to be performed. When trading off the number
of tests with the number of false positives ($\lambda_{1}=0$,
$\lambda_{2}>0$), our method gradually changes the average pool size, leading
to many possible trade-off points between the number of tests and the false
positive rate. When $\lambda_{2}$ takes small values, the optimal solution
leads to pool sizes that minimize the number of tests, while the solution
consists of pools of two contacts when $\lambda_{2}$ gets significantly
larger. When balancing the number of tests with the number of false negatives
($\lambda_{1}>0$, $\lambda_{2}=0$), there are only two or three possible
solutions, with the extreme ones corresponding to pool sizes minimizing the
number of tests and pools of size one, _i.e._ , individual testing for all. We
noticed that the expected number of false negatives in a pool grows linearly
with its size for sizes greater than one, therefore, making the exact size of
the pool irrelevant in terms of the expected total number of false negatives.
As a consequence, this leads to only a few optimal solutions where some of the
contacts are individually tested while the rest of them are split into pools.

Our results have direct implications for the allocation of limited and
imperfect testing resources in future pandemics whenever there exists evidence
of substantial overdispersion in the number of secondary infections. In this
context, we acknowledge that more research is needed to more accurately
characterize the level of overdispersion in a pandemic. Moreover, it would be
interesting to extend our algorithm using distributions other that the
negative binomial and practically evaluate our method in randomized control
studies.

## Acknowledgements

We would like to thank Vipul Bajaj for fruitful discussions.

## References

  * [1] Sebastian Contreras et al.  The challenges of containing SARS-CoV-2 via test-trace-and-isolate.  Nature Communications, 12:378, January 2021.
  * [2] Matthias Linden, Jonas Dehning, Sebastian B. Mohr, Jan Mohring, Michael Meyer-Hermann, Iris Pigeot, Anita Schöbel, and Viola Priesemann.  The foreshadow of a second wave: An analysis of current covid-19 fatalities in germany.  Deutsches Ärzteblatt Int., 2020.
  * [3] Robert Dorfman.  The detection of defective members of large populations.  The Annals of Mathematical Statistics, 14(4):436–440, 1943.
  * [4] Lois E Graff and Robert Roeloffs.  Group testing in the presence of test error; an extension of the dorfman procedure.  Technometrics, 14(1):113–122, 1972.
  * [5] Hrayer Aprahamian, Douglas R Bish, and Ebru K Bish.  Optimal risk-based group testing.  Management Science, 65(9):4365–4384, 2019.
  * [6] Matthew Aldridge, Oliver Johnson, and Jonathan Scarlett.  Group testing: an information theory perspective.  Now Foundations and Trends, 2019.
  * [7] Dingzhu Du, Frank K Hwang, and Frank Hwang.  Combinatorial group testing and its applications, volume 12.  World Scientific, 2000.
  * [8] Charles N Agoti, Martin Mutunga, Arnold W Lambisia, Domtila Kimani, Robinson Cheruiyot, Patience Kiyuka, Clement Lewa, Elijah Gicheru, Metrine Tendwa, Khadija Said Mohammed, et al.  Pooled testing conserves sars-cov-2 laboratory resources and improves test turn-around time: experience on the kenyan coast.  Wellcome Open Research, 5, 2020.
  * [9] Jens Niklas Eberhardt, Nikolas Peter Breuckmann, and Christiane Sigrid Eberhardt.  Multi-stage group testing improves efficiency of large-scale covid-19 screening.  Journal of Clinical Virology, 128:104382, 2020.
  * [10] Angela Felicia Sunjaya and Anthony Paulo Sunjaya.  Pooled testing for expanding covid-19 mass surveillance.  Disaster Medicine and Public Health Preparedness, 14(3):e42–e43, 2020.
  * [11] Leon Mutesa, Pacifique Ndishimye, Yvan Butera, Jacob Souopgui, Annette Uwineza, Robert Rutayisire, Ella Larissa Ndoricimpaye, Emile Musoni, Nadine Rujeni, Thierry Nyatanyi, et al.  A pooled testing strategy for identifying sars-cov-2 at low prevalence.  Nature, pages 1–5, 2020.
  * [12] Andreas Deckert, Till Bärnighausen, and Nicholas NA Kyei.  Simulation of pooled-sample analysis strategies for covid-19 mass testing.  Bulletin of the World Health Organization, 98(9):590, 2020.
  * [13] Rodrigo Noriega and Matthew Samore.  Increasing testing throughput and case detection with a pooled-sample bayesian approach in the context of covid-19.  bioRxiv, 2020.
  * [14] Roni Ben-Ami, Agnes Klochendler, Matan Seidel, Tal Sido, Ori Gurel-Gurevich, Moran Yassour, Eran Meshorer, Gil Benedek, Irit Fogel, Esther Oiknine-Djian, et al.  Large-scale implementation of pooled rna extraction and rt-pcr for sars-cov-2 detection.  Clinical Microbiology and Infection, 26(9):1248–1253, 2020.
  * [15] Rudolf Hanel and Stefan Thurner.  Boosting test-efficiency by pooled testing strategies for sars-cov-2.  arXiv preprint arXiv:2003.09944, 2020.
  * [16] Junan Zhu, Kristina Rivera, and Dror Baron.  Noisy pooled pcr for virus testing.  arXiv preprint arXiv:2004.02689, 2020.
  * [17] Dillon C. Adam et al.  Clustering and superspreading potential of SARS-CoV-2 infections in Hong Kong.  Nature Medicine, 2020.
  * [18] MSF.  Too little, too late: The unacceptable neglect of the elderly in care homes during the COVID-19 epidemic in Spain, 2020.
  * [19] Akira Endo et al.  Estimating the overdispersion in COVID-19 transmission using outbreak sizes outside China.  Wellcome Open Research, 2020.
  * [20] Max SY Lau et al.  Characterizing superspreading events and age-specific infectiousness of SARS-CoV-2 transmission in Georgia, USA.  Proceedings of the National Academy of Sciences, 117(36), 2020.
  * [21] Thomas Frieden and Christopher Lee.  Identifying and interrupting superspreading events—implications for control of severe acute respiratory syndrome coronavirus 2.  2020\.
  * [22] Siva Athreya, Nitya Gadhiwala, and Abhiti Mishra.  Effective reproduction number and dispersion under contact tracing and lockdown on COVID-19 in Karnataka.  medRxiv, 2020.
  * [23] Lars Lorch, Heiner Kremer, William Trouleau, Stratis Tsirtsis, Aron Szanto, Bernhard Schölkopf, and Manuel Gomez-Rodriguez.  Quantifying the effects of contact tracing, testing, and containment measures in the presence of infection hotspots.  arXiv preprint arXiv:2004.07641, 2020.
  * [24] Myoung-don Oh et al.  Middle east respiratory syndrome coronavirus superspreading event involving 81 persons, Korea 2015.  Journal of Korean medical science, 30(11):1701–1705, 2015.
  * [25] James O Lloyd-Smith, Sebastian J Schreiber, P Ekkehard Kopp, and Wayne M Getz.  Superspreading and the effect of individual variation on disease emergence.  Nature, 438(7066):355–359, 2005.
  * [26] Richard A Stein.  Super-spreaders in infectious diseases.  International Journal of Infectious Diseases, 15(8):e510–e513, 2011\.
  * [27] FK Hwang.  A generalized binomial group testing problem.  Journal of the American Statistical Association, 70(352):923–926, 1975.
  * [28] Idan Yelin, Noga Aharony, Einat Shaer Tamar, Amir Argoetti, Esther Messer, Dina Berenbaum, Einat Shafran, Areen Kuzli, Nagham Gandali, Omer Shkedi, et al.  Evaluation of covid-19 rt-qpcr test in multi sample pools.  Clinical Infectious Diseases, 71(16):2073–2078, 2020.
  * [29] Adam J Kucharski, Petra Klepac, Andrew JK Conlan, Stephen M Kissler, Maria L Tang, Hannah Fry, Julia R Gog, W John Edmunds, Jon C Emery, Graham Medley, et al.  Effectiveness of isolation, testing, contact tracing, and physical distancing on reducing transmission of sars-cov-2 in different settings: a mathematical modelling study.  The Lancet Infectious Diseases, 20(10):1151–1160, 2020.
  * [30] Agus Hasan, Hadi Susanto, Muhammad Firmansyah Kasim, Nuning Nuraini, Bony Lestari, Dessy Triany, and Widyastuti Widyastuti.  Superspreading in early transmissions of covid-19 in indonesia.  Scientific reports, 10(1):1–4, 2020.