{'fraction_non_alphanumeric': 0.03393379104071783, 'fraction_numerical': 0.005805179797430494, 'mean_word_length': 4.181094597450166, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 26, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Anomaly Detection and Correction in Large Labeled Bipartite Graphs

Binary classification problems can be naturally modeled as bipartite graphs, where we attempt to classify right nodes based on their left adjacencies. We consider the case of labeled bipartite graphs in which some labels and edges are not trustworthy. Our goal is to reduce noise by identifying and fixing these labels and edges. We first propose a geometric technique for generating random graph instances with untrustworthy labels and analyze the resulting graph properties. We focus on generating graphs which reflect real-world data, where degree and label frequencies follow power law distributions. We review several algorithms for the problem of detection and correction, proposing novel extensions and making observations specific to the bipartite case. These algorithms range from math programming algorithms to discrete combinatorial algorithms to Bayesian approximation algorithms to machine learning algorithms. We compare the performance of all these algorithms using several metrics and, based on our observations, identify the relative strengths and weaknesses of each individual algorithm.

1 Problem Statement

Anomaly Detection Literature Background
The general problem of detecting anomalies in graphs has recieved wide interest. Several comprehensive surveys have been published, including Chandola, Banerjee, and Kumar [7], as well as Akoglu, Tong and Koutra [3]. Following the terminology of the latter, anomaly detection literature can be broken down by the type of graphs studied. The first distinction is between static and dynamic graphs. In our case, we deal with static graphs: graphs that do not evolve over time. The second distinction is between attributed and plain graphs. In our case, we are working on attributed graphs: in additional to structural properties of the graph, we care about its labels. The problem of unifying notions of similarity based on structure and context has received great attention and given rise to algorithms such as SimRank [19]. In many applications, the anomaly detection problem is a natural complement of clustering. Anomalies are nodes which are not well described by any clustering. Algorithms for anomaly detection can be inspired by or derived from clustering algorithms. We note these connections throughout our work. Anomaly detection on bipartite graphs is closely related to the problem of co-clustering, addressed in [12] and [6].
The specific case of anomaly detection on bipartite graphs is addressed, for example, by Sun et al [26], and by Dai et al [10]. Labeled bipartite graphs are recognized as a natural model for mutual reinforcement in a truth discovery context. Given a set of evidence and a set of conclusions, some of which conflict, a piece of evidence is considered more reliable if it supports many valid conclusions and a conclusion is considered more valid if it is supported by more reliable evidence. Examples of this structure appear in online information synthesis [33] and document summarization [34], as well as in data repair for inconsistent databases [1,4]. Additional cases which fit our bipartite model will be described in 1.4.
The present work differs from others in the literature in its emphasis on algorithms for correcting anomalous vertex labels, rather than merely detecting them.

Hypergraph Formulation
Let R be a collection of subsets of the universe U , also called a hypergraph on the vertex set U . For illustrating our construct, we give a sample application (for a long list of potential applications, see 1.4): DNA Mutations: In this application, U is a universe of DNA sequences of individuals; By examining sets of DNA sequences that share the same mutations, we would like to determine which genetic mutations correspond to which disease predispositions. Each element of R is the subset of U that represents DNA sequences which share a given genetic mutation.
Each element e ∈ U has a true color in the set of colors C. Call this color c(e), where c : U → C. This color is unobserved. In DNA Mutations, a color would represent having a specific disease predisposition. The color is considered unobserved because many of the individuals may not yet express the disease phenotype or it is difficult to diagnose. The individual's medical information may not be known or tested, at all.
Each set S ∈ R has a true colorc(S) ∈ C ∪ {℧}. Here ℧ represents a "wild" color (explained in 1.5). The true colorc(S) is unobserved. Instead, a coloringc(S) ∈ C is proposed to us for each S ∈ R. In DNA Mutations,c(S) means that a gene mutation causes a specific disease predisposition, and ℧ might stand for "uncategorized," meaning a genetic mutation which is not predictive of disease predisposition. Lab data gives us a prior belief about which genes are associated with which disease predispositions (c(S)).
In a conflict-free setting, each set consists only of elements which match its true color, and its true color matches its proposed color. That is, e ∈ S =⇒ c(e) =c(S) =c(S).
However, in our applications there are irregularities where this rule is violated. For example, in DNA Mutations there may be an error in testing where a disease predisposition is attributed to a mutation which is actually harmless. Given the collection of subsets R and their proposed colors,c(S) for each S ∈ R, we are attempting to detect the irregularities and, consequentially, the true colors of the subsets:c(S) for S ∈ R.

Graph Expression
The information in the set formulation can be translated to an equivalent graph formulation. We construct a bipartite graph G. With each element e ∈ U we associate a left node ℓ e . With each set S ∈ R we associate a right node r S . There is an edge from ℓ e to r S if e ∈ S. We can initialize the graph with a coloringc(S) on the right nodes.
In some applications, it will be useful to think of the graph slightly differently. Let G ′ be a graph constructed by adding a new node r ′ S for each right node r S in G and connecting r ′ S to r S . This creates |R| new nodes and edges. We call G ′ the Auxiliary graph. We can think of the r ′ S as observed nodes and the rest of the nodes as hidden. While we may change the colors of the r S , the colors of the r ′ S stay fixed.

Applications
This model has wide applications to contexts where classification is supported by shared evidence. We have already described the DNA Mutations application. In the following Words Sentences Topic We see a common structures emerging. Most right nodes can be assigned a single color. When a left node is associated with several right nodes, we can reasonably expect most of those right nodes to have the same color. Some right nodes may not fit well into any class and some left nodes may connect to right nodes across classes, but we expect the number of exceptions not to be too large (less than 20% of the graph, for example). Finally, in realistic data we may expect one set of nodes to have degrees following a power law distribution.

Types of Irregularities
There are three kinds of irregularities: • Wildness: This occurs when a right node (set) is a neighbor of random left nodes (elements). In our set theory notation,c(S) = ℧.
• Mislabelings: This occurs when the right node (set) does give consistent information but has been labeled with the wrong color. In our set theory notation, the proposed colorc(S) differs from the true colorc(S) = ℧.
• Misattribution: This occurs when a left node (element) has been identified with a right node (set) when it should not have been. In our set theory notation,c(S) = ℧, but c(e) =c(S) for some e ∈ S.
In this paper, we will consider all three types of irregularities and evalute the effectiveness of our algorithms in detecting individual irregularities and combinations thereof.

Graph Images
There are four images: 1. A clean graph with no anomalies (Figure 1).

Generating Random Instances
To generate our random graph instances, we would like to admit parameters such that the three types of irregularities appear in different predetermined proportions. We assign variables to these three parameters: • Let ω be the target fraction of wild nodes.
• Let λ be the target fraction of mislabeled nodes.
• Let α be the target fraction of misattributed edges.
x 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x 10 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x 10 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x 10 Figure 4: The Auxiliary Bipartite Graph We will introduce three models: the sequential model, the circle model, and the circle model with power law degree distributions. The latter two models attempt to emulate the "geometric" nature of real graphs: nodes are more likely to form new connections with the neighbors of their neighbors than with distant nodes in the graph. The third model attempts to emulate the tendency of real graphs to have a few nodes of very high degree and many nodes of small degree. The structure of real-world graphs is studied extensively in [8]. In [13], circle models are used for graph visualization. It is natural to extend the idea to graph generation.

The Sequential Model
As the name suggests, in the sequential model we start with a conflict-free graph (with no irregularities) and introduce the irregularities sequentially. We start with this model since it gives us an intuitive sense of which order to introduce the irregularities. This intuition will carry over to later models. For the sequential model, we proceed as follows: 1. Generate d disconnected, random bipartite graphs on vertex sets where d is the number of colors. There are many known algorithms for this task. Label the right nodes R i in bipartite graph i with color c i , where all the {c i } are distinct. Declare the disjoint union L := 1≤i≤d L i to be the set of left nodes.
2. Introduce a set R 0 of wild nodes such that the total fraction of wild nodes is ω. Connect these nodes to random left nodes in L. The set of right nodes is R := 0≤i≤d R i .
3. For each edge in the graph, with probability α delete the edge and replace it with a new edge incident to the same right node and a random left node.
4. For each right node in the graph, with probability λ randomly assign the label of the node to a new color.
The key benefit of this model is that it allows us to control precisely each parameter. The downside is that it ignores the geometric nature of the problem and the substructure we would expect on the bipartite subgraphs. We expect these instances to be relatively easy to solve since their irregularities are random and not structured as they will be in the circle model.

The Circle Model
The circle model attempts to emulate geometric graph constructions by placing the nodes on a circle, and determining connectivity as a function of physical proximity.
To create a graph with C colors, first create a circle Q of circumference C. Place two sets of points along Q according to a predetermined probability distribution (typically uniform) to represent right and left nodes. These two distributions can be independent or dependent, as desired. The circle Q can be naturally divided into C segments and the location of each node determines its true color. We go through the right nodes and, with probability λ, give them a random color label instead of their true color label.
For each fixed right node r ∈ R, select randomly from the set of left nodes L a neighbourhood Γ L (r) for r as follows. With probability ω our selection is uniformly random. With probability 1 − ω it is biased towards nodes that are nearby; to achieve this, a node at a distance δ is selected with probability proportional to some non-increasing function of distance f (δ). Reasonable choices for f include an exponential decay function, a step function, or a threshold function (f (δ) = 1 {δ<δ} ). The upside of using a threshold is that it can speed up computation by limiting the number of left nodes examined.
Note that we did not explicitly incorporate α into our model. The number of misattributed edges will depend on the slope of f . The only way to express it precisely would be with a double integral over the circle, which may be difficult to calculate efficiently. If we want α small, then we should choose an f which decreases quickly so that right nodes will be biased towards nearby left nodes. On the other hand, if we want α large, then we should choose an f which decreases slowly so that faraway left nodes sill have a chance of being included in the neighborhood of right nodes.
The key benefit of this model is that it constructs difficult instances where the irregularities, especially the misattributions, arise from an underlying physical process. This means that a right node with misattributions is likely to have several misattributions of the same type. It is also likely to be near other right nodes with similar misattributions. Wild nodes can be thought of as nodes in the center of the circle, equidistant from all the left nodes. The downsides of this model are that the construction is slow (since we examine all pairs of right and left nodes) and it does not allow us to control α explicitly.

Circle Model with Power Law Distribution for Colors and Right Vertex Degrees
In some applications of interest, the color distribution of right nodes may have heavy tails, such as those given by Zipf's Law. Furthermore, while the degree distribution of left nodes is approximately Poisson, the degree distribution of right nodes may also have heavy tails. We will modify the Circle Model to better reflect these power law distributions.
Our first modification is to distribute the colors according to a preferential attachment model. We place the nodes sequentially. When deciding on the color of a node k, we consider the existing color distribution. The probability of giving node k the color c j is directly proportional to where χ is a small constant. For example, consider the case where χ = 0.25 and there are 40 colors. The first node is given a color uniformly at random. The second node now has probability 1+0. 25 1+40·0.25 of getting assigned the same color as the first. Once we have decided on the color of a node, we give it a location uniformly at random on the circle within the region of that color. Note that in this preferential attachment model, the order in which nodes are selected does not affect the final distribution. For convenience, we place all the right nodes, then the left nodes. It can be shown that the probability a color is not represented by any node tends to 0 as the number of nodes tends to infinity.
Next, we decide on the neighbors of nodes similar to the Circle Model. In this case, we proceed in two steps. First, for each left node we select a small constant number of neighbors (ex. one or two). Next, for each right node we sample from a heavy tail distribution Z, such that p(Z > z) = 1 z , and give the right node that many neighbors. If the right node is wild and was assigned an edge in the first step, we randomly reassign that edge. Note that both steps are necessary. If we do not first select two neighbors of each left node, then many left nodes will end up without neighbors. If we do not reassign edges that linked to wilds in the first step, then our wild nodes will end up being bias towards linking to the same color, making them not really wild. The random assignments, themselves, takes place according to the same f as in the basic Circle Model.

Difficulty Metrics
In a graph where we are given the true labels, we can easily calculate ω, λ, and α. We would like to develop some metrics to measure the difficulty of test instances where these parameters are unknown. A few graph metrics of interest: 1. The color distribution of the right nodes. Generally, if the number of nodes per color follows a multinomial(|R|, (1/d, 1/d, . . . , 1/d)) distribution, the problem will be easier to resolve than when the graph has a very asymmetric color distribution.
2. The degree distribution of the left and right nodes. This includes the average degree and the maximum degree. Generally, the problem becomes more difficult as the average degree of nodes decreases and as the distribution of degrees becomes less uniform. In realistic applications, the distribution of right node degrees may follow a power law.
3. The component distribution of the whole bipartite graph. Without additional a-priori assumptions, it is not possible to infer information between connected components. In realistic applications, the graphs tend to consist of a large connected component with a majority of the nodes and a few small, disconnected components.
4. Average color degree of left nodes. That is, the average number of colors observed by a left node in its neighbors. Formally, the number of colors adjacent to ℓ is the cardinality of the set The larger this value, the more disagreement exists in the initial graph coloring.
5. The number of 2-step paths starting and ending at the same color. This gives us a sense of the SNR (Signal-to-Noise Ratio), since bichromatic paths are the "noise" we are trying to eliminate. In graph theory terms, this gives a sense of the amount of connectedness between what should be disconnected color components.
In a graph where the values of ω, λ, and α are known, we can estimate the SNR as: Note that this is a lower bound since it esimates the percentage of the time that a 2-step path will step between two tame, correctly labeled nodes along properly attributed edges. In reality, the number of monochromatic 2-step paths will be larger since there are cases where it could include paths between wild nodes or mislabeled nodes along misattributed edges.

Sample Instances
The following table gives a rough sense of what our metrics look like on graphs of different sizes generated by different methods. It gives the average and maximum of the left and right vertex degree, and the SNR as defined above. We make a few observations. First, the degrees of the left nodes are relatively small. On the right, the power law distribution gives us large maximum degrees without varying the average sigificantly. More importantly, making the circle graph larger improves SNR. In the power law graph, the SNR decreases as the graph grows. A graph with SNR ≈ 0.9 would be considered an easy problem instance, while an SNR ≈ 0.4 would be considered a difficult problem instance. A graph with SNR ≈ 0.6 would be considered a medium difficulty instance.

Algorithms Overview
Before exploring our algorithms in detail, we give a chart summarizing their properties. The properties are: • Global Objective: Does the algorithm optimize a well-defined global objective function (usually by local computation)?
• Message Passing: Can the algorithm be implemented in a message-passing context? A message-passing algorithm is one in which each node only knows its state and its neighbors. At each iteration, it sends a message based on its state and updates its state based on the messages it recieves.
• Message Size: Message-passing algorithms could either send a message which is a single color or a vector of probabilities for each color.
• Termination Optimal: Does the final result necessarily optimize the global objective?
• Output Class: The final output of the algorithm could be either a single color judgement for each node or a vector of probabilities for each color.
•  [28]. We choose to investigate Semi-Definite Programming for two reasons. First, because the dot product is a reasonable measure of agreement between two probability distributions. Semi-definite programming is well suited to dealing with dot products in objective functions and constraints. Second, we are inspired by the application of semi-definite programming to approximating the maximum cut problem, where agreement between nodes is naturally modeled with a vector dot product [15].

Objective Function
If we have d colors, let r k = (r k 1 , . . . , r k d ), with i r k i = 1, be a d-dimentional vector of probabilities, where r k i is the probability that right node v k has color i. We define ℓ j similarly for left node u j ∈ L. We encode the initial coloring of the right node v k in the vector h k , which is the standard basis vector of R d corresponding to the initial color.
Our SDP programming formulation objective will have two terms: the separation and deviation terms. The separation term rewards agreement between adjacent right nodes and left nodes. The deviation term rewards agreement between right nodes and their initial colorings. We are ultimately attempting to strike a balance between honoring our prior beliefs and maximizing agreement. We write the objective function: where E refers to the edge set of the bipartite graph, subject to The term on the right is the separation term and the term on the left is the deviation term. The meta-parameters τ k represent the strength of the prior at a node and are used to balance the relative importance of the two terms. The larger the value of τ k , the more importance is given to our prior on a node. If all the τ k are too small, then it becomes optimal to set all the ℓ j and r k equal. If the τ k are too large then we end up assigning every right node to its prior.

Algorithm
It turns out that the objective above can be interatively increased by a simple hill-climbing algorithm based on majority votes. The algorithm terminates in a finite number of iterations. We describe the algorithm and give a proof of termination. A key lemma: Proof. We inspect the objective function (1). If we fix the right nodes, we can rewrite the objective function (at least, the part not already fixed) as a linear map If we fix the left nodes, we can rewrite the objective function as a linear map In both cases, we can separate the outer sum and optimize over the individual ℓ j or r j , subject to the linear constraints. Furthermore, if the optimal solution for some ℓ j or r j has fractional entries, then by linearity there is necessarily a solution of the form ℓ j = e i or r j = e i for some i.
Note that we did not require the h k to be integral for our proof to work. The lemma will hold even if we introduce fractional priors.
Formally, the voting algorithm is as follows: for each u j ∈ L, consider Γ R (u j ). Set ℓ j equal to e i where i maximizes For all v k ∈ R, consider Γ L (v k ). Set r k equal to e i where i maximizes Continue this procedure until the objective function is no longer improving.
Intuitively, at each step we take the "majority vote" of the colors of the neighbors of a node. If we are at a right node, then the prior also gets τ k votes.
As a direct consequence of the previous lemma, the objective improves at each step in the voting algorithm. Furthermore, the objective is always an integer. Since the objective has a natural upper bound, this is sufficent to prove termination (though not necessarily optimality).

Parameters/Wildness
We have not yet determined any rigorous criterion for selecting τ k . Recall that at each step the node v k ∈ R sees a number of votes equal to its degree. It is reasonable to consider values for τ k which depend on that degree. In particular, we suggest setting τ k to 0.25 times the degree of r k .
We suggest an ad hoc approach for determining if a node is wild in the voting algorithm. If at any stage the plurality vote accounts for less than half of all votes (i.e. a majority), then we set the node to wild instead of to the plurality color. Once a node is marked as wild, it does not get to vote on its neighbors. The threshold of one half is arbitrary.

Summary
While the Voting Algorithm appears relatively naive, its presence here illustrates that it iteratively increases a fairly natural, rigorously-defined objective arising from the problem. And it does so by passing small messages. It should not be discounted for its simplicity.
6 Quadratic Model and Gradient Descent Formulation

Background
For large optimization problems in which finding an exact optimal may be difficult, gradient descent is a frequent method of choice [5]. In our case, we would like to state and optimize a simple linear best-fit objective with constrained variables. Our objective is convex. We will show that, in our bipartite setting, gradient descent can be easily paralellized and implemented in a message-passing algorithm. This addresses the well-known challenge of parallelization in gradient descent (and stochastic gradient descent) [25].

Objective Function
First consider the binary version of the problem in which there are two colors, black and white. . The probability a left vertex u i is colored black is x i , where 0 ≤ x i ≤ 1. The prior on a right vertex v j is y j ∈ {0, 1}, where y j = 1 means that right vertex v j was initially assigned color black. We will attempt to minimize the total of a loss function that we will calculate at each right node. The loss function on each right node v j will assign a quadratic penalty to deviation from its prior. Formally, the loss at v j will be where d j is the degree of node v j . Alternatively the effect of the priors could be made weaker by setting y j ∈ {0, ρ} for ρ < 1. This is a constrained least squares minimization of the form: choose where Y := (y j ), and U := (u j,i ), with u j,i := 1 {u i ∼v j } d −1 j ; in other words, U is the adjacency matrix, rescaled by dividing by right vertex degrees.
Without the linear constraint there would be an explicit minimizer X = (U T U ) −1 U T Y. The linear constraint that each x i ∈ [0, 1] makes this a convex quadratic programming problem. Exact methods have complexity at least O(|R| · |E|), where |E| = i,j 1 {u i ∼v j } is the edge count, because this is the cost of the unconstrained problem. This is too expensive for big graph applications. We present an approximate O(|E|) message passing algorithm.

Message Passing
Differentiate (3) with respect to X to obtain the matrix of partial derivatives: Split this derivative into a sum. The first summand, the map X T → 2X T (U T U ), has an effect at left vertex u j which is the sum over all two-step paths from left vertex u i to u j of the value x i , divided by the square of the degree of the intermediate right node. The first summand has the effect of propagating the current labelling of left vertices which share a neighbor with u j . On the other hand the second summand −2Y T U is pulling the value x j at u j back towards the prior at each of the neighboring right vertices, with a strength inversely proportional to the degree of that right neighbor.
Message Passing Interpretation: The gradient at left node u i can be computed by summing, across its right neighbors v j , the values We can calculate this value at each v j and then pass along the message to the adjacent left nodes. If the increment to x i places the new value outside [0, 1], in the black and white version we round to the nearer of 0 and 1. After the left nodes update their value, they can pass their value back along to the right nodes in the next iteration.

Convergence
Like every quadratic programming problem with linear inequality constraints, this is a convex optimization problem. Every iteration of the message passing algorithm (4) pushes the objective function (3) towards the unique global optimum.

Renormalized Multicolor Version
The rule (4) constructs a message for a single color. Assume there are at least 3 colors. Separate messages may be constructed for each color. After a left node u i receives a message for each color k, a value of x k i is updated. In the renormalized version of the algorithm, set negative values to zero, and then divide each x k i by k x k i to obtain a probability distribution across colors at node u i .

Parameters/Wildness
In the multicolor version without renormalization, our x i are determined separately for each color. In the renomalized multicolor version, the output is a probability distribution across colors for each node. In either case, we have two options. We could examine the total loss (2) at each right node. Nodes with larger loss are more likely to be wild or mislabeled. Alternatively, we could set a threshold τ and color nodes if their largest x i is over τ , leaving the rest wild. The benefit of this gradient algorithm is that its plain version, without ρ j , does not involve any arbitrary choices of parameters before label judgement. We mentioned the possibility of setting a parameter ρ j . As in the other algorithms, the closer this term is to 1, the stronger the prior.

Summary
In this section, we have essentially applied a linear best-fit model to our problem of interest. We have shown that the model, despite being constrained, can be optimized with gradient descent on our bipartite graph.

Background
Purely combinatorial algorithms have some advantages over statistical approximation algorithms: they do not depend on several parameters for accuracy and convergence. They are also easier to prove valid in theory. Unfortunately, many combinatorial optimization problems are intractable on large graphs. Attempts have been make to apply tractable combinatorial problems to clustering [31] and multi-way partitioning [22]. Darling et al. [11] embed such problems in a general combinatorial data fusion framework.
Recent work has shown that the multi-way partitioning problem can be solved in polynomial time on special graphs [30] and that a tailored branch-and-bound algorithm can solve instances with tens of thousands of nodes in just seconds [29].
The model we will use in this section is a special case of what is sometimes called the "minimum sexcess" problem (terminology in [18]), which in turn is a relaxation of the "minimum closure" problem.

Objective Function
Consider first a binary coloring problem (color c or not c). Associate a binary indicator variable x i with each node i (both left and right) of our bipartite graph G. Ultimately, x i = 1 if node i should be colored c and x i = 0 otherwise. Let R c be the set of right nodes initially labeled c. Given penalty parameters π 0 i and π 1 i , we would like to minimize the following objective: If we change x i from its prior, namely x i := 1 {i∈Rc} , then we pay a penalty. In the case of the nodes in R c , this means changing them to 0 and paying penalty π 0 i . In the case of the right nodes not in R c , this means changing them to 1 and paying penalty π 1 i . In the case of the left nodes, there is no prior so no penalty is paid either way. We pay a unit penalty if two adjacent nodes disagree with each other.

Algorithm
Consider the following construction: Take the graph G and add a source and sink node, s and t respectively. Draw an edge from s to every r ∈ R c with weight π 0 i . Draw an edge from every r ∈ R \ R c to t with weight π 1 i . Call this graph G s,t .
Given a cut in G s,t , let vertex sets S and T be components containing the source and sink nodes, respectively. We can calculate the price of this cut in G s,t as follows: 1. If any node r ∈ R c is in the sink set T , we must have paid a penalty of π 0 i to cut the edge from s to i.
2. By similar logic, we must have paid a penalty of π 1 i for any node r ∈ R \ R C in the source set S.
3. We paid a price of 1 for every other edge that was originally in G and was cut between S and T .
The price of the cut is evidently the same as the value of the objective function above when x i = 1 for i ∈ S\{s} and x i = 0 for i ∈ T \{t}. Thus, the minimum cut in G s,t gives us the optimal solution to the problem where the only color choices are c or not c.

Parameters/Wildness
What is the effect of the value of the penalties π 0 i and π 1 i ? The larger π 0 i , the more importance we give to priors (the harder it is to disregard the prior). The larger π 1 i , the more difficult it is to relabel a node to a new color. If π 0 i is too large, then we necessarily accept the priors. If π 1 i is too large, then we never assign new values to nodes. If π 0 i or π 1 i is too small, then we either assign 0 to all the nodes and pay a penalty of i∈Rc π 0 i , or else we either assign 1 to all the nodes and pay a penalty of i∈R\Rc π 1 i , whichever is cheaper.
Experimentally, the best results seem to be obtained when π 0 i is slightly larger than π 1 i . To gain some intuition for why π 0 i = π 1 i does not produce optimal results, consider the case of just two colors. By symmetry, the two cuts (one for each color) would be compliments of each other. This means that we would be unable to detect wildness. If π 0 i = π 1 i , then certain nodes "on the edge" will be assigned 0 or 2 colors, making it possible to detect wilds. With this in mind, we propose as a heuristic that π 0 i be set to three quarters the degree of i and π 1 i be set to half the degree of i. We can run this algorithm once for each color and consolidate the results. Most nodes will be in the source set for just one of the d cuts. These nodes are assigned to that color, often their initial color. The remaining nodes are either in zero source sets or more than one source sets. We label these nodes as wild. The ones in zero source sets we can think of as "true" wilds, while the ones in multiple source sets are potentially polychromatic border nodes.

Summary
It is rare that a large-scale data mining problem can be solved with a simple combinatorial algorithm. In this case, we have shown that our problem of interest admits an intutive minimum cut formulation. Being purely combinatorial, it does not require us to specify a termination condition or desired degree of accuracy for convergence.

Background
Our "Naive Bayesian" formulation is motivated by Naive Bayes classification. In general Naive Bayes classification, a parameter is estimated to be in one of several classes based on evidence. Its posterior probability of being a member of each class is calculated and then it is assigned to the class in which it has the highest probability. In this algorithm, we successively apply Naive Bayes classification to one set of nodes based on the other. We do not extract a final classification from the probability distribution until the end.
The procedure of iteratively performing Bayesian updates in a graph context is very well studied and termed Belief Propagation [32]. Technically, we are working in a Markov Random Field since our graph contains cycles, but in practice we are iteratively updating one set of nodes in terms of the other (left or right), so we could think of our graph as the union of two Bayesian Networks. There is extensive literature covering Belief Propagation in Bayesian networks, including foundational complexity results [9] and several books [23,20].

Motivation
Consider a single left or right node v. In order to accept color c as valid for node v, consider its neighbors v ′ . One of three properties must hold: 3. v ′ is neither c or ℧, but the edge {v, v ′ } is a misattribution.

Bayes Formula Under Conditional Independence Approximation
Let χ : L∪R → C∪{℧} denote a coloring of all nodes, which ideally would coincide with c : R → C∪{℧} on the right nodes, and withc : L → C ∪ {℧} on the left nodes. In the Bayesian belief-propagation scheme, this unknown map χ is treated as random, and so we can make statements about the joint distribution of neighboring colors {χ(w), w ∈ Γ(v)}, for a node v, and about the conditional distribution of χ(v), given {χ(w), w ∈ Γ(v)}. Our model for the probability distribution of χ starts with the assumption that ideally edges should exist only between right and left nodes of the same color, then successively introduces the types of errors and adjusts our scheme to compensate.
The probability v has color i, given the colors of its neighbors, can be written using Bayes' formula. Here I w ⊂ C denotes some set of colors, for each node w.
In the following subsections we introduce and progressively update our scheme for determining the conditional distribution of {χ(w), w ∈ Γ(v)}, given χ(v). If our assumption is that adjacent nodes must have the same color, without exception, then our update term becomes We use the conditional independence approximation to the probability of a monochromatic neighborhood: To illustrate why this is reasonable, consider a node v and its neighbors w ∈ Γ(v). We assume that if v is colored red then all of its neighbors w must be red. The color allocations of these right neighbors are treated as conditionally independent, given the color of v. Therefore the probability that w j is red for all w j ∈ Γ(v) equals the product over j of the probability that each individual w j is red.

Including Wildness in the Bayesian Formulation
The next step in the Bayesian algorithm is to account for the probability that a node is assigned the wild color ℧. First assign a color prior (π 0 , π 1 , . . . , π d ), where π 0 is the proportion ω of wild color vertices, and for i ≥ 1, π i is the proportion of vertices whose true color is i.
for any values i w ∈ {0, 1, 2, . . . , d}. Take p w i := P (χ(w) = i) for i ≥ 1, and p w 0 := P (χ(w) = ℧), so the probability vector (p w 0 , p w 1 , . . . , p w d ) encodes the law of χ(w) for w ∈ Γ(v). Under the conditional independence approximation, the conditional probability that v is wild, given the law of χ(w) for w ∈ Γ(v), is given by: Proof. The first assertion restates the definition of a wild color vertex, namely one that gives no information about the color of its neighbors. The second assertion follows from Bayes rule, from the conditional independence approximation, and from the first assertion, because when the product of sums is multiplied out, each assignment of colors to the elements of Γ(v)} receives a weight given by (8).

Including Misattribution in the Bayesian Formulation
Our final improvement to the Bayes probability distribution is to incorporate a small probability that an uninformative edge exists between otherwise correctly labeled nodes. This is intended to reflect the possibility of misattribution in the graph. Assume that the misattribution rate is α. Consider any edge e := {v, w}, and let E * ⊂ E denote the set of uninformative edges leading to misattribution. Fix any color i. In the following inclusion-exclusion calculation, two terms are omitted because {χ(w) = i} ∩ {χ(w) = ℧} = ∅.
Abbreviate the conditional probability P (· | χ(v) = i) to P i (·). When we condition on the event {χ(v) = i}, the conditional independence approximation may be combined with the last identity to The full generalization of the update term in Bayes' formula (6) includes the possibility that some w ∈ Γ(v) may be wild, and some edges {v, w} may be misattributed. Continuing to write P (· | χ(v) = i) as P i (·), the joint law of {χ(w), w ∈ Γ(v)} is expressed in a generalized form of the right side of (7) as:

Parameters
Our algorithm requires an estimate for the misattribution rate α. It would be unrealistic to use the same α that we used in constructing the graph, since that will be unknown in a general graph problem. Thus, we need to create a model for α. Overestimating the true α will make our probability updates less confident than they should be. Underestimating the true α will make our probability updates too confident. Since we would rather be in the former case, we can model α by assuming that all the noise in the graph (SNR) comes from misattribution. In that case, we have SNR ≈ (1 − α) 2 , so our over-estimate for the true α will be 1 − √ SNR. If we are given values for other types of error, we could derive a more accurate α from the SNR. We acknowledge that it is possible to create a model where the α are edge-specific, but it would be difficult to balance parameters such that we could distinguish wild nodes from nodes with all neighbors misattributed. We prefer to focus on message-passing algorithms in which the nodes are impartial to the sources of their messages.
Aside from α, we must define initial priors for the labels on the nodes. On the left nodes, we set these priors uniform. On the right nodes, we have three values to consider: the prior on the given label, the prior on wildness, and the prior on not matching the label. We decide to set these approximately equal, with the prior on wildness slightly discounted and the prior on not maching the label distributed uniformly accross the other labels. This prior might be further improved by weighting each color by its frequency in the graph at large.

Summary
The Naive Bayesian algorithm creates iterative updates of our belief about the left nodes given the right nodes, and vice versa. The update scheme follows naturally from the interaction of different sorts of errors, from a local conditional independence assumption, and from applying Bayes' Rule. Out of all our algorithms, the Naive Bayesian algorithm models the problem most directly: we assign probabilities to certain existing structures and consider the natural probabalistic consequences according to Bayes' Rule.

Classical Background
In classical analysis, the Dirichlet problem seeks to extend a real-valued continuous function f , defined on the boundary ∂B of a bounded closed subset B of R d , to a harmonic f on the interior of B. Harmonic means that ∆f = 0, where ∆ is the Laplace operator. The probabilistic solution consists in starting a Brownian motion (X t ) t≥0 at an arbitrary x ∈ B, and stopping it at the first exit time τ from B. The expected value of f (X τ ) is well defined because X τ ∈ ∂B; it agrees with f (x) when x ∈ ∂B, and is a harmonic function of the starting point x, so it solves the Dirichlet problem.

Random Walk on Graphs
The construction extends from the case of Brownian motion on R d to that of random walks on graphs, as described by Lovasz [24]; here the role of the Laplace second order differential operator is replaced by the Laplacian matrix L = D − A, where rows and columns are indexed by graph vertices, D is the diagonal matrix of vertex degrees, and A is the graph adjacency matrix.
More generally, suppose G = (V, E, (w i,j ) {i,j}∈E} ) is an edge weighted graph, with all edge weights w i,j > 0. Redefine D and A so that This corresponds to a random walk (X t ) t=0,1,... on the vertex set V , where transition probabilities from vertex v to its neighboring vertices are determined by the normalized weights of edges incident to v.
A real-valued vector f indexed by the vertices of the graph is called harmonic if Lf = 0 at every vertex, which is the same as saying that the value of f at vertex v is the edge-weighted average of its value at adjacent vertices. For n ≥ 2, define f : V → R n to be harmonic if every component is harmonic.

Constructing Harmonic Functions on Graphs
Suppose the vertex set V of a finite connected weighted graph is partitioned into V 0 ∪ V 1 . Consider V 0 = ∅ as a boundary, on which a function g : V 0 → R n is defined. We imitate in (11) below the solution of the Dirichlet problem to construct a harmonic function f : V → R n which agrees with g on V 0 . Lemma 9.1. Let G = (V, E, (w i,j ) {i,j}∈E ) be a finite connected weighted graph. Partition the vertex set V as V 0 ∪ V 1 . Given a function g : V 0 → R n whose components (g 1 (u), . . . , g n (u)) are non-negative, and sum to 1 at each u ∈ V 0 , there is a unique function f : V → R n , all of whose components are harmonic, such that f |V 0 = g. Furthermore: 1. The components (f 1 (u), . . . , f n (u)) are non-negative and sum to 1 at every u ∈ V .

The energy E(f ) is minimum among all functions which agree with
Proof. Since G is finite and connected, random walk on V is positive recurrent. Consider the random walk (X t ) t=0,1,... , stopped at the first step τ when it reaches a vertex in V 0 . By positive recurrence, τ is finite with probability 1, and τ = 0 when the random walk starts in V 0 . Hence g(X τ ) is a well defined random variable. For any vertex u ∈ V , define This definition transfers from g to f the non-negativity of each component, and the fact that the components sum to 1. By conditioning on the value of X 1 , and invoking the Markov property, we see that for every component f j Therefore Df j − Af j = 0 for every component j, and f j agrees with g j on V 0 . So f is harmonic.
Uniqueness of the solution to (D − A)f = 0, f |V 0 = g, follows from linear algebra. It remains to check that f is energy-minimizing. Consider a perturbation f + h for h : V → R with h |V 0 = 0. A routine computation shows that Therefore the derivative ∇f (h) is given by Since Lf (i) = 0 for i ∈ V 1 , the right side must be zero for all perturbations f + h with h |V 0 = 0. Hence f has minimum or maximum energy. A second derivative analysis shows the energy is minimum.

Symmetrization
As Markov processes, Brownian motion on R d and harmonic function on a weighted graph differ in that the transition function for the former is symmetric (the rate of transition from x to y in time t is the same as from y to x), whereas for the latter it is typically asymmetric. For example, if adjacent vertices v, v ′ have degrees d, d ′ with d < d ′ , then the unweighted transition from v to v ′ in one step occurs with probability 1/d, while the transition from v ′ to v in one step occurs with probability 1/d ′ < 1/d.

Harmonic Functions For Label Propagation
If we have d colors, we are concerned with functions from the vertices of the auxiliary graph G ′ (see 1.3) to R d . The auxiliary nodes will play the role of the boundary V 0 in Lemma 9.1. The value of the function at right node v k will be expressed by a d-dimensional vector of probabilities r k = (r k 1 , . . . , r k d ), where r k i is the probability that v k has color i. Naturally, i r k i = 1. We define ℓ j similarly for u j ∈ L. We encode the initial coloring of v k by tagging the auxiliary node w k ∼ v k with a vector h k which equals basis vector e i in the case where color i is initially assigned to right vertex v k . The energy (10) takes the form To minimize this energy means to find the best compromise between (a) agreement in color vectors of adjacent left and right nodes, and (b) agreement between color vectors of right nodes and their initial colorings. The penalty parameter θ > 0 defines the relative weight of (b) versus (a). Lemma 9.1 asserts that a function on L ∪ R which minimizes this energy, given the boundary conditions on the auxiliary nodes, is harmonic on L ∪ R in each component, with respect to a weighting on the edges determined by θ. This weighting is most easily expressed in terms of the followng transition probabilities for the random walk.

Random Walk Transition Probabilities
We consider a transient random walk on the auxiliary graph G ′ (see 1.3) defined as follows: • The auxiliary nodes are the absorbing states.
• When we are at a right node, we move to its adjacent auxiliary node with probability p = θ/(1+θ).
With probability 1 − p, we move to a left neighbor picked uniformly at random.
• When we are at a left node, we move to a right neighbor picked uniformly at random.
For node v i , let the probabilities of absorption at an auxuiliary node with color j for a walk starting at v i be ϕ i (j). Then v i → (ϕ i (1), . . . , ϕ i (d)) is the unique harmonic function described in Lemma 9.1, and minimizes the energy (12). The j for which ϕ i (j) is maximum will be called a maximum likelihood color.

Message-Passing Algorithm for Harmonic Function
A harmonic function on a graph may be computed exactly by linear algebra techniques, whose work scales according to |V |·|E|. Instead we opt for a message-passing approximation which scales according to |E| and can be easily parallelized. We state the harmonic function algorithm in terms of quantities ϕ  i (j) is the probability that a random walk starting at v i will be absorbed at an auxiliary vertex with color j after at most k steps, and converges from below to ϕ i (j) as n → ∞. This convergence occurs exponentially fast, in the sense that Proof. The assertion about ϕ (n) i (j) is true when n = 0, because the right and left vertices are not absorbing. It holds for all n follows by induction using the Markov property and the transition probabilities for the random walk.
Let τ denote the first n for which the random walk X n , started at a left vertex v i , is absorbed at an auxiliary vertex. Then τ ∈ {2, 4, 6, . . .}, and P (τ = 2n) = p(1 − p) n by the renewal property of Markov chains. Let F j denote the event that final absorption of the random walk occurs in an auxiliary vertex of color j. Then The first summand on the right is d j=1 ϕ (2n) i (j), and the second is P (τ /2 ≥ n + 1) = (1 − p) n+1 . This holds for every j = 1, 2, . . . , d, which implies the inequality in the case where v i is a left vertex. The case of a right vertex is similar, except τ takes odd integer values and P ((τ − 1)/2 ≥ n) = (1 − p) n .

Wildness via Jensen-Shannon Divergence
Once we have a reasonable approximation to ϕ i (j) for a given i for all j, we would like to know whether to give the node i its maximum liklihood color or classify it as wild. For this, we introduce the Jensen-Shannon Divergence (JSD), a symmetrized version of the Kullback-Leibler (KL) divergence which is a distance metric for probability distributions. For two probability distributions P and Q, we define where D is the Kullback-Leibler divergence and M = 1 2 (P + Q). When the base of the logarithm in the KL divergence is 2, the Jensen-Shannon Divergence gives a value between 0 and 1. If we let P i be the distribution (ϕ i (j)) 1≤j≤d over colors and Q be the probability distribution over colors of labels in the graph, then JSD(P i ||Q) is close to 1 when node i is normal, and close to zero when it is wild. For if P i = Q, then the probability that node i is color j equals the probability that a random node is color j: JSD(P i ||Q) = 0 and we believe i is wild. On the other hand, if ϕ i (j) ≈ 1 and j is a rare color in the graph:JSD(P i ||Q) ≈ 1 and we are confident that i is normal. We set a parameter τ . If the JSD exceeds τ , we give the node its maximum liklihood label. Otherwise, we give it a wild label.

Metaparameter Settings
The value of p affects the expected length of the random walk independent of graph structure. The number of visits to right nodes before absorption has a Geometric distribution, the same as the number of Bernoulli(p) trials needed for the first success. Hence its expected value is 1 p . The probability that the random walk makes at least n + 1 visits to right nodes (2n steps) is (1 − p) n . The larger p, the more strength we give to our prior. The smaller p, the more diffusion we allow. Experimentally, p = 1 12 appeared to be a good setting. This was approximately the reciprocal of the mean vertex degree.
Finally, our setting for τ is entirely experimental. If τ is small then we are likely to classify some wilds as a color. If τ is too large, then we are likely to assign too many wild labels.

Similarity to Semidefinite Programming Formulation
Compare the objective function (1) for the SDP formulation with the energy function (12) which our harmonic function minimizes. The same cross product terms ℓ j · r k and h k · r k appear in both. Also the vectors ℓ j and r k are constrained to be probability vectors in both cases. The difference is that terms of the form ℓ j · ℓ j and r k · r k appear in (12), but not in (1). Thus the harmonic function also seeks probability vectors with smaller sums of squares, meaning that they are closer to uniform.
From what we have seen so far, this makes sense: the SDP solution above could be made to have mostly integer entries by a linearity argument. The same is not true of the harmonic function.

Summary
Random walks on graphs are extremely well studied, as they form the basis of many practical graph algorithms for large-scale clustering, detection, and labeling. In our problem instance, our key observation is understanding how to describe the harmonic function in terms of an appropriate auxiliary graph. On a bipartite graph, we demonstrate exponentially fast convergence, without resorting to spectral methods, from a message-passing algorithm which scales better than linear algebra methods.

Background
In the Naive Bayes formulation, each vertex was assumed to carry a single unknown color, about which our beliefs were updated. Motivated by the literature in Monte Carlo methods, Expectation-Maximization, and Variational Bayesian methods [21], we now investigate probabilistic models where each vertex carries a multinomial distribution across the d colors, and message-passing updates the parameters of these multinomial distributions. We attempt to combine ideas used in the Naive Bayesian and Harmonic Function models.

Multinomial Distribution
Recall the use of the Dirichlet(α 1 , α 2 , . . . , α d ) distribution as a conjugate prior for the parameters of the multinomial(p 1 , p 2 , . . . , p d ). At the point (p 1 , p 2 , . . . , p d ) in a (d − 1)-dimensional simplex, this Dirichlet density takes value 1 where B(α) is the multivariate Beta function. In cases where some, but not all, of the α i are zero, we obtain in effect a density over a lower dimensional simplex. Suppose we have assigned this prior and a multinomial sample of size n yields a vector (n 1 , n 2 , . . . , n d ) of outcomes for each of the d categories, with n i = n. The posterior distribution for (p 1 , p 2 , . . . , p d ) is also Dirichlet, with parameters (α 1 + n 1 , α 2 + n 2 , . . . , α d + n d ).

Randomized Message-Passing
Model the color state at left or right node v i as multinomial(p i 1 , p i 2 , . . . , p i d ). The unknown parameter vector is assumed to have a Dirichlet(α i 1 , α i 2 , . . . , α i d ) distribution. At the outset, these Dirichlet parameters are all zero at a left vertex; at a right vertex α i j = µ i if v i is initially colored j, and zero otherwise. Here µ i > 0 is a parameter, which was a quarter of the degree of v i in our experiments. Zero values of α i k will not cause a problem, because after step 1 the sum of the parameters at every left vertex will be positive.
At iterations n = 1, 3, 5, . . . of the message passing algorithm, all the right nodes pass randomized messages to their left neighbors; at iterations n = 2, 4, 6, . . . , all the left nodes pass randomized messages to their right neighbors, and a right node also receives a deterministic reinforcement vector λ i e j if the initial coloring is j. Here e j denotes the j-th basis vector in R d , and λ i > 0 is a parameter, which was an eighth of the degree of v i in our experiments.
To construct a randomized message to each of its neighbors, node v i performs one multinomial(p i 1 , p i 2 , . . . , p i d ) trial, and if the outcome is of category (color) j, the unit vector e j is sent to every neighbor. The probability that node v i sends unit vector e j is α i j k α i k When node v k receives the unit vector e j , its updated Dirichlet distribution has parameters (α k 1 , α k 2 , . . . , α k d )+ e j . In other words, the j-th component increases by 1.

Convergence
The convergence condition for the Bayesian Multinomial is analogous to the definition of a harmonic function: it should be the case at every node v i that if a neighbour v i ′ ∼ v i is sampled uniformly at random, and if that neighbor generates a random message, then the probability that the message is e j coincides (to some precision) with the probability that v i itself generates message e j . In other words, the algorithm has a fixed point where Further work is needed, possibly using martingale analysis of a multiple Polya urn model, in order to prove that such a fixed point exists for given parameter choices (µ i ), (λ i ).

Wildness
A key advantage of the randomized multinomial message passing algorithm is its ability to incorporate an explicit model for wildness. It can be modified so that, at each step, instead of sending a message with a color a node can instead send a message that says it is wild. This happens with higher probability the closer that the Jensen-Shannon Divergence is to zero (see 9.4.1).

Summary
Inspired by the Naive Bayesian algorithm, we developed a Bayesian algorithm which more closely resembles expectation maximization: node coloring is assumed to be randomized multinomial, and our characterization of the multinomial parameters by a Dirichlet distribution is updated at each iteration. The termination condition of this algorithm is analogous to that of the harmonic function construction. Its downside is that, due to random sampling, it reaches its conclusion slower than the harmonic function. However, the description in terms of a randomized multinomial gives a more sophisticated technique for broadcasting wildness during the algorithm, instead of determining it retroactively (as in the harmonic function).

Background
It is possible to view this problem as a purely machine-learning problem. For each of the |R| right nodes, we can create an |L|-dimensional binary feature vector. For a given right node, each coordinate in the |L|-dimensional vector is 1 if the right node is adjacent to that left node and 0 otherwise. Our goal, in machine learning terms, is to detect clusters (colors) and outliers (wilds) simultaneously.
Typical clustering algorithms face some challenges in this context. First, the labels may not necessarily define clusters but could define a union of sub-clusters. This means that the true number of graph clusters could be significantly larger than the number of labels if the labels represent the union of smaller categories. Second, we are in an extremely large dimension with extreme sparsity where the notion of proximity for classification is less meaningful [2]. This essentially rules out algorithms such as k-means, and casts doubt on SVMs or random forests.
For the reasons mentioned above, we opt to use neural networks. We are further motivated by the fact that the left nodes intuitively seem to behave somewhat like neurons. Being adjacent to a particular left node is ultimately evidence for or against a particular color in a potentially non-linear way. For example, being adjacent to a particular pair of different colored nodes may be strong evidence of wildness, or relatively weak evidence of wildness depending on the pair (if they are "distant," it is strong evidence, while if they are "nearby" it is weak evidence).
Though it is a somewhat atypical application, neural networks for sparse classification problems have previous been considered in network problems [27] and in recommender systems [17].

Transductive Learning
The machine learning context applicable here is called "transductive learning." In general, "transductive learning" is learning where the training and testing sets are subsets of the same data set. Learning uses direct deductions rather than surmising general principles. In this specific case, our training and testing set are the same, but the training set contains some errors. We would like to predict the correct testing labels given the sometimes incorrect training labels. Arguably, it is a semi-supervised learning problem. We think of the set of left node adjacencies as features on the right nodes and right node colors as the labels to be predicted from those features. Our goal is to predict the color of a right node given the left nodes that it neighbors.

Objective Function
We will create a simple neural network with a single intermediate layer. Our layers are the input layer, the fully connected intermediate layer, and the output layer. The input layer will always have size |L| and the output layer will always have size |C|. Without any additional a priori assumptions about structure, it is typical to set the intermediate layer to half the size of the input layer. To give ourselves extra flexibility, we will consider an intermediate layer with (3|L| + 2|C|)/5 neurons.
In optimization terms, we are finding the optimal weights for a large objective function. Let A j be an |L| × 1 input vector in the training set, which is a column of the adjacency matrix. Let W 1 be the |L| × |M | set of weights between the input and intermediate layer, where |M | is the size of the intermediate layer, and let B 1 be the |M | × 1 bias vector for the intermediate layer. Finally, let relu be the activation function typically used in neural networks applied component-wise and let W 2 be the |M | × |C| set of weights between the intermediate and final layer. Our prediction for this particular column A j can be expressed as a probability vector: Our prior for Y j can be expressed as a unit vector Z j . We would like to minimize the sum of the cross entropy between Y j and the "true" vectors Z j . Formally, we could write: where the logorithm is taken component-wise. Our neural network will tend towards a W 1 , B 1 , and W 2 that minimize this objective.

Algorithm
We decided to implement our simple Neural Network using Google's TensorFlow, an open-source Library designed to streamline the construction and testing of neural networks optimized for GPU computations [16]. TensorFlow has been shown to provide leverage in diverse learning tasks where attempts are made to infer additional unseen relations between the features [17].
Since we are working in a transductive learning context, we perform several iterations of the following (in our case, 16 iterations): divide the set into half training data and half testing data, predict the results of the testing data from the training data, repeat. At each iteration, we expect to have |R| 2 training samples, each a vector of length |L|. We optimize the weights on the connections until the cross entropy for the color predictions is less than 0.20. We record the prediction at each of the testing nodes.

Parameters for Color and Wildness
After performing t iterations of our algorithm, each right node has an average of t 2 labels (with multiplicity). We consider these labels. We would like to give a small bias towards agreeing with the prior, so we assign the node to its prior if the latter agrees with at least 1 3 of the labelings. If that is not the case, we consider the most frequent label. If that label is present at least 2 3 of the time, we assign the node that color. If neither condition holds, we mark the node wild. We chose to adjust these values from a default value of 1 2 (just taking the majority vote) when we noticed that the algorithm was over-zealous in deciding to relabel nodes. It is important to note that when a node is in the testing set, the neural network does not know its prior. So, in a sense, the prior of a node is never used in its own classification (only in the classification of its neighbors).

Summary
In this section, we established that our problem could be treated as a high-dimensional, sparse clustering problem, but also explained some potential limitations of treating it with this mindset. We further argued that, given these limitations, a machine learning framework that might work for our problem is a neural network. Though we have not suggested any deviations from standard machine learning literature, we include a neural network for the sake of comparison.

Parameters and Metrics
We wish to understand the relative performance of our algorithms on many different synthetic graphs. Our graph for testing will be generated by either the circle model or the power law model. Our small graphs will consist of 5100 left nodes, 1700 right nodes, and 70 colors. Our large graph will consist of five times as many nodes and colors. We test on seven different randomly generated instances, summarized in the tables below: In testing our algorithms, we wish to understand the extent to which we can trust their results. The output of our algorithms can be one of three judgements: wild, same as prior, or misclassified. We will study the fraction of nodes which fall into each true category given their classified category. When a node is classified as prior or wild, we see how many are in the true categories normal, wild, and misclassified. When we are dealing with misclassifications, we need to distinguish between cases where the misclassification was corrected and cases where is was detected but "miscorrected" (corrected to the wrong value). We summarized our fields in the following Notice that we have two ultimate notions of correctness. Strong correctness is the strictest metric. We only get credit for a node if we either give it the correct label or correctly identify it as wild. Weak correctness is a relaxation: we consider a node anomalous if it is either misclassified or wild. We get credit for a node if we correctly detect that it is anomalous, even if we are not able to correctly identify the type of anomaly.
As a check, we expect that the sum of the values conditioned on a fixed classification will be 1. In the tables below, we express our probability metrics over the seven different data sets (rounded to two decimal places). We have not made considerable effort to optimize performance, so runtimes should be used to measure scaling and not absolute performance.

Raw Data
The raw data is presented in seven tables.

Discussion
First, we make three general observations. The first is that most of the algorithms scale by a factor of twenty-five in running time when we go from the small graph to the large graph. This makes sense since we are increasing both the graph size (nodes and edges) by a factor of five and the number of colors by a factor of five. The voting algorithm is an exception. It scales only by a factor of five for the number of nodes and does not scale with number of colors. The differences in the running times of the message passing algorithms can be largely explained by the number of iterations to convergence and not the speed of individual iterations. The second observation is that, as expected, the power law complicates matters: performance is better on the plain circle graph almost accross the board. Finally, we note that in the scaled up graphs with the same error rates several of the algorithms actually improve in performance, suggesting that scale is only a challenge of timing and not correctness. Now we list a series of observations and speculations, broken down by algorithm: • Voting: Though the voting algorithm technically has close to the weakest performance, beating only gradient descent, there are a few lessons to be learned. It runs extremely quickly. Unlike most other algorithms, it only needs to store a single value at the nodes and not a whole probability vector. With the experimental parameter settings, it was the only algorithm which labeled nodes wild with perfect precision across graph types and sizes. However, this result is mitigated by the fact that its recall was approximately half that of the other algorithms.
• Gradient: The gradient algorithm performs reasonably on the circle model, but once the power law is introduced it detects wilds at a significantly lower rate than the other algorithms with significantly higher error. Its one strength may be relabeling. With the experimental parameter settings, it was very cautious in relabeling, scoring the highest precision among the algorithms. This result is mitigated by the fact that its recall was significantly lower than the other algorithms. The other algorithms could be set to relabel more cautiously with some parameter tweaking.
• Min Cut: The minimum cut is the second-strongest algorithm in terms of weak correctness. It is surprisingly fast. In the larger graph, it takes approximately 8 seconds per cut. Furthermore, it is not affected as much as the other algorithms when moving from the circle graphs to the power law graphs. It is good at correcting nodes which are mislabeled, consistently relabeling them with higher precision than other algorithms with comparable recall (all but gradient descent). Where it comes up short is in its model of wildness: it consistently labels nodes wild 20% more often than it needs to and suffers a corresponding loss in precision. It should be possible to exploit the fact that many of the nodes being incorrectly classified as wild are in fact mislabeled nodes.
• Naive Bayes: The naive Bayesian algorithm performs the best among all these algorithms in terms of weak and strong correctness. Furthermore, since its fundamental operations is multiplication, as opposed to addition, it converges extremely quickly. Examining the tables, we see its dominance can be attributed to detecting wild nodes with near-perfect precision. We speculate that this happens because the naive Bayesian algorithm has an explicit model for what it means to be wild, while in the other algorithms wildness is an absense of pattern.
• Harmonic Function: Notice the difference between the performance of the random walk in Tables 4 and 5. That is, the performance of the random walk drops more sharply when wild nodes are introduced into the graph than when mislabeled nodes are introduced. Intuitively, this makes sense. When a random walk hits a wild node, its performance thereafter gives no useful information about what color its starting node should be. On the other hand, when it hits a mislabeled node its current position is noise but its future movement may still provide useful color information to its start node. In probabilistic terms, having more wilds increases the probability of traversing an uninformative edge and thus ending in a color different from the starting color. Aside from that, the random walk appears to have a consistent issue relabeling nodes which should be left wild and marking wild some nodes which are normal.
• Multinomial Bayes: Given the discussion of similarity between the harmonic function algorithm and the multinomial Bayesian algorithm in convergence conditions, it is not surprising that the multinomial Bayesian algorithm performs similarly to the random walk. We had hoped that by having a model of wildness incorporated throughout and not retrofitted, we would be able to improve upon the random walk performance but it does not appear to be the case. There is one key difference, though. Unlike the harmonic function algorithm, which passes a whole vector as its message, the multinomial Bayesian algorithm only passes a single color (though both still store the full vector in memory at their node). When working on very large graphs in parallel architectures, this fact of smaller message sizes may be important and may affect the choice between otherwise similar algorithms.
• Neural Network: Generally, the performance of the neural network is not impressive, coming in slightly below average in Table 6. Interestingly, its performance does not drop in Table 6 from Table 5. In fact, it improves. To understand why this might be happening, recall that our transductive learning algorithm splits the data into training and testing sets. If a left node is of low degree, then cutting its degree in half may make it behave unreliably in training. For example, consider a left node which is only adjacent to one right node. In the training set, it could be considered a perfect predictor of the color of that right node, even if its hidden right neighbor (on which it will be tested) does not agree in color. A similar argument could be made for a right node of low degree. This might also explain why the neural network relabels many normal nodes or marks them wild. Sparsity causes chaos in the nodes of very low degree.
At the risk of over-generalizing, we wish to draw a tentative conclusion from the data as a whole. We suggest that, on average, an algorithm performs better the more tailored its model or objective function is to the problem at hand. For example, the Naive Bayes algorithm seems to succeed by having an explicit model for wildness, while the Minimum Cut algorithm accounts for each type of error explicitly in its objective function. The simplest algorithms, such as the gradient algorithm, which looks for a best-fit, do not have nuances of the problem built in. They are seeking general agreement in a broader sense and thus cannot reach as strong of a result.

Conclusion
We began our paper by introducing several problems which could be naturally modeled as label correction on large bipartite graphs. We introduced geometric techniques for generating random graph instances with untrustworthy labels and showed that they exhibited desirable properties in terms of locality and degree distributions.
The eight algorithms we tested were: a trivial algorithm, a voting algorithm based on semi-definite programming, a gradient descent algorithm based on a linear best-fit model with quadratic penalty terms, a minimum cut algorithm, a naive Bayesian algorithm, a harmonic function algorithm, a multinomial Bayesian algorithm, and a neural network algorithm. For large graphs with high error rates, the naive Bayesian algorithm emerged victorious when we examined a single success metric, with the minimum cut algorithm coming in close behind and the harmonic function and multinomial Bayesian in third. However, the true story was more nuanced, with certain algorithms performing better in certain metrics and instances.
The niche specialties of these algorithms suggest that the best approach in a particular application may depend heavily on context and that there is potential for a meta-algorithm which incorporates the judgements of several algorithms or which sequentially applies these algorithms, using the outputs of one as priors for another.