Reducing Exposure to Harmful Content via Graph Rewiring

Most media content consumed today is provided by digital platforms that aggregate input from diverse sources, where access to information is mediated by recommendation algorithms. One principal challenge in this context is dealing with content that is considered harmful. Striking a balance between competing stakeholder interests, rather than block harmful content altogether, one approach is to minimize the exposure to such content that is induced specifically by algorithmic recommendations. Hence, modeling media items and recommendations as a directed graph, we study the problem of reducing the exposure to harmful content via edge rewiring. We formalize this problem using absorbing random walks, and prove that it is NP-hard and NP-hard to approximate to within an additive error, while under realistic assumptions, the greedy method yields a (1-1/e)-approximation. Thus, we introduce Gamine, a fast greedy algorithm that can reduce the exposure to harmful content with or without quality constraints on recommendations. By performing just 100 rewirings on YouTube graphs with several hundred thousand edges, Gamine reduces the initial exposure by 50%, while ensuring that its recommendations are at most 5% less relevant than the original recommendations. Through extensive experiments on synthetic data and real-world data from video recommendation and news feed applications, we confirm the effectiveness, robustness, and efficiency of Gamine in practice.


INTRODUCTION
Recommendation algorithms mediate access to content on digital platforms, and as such, they critically influence how individuals and societies perceive the world and form their opinions [12,21, Figure 1: 3-out-regular directed graphs with four good nodes (white) and three bad nodes (gray).Edges running from good to bad nodes are drawn in red.The left graph minimizes the segregation objective from Fabbri et al. [10], but random walks oscillate between good nodes and bad nodes.In contrast, only the right graph minimizes our exposure objective.36,42,44].In recent years, platforms have come under increasing scrutiny from researchers and regulators alike due to concerns and evidence that their recommendation algorithms create filter bubbles [6,26,28,45] and fuel radicalization [19,27,39,41,49].One of the main challenges in this context is dealing with content that is considered harmful [4,7,50].To address this challenge while balancing the interests of creators, users, and platforms, rather than block harmful content, one approach is to minimize the exposure to such content that is induced by algorithmic recommendations.
In this paper, we study the problem of reducing the exposure to harmful content via edge rewiring, i.e., replacing certain recommendations by others.This problem was recently introduced by Fabbri et al. [10], who proposed to address it by modeling harmfulness as a binary node label and minimizing the maximum segregation, defined as the largest expected number of steps of a random walk starting at a harmful node until it visits a benign node.However, while Fabbri et al. [10] posed a theoretically interesting and practically important problem, their approach has some crucial limitations.
First, treating harmfulness as dichotomous fails to capture the complexity of real-world harmfulness assessments.Second, the segregation objective ignores completely all random-walk continuations that return to harmful content after the first visit to a benign node, but benign nodes do not act as absorbing states in practice.The consequences are illustrated in Fig. 1a, where the segregation objective judges that the graph provides minimal exposure to harmful content (the hitting time from any harmful node to a benign node is 1), while long random walks, which model user behavior more realistically, oscillate between harmful and benign content.
In this paper, we remedy the above-mentioned limitations.First, we more nuancedly model harmfulness as real-valued node costs.Second, we propose a novel minimization objective, the expected total exposure, defined as the sum of the costs of absorbing random walks starting at any node.Notably, in our model, no node is an absorbing state, but any node can lead to absorption, which represents more faithfully how users cease to interact with a platform.Our exposure objective truly minimizes the exposure to harmful content.For example, it correctly identifies the graph in Fig. 1b as significantly less harmful than that in Fig. 1a, while for the segregation objective by Fabbri et al. [10], the two graphs are indistinguishable.
On the algorithmic side, we show that although minimizing the expected total exposure is NP-hard and NP-hard to approximate to within an additive error, its maximization version is equivalent to a submodular maximization problem under the assumption that the input graph contains a small number of safe nodes, i.e., nodes that cannot reach nodes with non-zero costs.If these safe nodes are present-which holds in 80% of the real-world graphs used in our experiments-the greedy method yields a (1 − 1 /)approximation.Based on our theoretical insights, we introduce Gamine, a fast greedy algorithm for reducing exposure to harmful content via edge rewiring.Gamine leverages provable strategies for pruning unpromising rewiring candidates, and it works both with and without quality constraints on recommendations.With just 100 rewirings on YouTube graphs containing hundred thousands of edges, Gamine reduces the exposure by 50%, while ensuring that its recommendations are at least 95% as relevant as the originals.
In the following, we introduce our problems, REM and QREM (Section 2), and analyze them theoretically (Section 3).Building on our theoretical insights, we develop Gamine as an efficient greedy algorithm for tackling our problems (Section 4).Having discussed related work (Section 5), we demonstrate the performance of Gamine through extensive experiments (Section 6) before concluding with a discussion (Section 7).All code, datasets, and results are publicly available, 1 and we provide further materials in Appendices A to F.

PROBLEMS
We consider a directed graph  = ( , ) of content items ( ) and what-to-consume-next recommendations (), with  = | | nodes and  = || edges.Since we can typically make a fixed number of recommendations for a given content item, such recommendation graphs are often -out-regular, i.e., all nodes have  =  / outneighbors, but we do not restrict ourselves to this setting.Rather, each node  has an out-degree  + () = |Γ + ()|, where Γ + () is the set of out-neighbors of , and a cost   ∈ [0, 1], which quantifies the harmfulness of content item , ranging from 0 (not harmful at all) to 1 (maximally harmful).For convenience, we define Δ + = max{ + () |  ∈  } and collect all costs into a vector c ∈ [0, 1]  .We model user behavior as a random-walk process on the recommendation graph .Each edge (, ) in the recommendation graph is associated with a transition probability    such that  ∈Γ + ( )    = 1 −   , where   is the absorption probability of a random walk at node  (i.e., the probability that the walk ends at ).Intuitively, one can interpret   as the probability that a user stops using the service after consuming content .For simplicity, we assume   =  ∈ (0, 1] for all  ∈  .Thus, we can represent the random-walk process on  by the transition matrix P ∈ [0, 1 − ] × , where 1 10.5281/zenodo.7936816 This is an absorbing Markov chain, and the expected number of visits from a node  to a node  before absorption is given by the entry (, ) of the fundamental matrix F ∈ R × ≥0 , defined as where I is the  × -dimensional identity matrix, and the series converges since ∥P∥ ∞ = max   =0 P[, ] = 1 −  < 1. Denoting the -th unit vector as e  , observe that the row vector e   F gives the expected number of visits, before absorption, from  to any node, and the column vector Fe  gives the expected number of visits from any node to .Hence, e   Fc =  ∈ F[, ]c  gives the expected exposure to harmful content of users starting their random walk at node , referred to as the exposure of .The expected total exposure to harm in the graph , then, is given by the non-negative function where 1 is the vector with each entry equal to 1.
We would like to minimize the exposure function given in Eq. ( 3) by making  edits to the graph , i.e., we seek an effective postprocessing strategy for harm reduction.In line with our motivating application, we restrict edits to edge rewirings denoted as (, , ), in which we replace an edge (, ) ∈  by an edge (, ) ∉  with  ≠ , setting   =    (other edits are discussed in Appendix B).Seeking edge rewirings to minimize the expected total exposure yields the following problem definition.

Problem 1 (𝑟 -rewiring exposure minimization [REM]
).Given a graph , its random-walk transition matrix P, a node cost vector c, and a budget  , minimize  (  ), where   is  after  rewirings.
Equivalently, we can maximize the reduction in the expected total exposure to harmful content, Note that while any set of rewirings minimizing  (  ) also maximizes  Δ (,   ), the approximabilities of  and  Δ can differ widely.As Problem 1 does not impose any constraints on the rewiring operations, the optimal solution might contain rewirings (, , ) such that node  is unrelated to .To guarantee high-quality recommendations, we need additional relevance information, which we assume to be given as a relevance matrix R ∈ R × ≥0 , where R[, ] denotes the relevance of node  in the context of node .Given such relevance information, and assuming that the out-neighbors of a node  are ordered as r  ∈   + ( ) , we can define a relevance function  with range [0, 1] to judge the quality of the recommendation sequence at node , depending on the relevance and ordering of recommended nodes, and demand that any rewiring retain  (r  ) ≥  for all  ∈  and some quality threshold  ∈ [0, 1].One potential choice for  is the normalized discounted cumulative gain (nDCG), a popular ranking quality measure, which we use in our experiments and define in Appendix D.1.Introducing  allows us to consider a variant of REM with relevance constraints.
Problem 2 (-relevant  -rewiring exposure minimization [QREM]).Given a graph , its random-walk transition matrix P, a node cost vector c, a budget  , a relevance matrix R, a relevance function  , and a quality threshold , minimize  (  ) under the condition that  (r  ) ≥  for all  ∈  .
For  = 0, QREM is equivalent to REM.Collecting our notation in Appendix Table 3, we now seek to address both problems.

THEORY
To start with, we establish some theoretical properties of our problems, the functions  and  Δ , and potential solution approaches.
Hardness.We begin by proving that REM (and hence, also QREM) is an NP-hard problem.
Proof.We obtain this result by reduction from minimum vertex cover for cubic, i.e., 3-regular graphs (MVC-3), which is known to be NP-hard [16].A full, illustrated proof is given in Appendix A.1.□ Next, we further show that REM is hard to approximate under the Unique Games Conjecture (UGC) [24], an influential conjecture in hardness-of-approximation theory.Theorem 2. Assuming the UGC, REM is hard to approximate to within an additive error of both Θ() and Θ( ).
Proof.We obtain this result via the hardness of approximation of MVC under the UGC.A full proof is given in Appendix A.2. □ Both Theorem 1 and Theorem 2 extend from  to  Δ (Eq.( 9)).
Approximability.Although we cannot approximate  directly, we can approximate  Δ with guarantees under mild assumptions, detailed below.To formulate this result and its assumptions, we start by calling a node safe if e   Fc = 0, i.e., no node  with   > 0 is reachable from , and unsafe otherwise.Note that the existence of a safe node in a graph  containing at least one unsafe node (i.e.,   > 0 for some  ∈  ) implies that  is not strongly connected.Proof.Leveraging the terminology introduced above, we obtain this result by applying the definitions of monotonicity and submodularity.A full proof is given in Appendix A. 3. □ Our motivating application, however, ideally prevents multiedges.To get a similar result without multi-edges, denote by Λ + = max{ + () |  ∈  } the maximum out-degree of any unsafe node in , and assume that | | ≥ Λ + .Now, we obtain the following.Proof.Following the reasoning provided for Lemma 1, with the modification that we need | | ≥ Λ + to ensure that safe targets are always available for rewiring without creating multi-edges.□ Observe that the larger the number of zero-cost nodes, the smaller the number of edges, or the more homophilous the linking, the higher the probability that safe nodes exist in a graph.Notably, the precondition of Theorem 3 holds for the graph constructed to prove Theorem 1 (Appendix A.1, Fig. 10) as well as for most of the real-world graphs used in our experiments (Appendix E, Fig. 17).However, Theorem 3 only applies to the maximization version of REM (Eq.( 9)) and not to the maximization version of QREM, since in the quality-constrained setting, some safe nodes might not be available as rewiring targets for edges emanating from unsafe nodes.Still, for the maximization version of REM, due to Theorem 3, using a greedy approach to optimize  Δ provides an approximation guarantee with respect to the optimal solution [34].
Note that Corollary 1 only applies to the maximization version of REM, not to its minimization version, as supermodular minimization is less well-behaved than submodular maximization [22,52].
Greedy Rewiring.Given the quality assurance of a greedy approach at least for REM, we seek to design an efficient greedy algorithm to tackle both REM and QREM.To this end, we analyze the mechanics of individual rewirings to understand how we can identify and perform greedily optimal rewirings efficiently.As each greedy step constitutes a rank-one update of the transition matrix P, we can express the new transition matrix P ′ as where u =    e  and v = e  − e  , and we omit the dependence on , , and  for notational conciseness.This corresponds to a rank-one update of F, such that we obtain the new fundamental matrix F ′ as The rank-one update allows us to use the Sherman-Morrison formula [43] to compute the updated fundamental matrix as The mechanics of an individual edge rewiring are summarized in Table 1.They will help us perform greedy updates efficiently.
To also identify greedily optimal rewirings efficiently, leveraging Eq. ( 7), we assess the impact of a rewiring on the value of our objective function, which will help us prune weak rewiring candidates.For a rewiring (, , ) represented by u and v, the value of the exposure function  for the new graph  ′ is with The interpretation of the above quantities is as follows:  is the    -scaled -th column sum of F (expected number of visits to ),  is Table 1: Summary of an edge rewiring (, , ) in a graph  = ( , ) with random-walk transition matrix P and fundamental matrix F = (I − P) −1 .
the cost-scaled sum of the differences between the -th row and the -th row of F (expected number of visits from  resp.), and  is a normalization factor scaling the update by 1 plus the    -scaled difference in the expected number of visits from  to  and from  to , ensuring that F ′ 1 = F1.Scrutinizing Eq. ( 9), we observe: Lemma 2. For a rewiring (, , ) represented by u and v, (i)  is always positive, (ii)  is always positive, and (iii)  can have any sign.
Proof.We obtain this result by analyzing the definitions of , , and .The full proof is given in Appendix A. 4. □ To express when we can safely prune rewiring candidates, we call a rewiring (, , ) greedily permissible if Δ > 0, i.e., if it reduces our objective, and greedily optimal if it maximizes Δ.For QREM, we further call a rewiring (, , ) greedily -permissible if it ensures that  (r  ) ≥  under the given relevance function  .With this terminology, we can confirm our intuition about rewirings as a corollary of Eqs. ( 8) and ( 9), combined with Lemma 2.
Corollary 2. A rewiring (, , ) is greedily permissible if and only if  > 0, i.e., if  is more exposed to harm than .
For the greedily optimal rewiring, that is, to maximize Δ, we would like  to be as large as possible, and  to be as small as possible.Inspecting Eq. ( 9), we find that to accomplish this objective, it helps if (in expectation)  is visited more often (from ),  is more exposed and  is less exposed to harm (from ), and  is harder to reach from  and easier to reach from  (from ).
In the next section, we leverage these insights to guide our efficient implementation of the greedy method for REM and QREM.

ALGORITHM
In the previous section, we identified useful structure in the fundamental matrix F, the exposure function  , and our maximization objective  Δ .Now, we leverage this structure to design an efficient greedy algorithm for REM and QREM.We develop this algorithm in three steps, focusing on REM in the first two steps, and integrating the capability to handle QREM in the third step.
Naïve implementation.Given a graph , its transition matrix P, a cost vector c, and a budget  , a naïve greedy implementation for REM computes the fundamental matrix and gradually fills up an initially empty set of rewirings by performing  greedy steps before returning the selected rewirings (Appendix C, Algorithm 3).In each greedy step, we identify the triple (, , ) that maximizes Eq. ( 9) by going through all edges (, ) ∈  and computing Δ for rewirings to all potential targets .We then update , P, and F to reflect a rewiring replacing (, ) by (, ) (cf.Table 1), and add the triple (, , ) to our set of rewirings.Computing the fundamental matrix naïvely takes time O ( 3 ), computing Δ takes time O () and is done O () times, and updating F takes time O ( 2 ).Hence, we arrive at a time complexity of O ( 2 ( + )).But we can do better.
Forgoing matrix inversion.When identifying the greedy rewiring, we never need access to F directly.Rather, in Eq. ( 9), we work with 1  F, corresponding to the column sums of F, and with Fc, corresponding to the cost-scaled row sums of F. We can approximate both via power iteration: For each term in these sums, we need to perform O () multiplications, such that we can compute Reducing the number of candidate rewirings.Observe that to further improve the time complexity of our algorithm, we need to reduce the number of rewiring candidates considered.To this end, note that the quantity  is maximized for the nodes  and  with the largest difference in cost-scaled row sums.How exactly we leverage this fact depends on our problem.
If we solve REM, instead of considering all possible rewiring targets, we focus on the Δ + + 2 candidate targets  with the smallest exposure, which we can identify in time O () without sorting Fc.This ensures that for each (, ) ∈ , there is at least one  ∈  such that  ≠  and  ≠ , which ascertains that despite restricting to , for each  ∈  , we still consider the rewiring (, , ) maximizing .With this modification, we reduce the number of candidate targets from O () to O (Δ + ) and the time to compute all relevant v  Fc values from O ( 2 ) to O (Δ + ).To obtain a subquadratic complexity, however, we still need to eliminate the computation of Fu for all (, ) ∈ .This also means that we can no longer afford to compute  for each of the now O (Δ + ) rewiring candidates under consideration, as this can only be done in constant time if Fu is already precomputed for the relevant edge (, ).However,  is driven by the difference between two entries of F, whereas  is driven by the difference between two row sums of F, and  is driven by a single column sum of F. Thus, although  >  ′ does not generally imply  / >  ′ / ′ , the variation in  is typically much larger than that in , and large  values mostly dominate small values of .Consequently, as demonstrated in Appendix F.3, the correlation between Δ = Δ =  and Δ =  / is almost perfect.Thus, instead of Δ, we opt to compute Δ as a heuristic, and we further hedge against small fluctuations without increasing the time complexity of our algorithm by computing Δ for the rewirings associated with the O (1) largest values of Δ, rather than selecting the rewiring with the best Δ value directly.Using Δ instead of Δ, we obtain a running time of O (Δ + ( + )) when solving REM.
When solving QREM, we are given a relevance matrix R, a relevance function  , and a relevance threshold  as additional inputs.Instead of considering the Δ + + 2 nodes  with the smallest exposure as candidate targets for all edges, for each edge (, ), we first identify the set of rewiring candidates (, , ) such that (, , ) is -permissible, i.e.,  (r  ) ≥  after replacing (, ) by (, ), and then select the node    with the smallest exposure to construct our most promising rewiring candidate (, ,    ) for edge (, ).This ensures that we can still identify the rewiring (, , ) that maximizes  and satisfies our quality constraints, and it leaves us to consider O () rewiring candidates.Again using Δ instead of Δ, we can now solve QREM in time O (ℓ + ℎ), where ℓ is the maximum number of targets  such that (, , ) is -permissible,  is the complexity of evaluating  , and ℎ is the complexity of determining the initial set  of -permissible rewirings.
Thus, we have arrived at our efficient greedy algorithm, called Gamine (Greedy approximate minimization of exposure), whose pseudocode we state as Algorithms

RELATED WORK
Our work methodically relates to research on graph edits with distinct goals, such as improving robustness, reducing distances, or increasing centralities [5,32,37], and research leveraging random walks to rank nodes [30,35,48] or recommend links [38,51].The agenda of our work, however, aligns most closely with the literature studying harm reduction, bias mitigation, and conflict prevention in graphs.Here, the large body of research on shaping opinions or mitigating negative phenomena in graphs of user interactions (especially on social media) [1, 3, 8, 13-15, 33, 46, 47, 53, 54] pursues goals similar to ours in graphs capturing different digital contexts.
As our research is motivated by recent work demonstrating how recommendations on digital media platforms like YouTube can fuel radicalization [29,41], the comparatively scarce literature on harm reduction in graphs of content items is even more closely related.Our contribution is inspired by Fabbri et al. [10], who study how edge rewiring can reduce radicalization pathways in recommendation graphs.Fabbri et al. [10] encode harmfulness in binary node labels, model benign nodes as absorbing states, and aim to minimize the maximum segregation of any node, defined as the largest expected length of a random walk starting at a harmful node before it visits a benign node.In contrast, we encode harmfulness in more nuanced, real-valued node attributes, use an absorbing Markov chain model that more naturally reflects user behavior, and aim to minimize the expected total exposure to harm in random walks starting at any node.Thus, our work not only eliminates several limitations of the work by Fabbri et al. [10], but it also provides a different perspective on harm mitigation in recommendation graphs.
While Fabbri et al. [10], like us, consider recommendation graphs, Haddadan et al. [18] focus on polarization mitigation via edge insertions.Their setting was recently reconsidered by Adriaens et al. [2], who tackle the minimization objective directly instead of using the maximization objective as a proxy, providing approximation bounds as well as speed-ups for the standard greedy method.Both Fabbri et al. [10] and the works on edge insertion employ with random-walk objectives that-unlike our exposure function-do not depend on random walks starting from all nodes.In our experiments, we compare with the algorithm introduced by Fabbri et al. [10], which we call MMS.We refrain from comparing with edge insertion strategies because they consider a different graph edit operation and are already outperformed by MMS.

EXPERIMENTAL EVALUATION
In our experiments, we seek to (1) establish the impact of modeling choices and input parameters on the performance of Gamine; (2) demonstrate the effectiveness of Gamine in reducing exposure to harm compared to existing methods and baselines; (3) ensure that Gamine is scalable in theory and practice; (4) understand what features make reducing exposure to harm easier resp.harder on different datasets; and (5) derive general guidelines for reducing exposure to harm in recommendation graphs under budget constraints.Further experimental results are provided in Appendix F.

Setup
6.1.1Datasets.To achieve our experimental goals, we work with both synthetic and real-world data, as summarized in Table 2. Below, we briefly introduce these datasets.Further details, including on data generation and preprocessing, are provided in Appendix E. Synthetic data.As our synthetic data, we generate a total of 288 synthetic graphs of four different sizes using two different edge placement models and various parametrizations.The first model, SU, chooses out-edges uniformly at random, similar to a directed Erdős-Rényi model [9].In contrast, the second model, SH, chooses edges preferentially to favor small distances between the costs of the source and the target node, implementing the concept of homophily [31].We use these graphs primarily to analyze the behavior of our objective function, and to understand the impact of using Δ instead of Δ to select the greedily optimal rewiring (Appendix F.3).
Real-world data.We work with real-world data from two domains, video recommendations (YT) and news feeds (NF).For our video application, we use the YouTube data by Ribeiro et al. [29,41], which contains identifiers and "Up Next"-recommendations for videos from selected channels categorized to reflect different degrees and directions of radicalization.For our news application, we use subsets of the NELA-GT-2021 dataset [17], which contains 1.8 million news articles published in 2021 from 367 outlets, along with veracity labels from Media Bias/Fact Check.Prior versions of both datasets are used in the experiments reported by Fabbri et al. [10].
Table 2: Overview of the datasets used in our experiments.For each graph , we report the regular out-degree , the number of nodes , and the number of edges , as well as the range of the expected exposure  ( ) / under our various cost functions, edge wirings, and edge transition probabilities.Datasets with identical statistics are pooled in the same row.Parametrizations.To comprehensively assess the effect of modeling assumptions regarding the input graph and its associated random-walk process on our measure of exposure as well as on the performance of Gamine and its competitors, we experiment with a variety of parametrizations expressing these assumptions.For all datasets, we distinguish three random-walk absorption probabilities  ∈ {0.05, 0.1, 0.2} and two probability shapes  ∈ {U, S} over the out-edges of each node (Uniform and Skewed).For our synthetic datasets, we further experiment with three fractions of latently harmful nodes  ∈ {0.3, 0.5, 0.7} and two cost functions  ∈ {  ,   }, one binary and one real-valued.Lastly, for our real-world datasets, we distinguish three regular out-degrees  ∈ {5, 10, 20}, five quality thresholds  ∈ {0.0, 0.5, 0.9, 0.95, 0.99} and four cost functions, two binary (  1,   2) and two real-valued ( 1 ,  2 ), based on labels provided with the original datasets, as detailed in Appendix E.2.2.

Dataset
6.1.2Algorithms.We compare Gamine, our algorithm for REM and QREM, with four baselines (BL1-BL4) and the algorithm by Fabbri et al. [10] for minimizing the maximum segregation, which we call MMS.In all QREM experiments, we use the O (1)-computable normalized discounted cumulative gain (nDCG), defined in Appendix D.1 and also used by MMS, as a relevance function  , and consider the 100 most relevant nodes as potential rewiring targets.
As MMS can only handle binary costs, we transform nonbinary costs  into binary costs  ′ by thresholding to ensure   ≥  ⇔  ′  = 1 for some rounding threshold  ∈ (0, 1] (cf.Appendix D.2).Since MMS requires access to relevance information, we restrict our comparisons with MMS to data where this information is available.
Our baselines BL1-BL4 are ablations of Gamine, such that outperforming them shows how each component of our approach is beneficial.We order the baselines by the competition we expect from them, from no competition at all (BL1) to strong competition (BL4).Intuitively, BL1 does not consider our objective at all, BL2 is a heuristic focusing on the  component of our objective, BL3 is a heuristic focusing on the  component of our objective, and BL4 is a heuristic eliminating the iterative element of our approach.BL1-BL3 each run in  rounds, while BL4 runs in one round.In each round, BL1 randomly selects a permissible rewiring via rejection sampling.BL2 selects the rewiring (, , ) with the node  maximizing e   Fc as its old target, the node  with  ∈ Γ + () maximizing 1  Fe  as its source, and the available node  minimizing e   Fc as its new target.BL3 selects the rewiring (, , ) with the node  maximizing 1  Fe  as its source, the node  with  ∈ Γ + () maximizing e   Fc as its old target, and the available node  minimizing e   Fc as its new target.BL4 selects the  rewirings with the largest initial values of Δ, while ensuring each edge is rewired at most once.

Implementation and reproducibility.
All algorithms, including Gamine, the baselines, and MMS, are implemented in Python 3.10.We run our experiments on a 2.9 GHz 6-Core Intel Core i9 with 32 GB RAM and report wall-clock time.All code, datasets, and results are publicly available, 2 and we provide further reproducibility information in Appendix D.

Impact of modeling choices.
To understand the impact of a particular modeling choice on the performance of Gamine and its competitors, we analyze groups of experimental settings that vary only the parameter of interest while keeping the other parameters constant, focusing on the YT-100k datasets.We primarily report the evolution of the ratio  (  ) / ( ) =  ( ) − Δ (,  ) / ( ), which indicates what fraction of the initial expected total exposure is left after  rewirings, and hence is comparable across REM instances with different starting values.Overall, we observe that Gamine robustly reduces the expected total exposure to harm, and that it changes its behavior predictably under parameter variations.Due to space constraints, we defer the results showing this for variations in the regular out-degree , the random-walk absorption probability , the probability shape , and the cost function  to Appendix F.1.
Impact of quality threshold .The higher the quality threshold , the more constrained our rewiring options.Thus, under a given budget  , we expect Gamine to reduce our objective more strongly for smaller .As illustrated in Fig. 2, our experiments confirm this intuition, and the effect is more pronounced if the out-edge probability distribution is skewed.We further observe that Gamine can guarantee  = 0.5 with little performance impact, and it can strongly reduce the exposure to harm even under a strict  = 0.95: With just 100 edge rewirings, it reduces the expected total exposure to harm by 50%, while ensuring that its recommendations are at most 5% less relevant than the original recommendations.

Performance comparisons.
Having ensured that Gamine robustly and predictably reduces the total exposure across the entire spectrum of modeling choices, we now compare it with its competitors.Overall, we find that Gamine offers more reliable performance and achieves stronger harm reduction than its contenders.
Comparison with baselines BL1-BL4.First, we compare Gamine with our four baselines, each representing a different ablation of our algorithm.As depicted in Fig. 3, the general pattern we observe matches our performance expectations (from weak performance of BL1 to strong performance of BL4), but we are struck by the strong performance of BL3 (selecting based on ), especially in contrast to the weak performance of BL2 (selecting based on ).This suggests that whereas the most exposed node does not necessarily have a highly visited node as an in-neighbor, the most visited node tends to have a highly exposed node as an out-neighbor.In other words, for some highly prominent videos, the YouTube algorithm problematically appears to recommend highly harm-inducing content to watch next.Despite the competitive performance of BL3 and BL4, Gamine consistently outperforms these baselines, too, and unlike the baselines, it smoothly reduces the exposure function.This lends additional support to our reliance on  (rewiring a highly visited  away from a highly exposed ) as an iteratively evaluated heuristic.

Comparison with MMS.
Having established that all components of Gamine are needed to achieve its performance, we now compare our algorithm with MMS, the method proposed by Fabbri et al. [10].To this end, we run both Gamine and MMS using their respective objective functions, i.e., the expected total exposure to harm of random walks starting at any node (total exposure, Gamine) and the maximum expected number of random-walk steps from a harmful node to a benign node (maximum segregation, MMS).Reporting their performance under the objectives of both algorithms (as well as the total segregation, which sums the segregation scores of all harmful nodes) in Fig. 4, we find that under strict quality control ( ∈ {0.9, 0.95, 0.99}), Gamine outperforms MMS on all objectives, and MMS stops early as it can no longer reduce its objective function.For  = 0.5, MMS outperforms Gamine on the segregation-based objectives, but Gamine still outperforms MMS on our exposurebased objective, sometimes at twice the margin (Fig. 4g).Further, while Gamine delivers consistent and predictable performance that is strong on exposure-based and segregation-based objectives, we observe much less consistency in the performance of MMS.For example, it is counterintuitive that MMS identifies 100 rewirings on the smaller YT-100k data but stops early on the larger YT-10k data.Moreover, MMS delivers the results shown in Fig. 4 under  1 , but it cannot decrease its objective at all on the same data under  2 , which differs from  1 only in that it also assigns harm to antifeminist content (Appendix E, Table 7).We attribute this brittleness to the reliance on the maximum-based segregation objective, which, by design, is less robust than our sum-based exposure objective.

Empirical scalability of Gamine.
In our previous experiments, we found that Gamine robustly and reliably reduces the expected total exposure to harm.Now, we seek to ascertain that its practical scaling behavior matches our theoretical predictions, i.e., that under realistic assumptions on the input, Gamine scales linearly in  and .We are also interested in comparing Gamine's scalability to that of MMS.To this end, we measure the time taken to compute a single rewiring and report, in Fig. 5, the average over ten rewirings Figure 3: Performance of Gamine with  = 0.0, compared with the four baselines BL1, BL2, BL3, and BL4 under  1 , run on YT-100k with  = 0.05 and  = U.As BL4 is roundless, we apply its rewirings in decreasing order of Δ to its as a function of  .Gamine outcompetes all baselines, but BL3 and BL4 also show strong performance.
for each of our datasets.This corresponds to the time taken by 1-REM in Gamine and by 1-Rewiring in MMS, which drives the overall scaling behavior of both algorithms.We find that Gamine scales approximately linearly, whereas MMS scales approximately quadratically (contrasting with the empirical time complexity of O ( log ) claimed in [10]).This is because our implementation of MMS follows the original authors', whose evaluation of the segregation objective takes time O () and is performed O () times.The speed of precomputations depends on the problem variant (REM vs. QREM), and for QREM, also on the quality function  .In our experiments, precomputations add linear overhead for Gamine and volatile overhead for MMS, as we report in Appendix F.2.

Data complexity.
Given that Gamine strongly reduces the expected total exposure to harm with few rewirings on the YouTube data, as evidenced in Figs. 2 to 4, one might be surprised to learn that its performance seems much weaker on the NELA-GT data (Appendix F.4): While it still reduces the expected total exposure and outperforms MMS (which struggles to reduce its objective at all on the NF data), the impact of individual rewirings is much smaller than on the YouTube datasets, and the value of the quality threshold  barely makes a difference.This motivates us to investigate how data complexity impacts our ability to reduce the expected total exposure to harm via edge rewiring: Could reducing exposure to harm be intrinsically harder on NF data than on YT data?The   [10], or by the total exposure as defined in Eq. ( 3), run on YT-100k (left) and YT-10k (right) with  = 5,  = 0.05, and  = U.For all but  = 0.5, Gamine outperforms MMS on all objectives, and MMS stops early because it can no longer reduce the maximum segregation.
answer is yes.First, the in-degree distributions of the YT graphs are an order of magnitude more skewed than those of the NF graphs (Appendix E.2.3, Fig. 15).This is unsurprising given the different origins of their edges (user interactions vs. cosine similarities), but it creates opportunities for high-impact rewirings involving highly prominent nodes in YT graphs (which Gamine seizes in practice, see below).Second, as depicted in Fig. 6, harmful and benign nodes are much more strongly interwoven in the NF data than in the YT data.This means that harmful content is less siloed in the NF graphs, but it also impedes strong reductions of the expected total exposure.Third, as a result of the two previous properties, the initial node exposures are much more concentrated in the NF graphs than in the YT graphs, as illustrated in Fig. 7, with a median sometimes twice as large as the median of the identically parametrized YT graphs, and a much higher average exposure (cf. ( ) / in Table 2).Finally, the relevance scores are much more skewed in the YT data than in the NF data (Appendix E.2.3, Fig. 16).Hence, while we are strongly constrained by  on the YT data even when considering only the 100 highest-ranked nodes as potential rewiring targets, we are almost unconstrained in the same setting on the NF data, which explains the comparative irrelevance of  on the NF data.Thus, the performance differences we observe between the NF data and the YT data are due to intrinsic dataset properties: REM and QREM are simply more complex on the news data than on the video data.6.2.5 General guidelines.Finally, we would like to abstract the findings from our experiments into general guidelines for reducing exposure to harm in recommendation graphs, especially under quality constraints.To this end, we analyze the metadata associated    with our rewirings.In particular, for each set of rewirings (, , ) obtained in our experiments, we are interested in the channel resp.news outlet classes involved, as well as in the distributions of cost triples (  ,   ,   ) and in-degree tuples ( − (),  − ( )).As exemplified in Fig. 8, while we consistently rewire edges from harmful to benign targets in the quality-unconstrained setting ( = 0.0), under strict quality control ( = 0.99), we frequently see rewirings from harmful to equally or more harmful targets.More generally, as illustrated in Fig. 9, the larger the threshold , the more we rewire among harmful, resp.benign, nodes (  =   =   = 1, resp.0)-which MMS does not even allow.Furthermore, the edges we rewire typically connect nodes with large in-degrees (Appendix F.5, Fig. 28).We conclude that a simplified strategy for reducing exposure to harm under quality constraints is to identify edges that connect high-cost nodes with large in-degrees, and rewire them to the node with the lowest exposure among all nodes meeting the quality constraints.

DISCUSSION AND CONCLUSION
We studied the problem of reducing the exposure to harmful content in recommendation graphs by edge rewiring.Modeling this exposure via absorbing random walks, we introduced QREM and REM as formalizations of the problem with and without quality constraints on recommendations.We proved that both problems are NP-hard and NP-hard to approximate to within an additive error, but that under mild assumptions, the greedy method provides a (1− 1 /)-approximation for the REM problem.Hence, we introduced Gamine, a greedy algorithm for REM and QREM running in linear time under realistic assumptions on the input, and we confirmed its effectiveness, robustness, and efficiency through extensive experiments on synthetic data as well as on real-world data from video recommendation and news feed applications.
Our work improves over the state of the art (MMS by Fabbri et al. [10]) in terms of performance, and it eliminates several limitations of prior work.While Fabbri et al. [10] model benign nodes as absorbing states and consider a brittle max-objective that is minimized even by highly harm-exposing recommendation graphs, we model benign nodes as transient states and consider a robust sum-objective that captures the overall consumption of harmful content by users starting at any node in the graph.Whereas MMS can only handle binary node labels, Gamine works with real-valued node attributes, which permits a more nuanced encoding of harmfulness.
We see potential for future work in several directions.For example, it would be interesting to adapt our objective to mitigate polarization, i.e., the separation of content with opposing views, with positions modeled as positive and negative node costs.Moreover, we currently assume that all nodes are equally likely as starting points of random walks, which is unrealistic in many applications.Finally, we observe that harm reduction in recommendation graphs has largely been studied in separation from harm reduction in other graphs representing consumption phenomena, such as user interaction graphs.A framework for optimizing functions under budget constraints that includes edge rewirings, insertions, and deletions could unify these research lines and facilitate future progress.

ETHICS STATEMENT
In this work, we introduce Gamine, a method to reduce the exposure to harm induced by recommendation algorithms on digital media platforms via edge rewiring, i.e., replacing certain recommendations by others.While removing harm-inducing recommendations constitutes a milder intervention than censoring content directly, it still steers attention away from certain content to other content, which, if pushed to the extreme, can have censorship-like effects.Although in its intended usage, Gamine primarily counteracts the tendency of recommendation algorithms to overexpose harmful content as similar to other harmful content, when fed with a contrived cost function, it could also be used to discriminate against content considered undesirable for problematic reasons (e.g., due to political biases or stereotypes against minorities).However, as the changes to recommendations suggested by Gamine could also be made by amending recommendation algorithms directly, the risk of intentional abuse is no greater than that inherent in the recommendation algorithms themselves, and unintentional abuse can be prevented by rigorous impact assessments and cost function audits before and during deployment.Thus, we are confident that overall, Gamine can contribute to the health of digital platforms.

APPENDIX
In addition to Table 3, included below, the written appendix to this work contains the following sections: A Omitted proofs B Other graph edits C Omitted pseudocode D Reproducibility information E Dataset information F Further experiments This appendix, along with the main paper, is available on arXiv and also deposited at the following DOI: 10.5281/zenodo.8002980.To facilitate reproducibility, all code, data, and results are made available at the following DOI: 10.5281/zenodo.7936816.

Theorem 3 .
If | | ≥ Λ + , then maximizing  Δ is equivalent to maximizing a monotone and submodular set function over    .
1 and 2 in Appendix C. Gamine solves REM in time O (Δ + ( +)) and QREM in time O (ℓ + ℎ).In realistic recommendation settings, the graph  is -outregular for  ∈ O (1), such that Δ + ∈ O (1) and  =  ∈ O ().Further, for QREM, we can expect that  is evaluable in time O (1), and that only the O (1) nodes most relevant for  will be considered as potential rewiring targets of any edge (, ), such that ℓ ∈ O (1) and ℎ ∈ O () = O ().As we can also safely work with a number of power iterations  ∈ O (1) (Appendix D.3), in realistic settings, Gamine solves both REM and QREM in time O (), which, for  ∈ O (1), is linear in the order of the input graph .

Figure 4 :
Figure4: Performance of Gamine and MMS when measured under  1 by the maximum segregation or the total segregation from Fabbri et al.[10], or by the total exposure as defined in Eq. (3), run on YT-100k (left) and YT-10k (right) with  = 5,  = 0.05, and  = U.For all but  = 0.5, Gamine outperforms MMS on all objectives, and MMS stops early because it can no longer reduce the maximum segregation.
Gamine and MMS on QREM

Figure 5 :
Figure 5: Scaling of Gamine and MMS under  1 with  = 0.05,  = U, and  = 0.0 (REM) resp.0.99 (QREM).We report the seconds  to compute a single rewiring as a function of  =  (MMS does not identify any rewirings on NF-Cov19 and NF-All).Gamine scales more favorably than MMS.

Figure 6 :
Figure 6: Fractions of edges running between news outlet resp.video channel categories for real-world graphs with  = 5, with marginals indicating the fraction of sources (right) resp.targets (top) in each category.News outlet categories are denoted as triples (veracity score, conspiracy-pseudoscience flag, questionable-source flag); for video channel categories, {left, right}-center is abbreviated as {left, right}-c; and label colors are coarse indicators of harm.In NF-All, harmful and benign nodes are more interconnected than in YT-10k.

Figure 7 :
Figure 7: Distributions of initial node exposures e  Fc in our real-world datasets, computed with  = 0.05.Note that cost functions sharing a name are defined differently for the YT and NF datasets (based on their semantics).The NF datasets generally exhibit more concentrated exposure distributions than the YT datasets and higher median exposures.