Charisius - Efficient Aggregators

Charisius is a Python package that provides a series of highly optimized functions to perform efficient data aggregations. The functions leverage PyTorch's capabilities to achieve significant performance improvements, ranging from 25% to 2200% faster than their previous versions.


Functions

geometric_median(vectors)

Compute the geometric median of the provided vectors. It uses a smoothed weiszfeld algorithm, which is a gradient descent algorithm for the geometric median.

krum(aggregator, vectors)

Compute the krum of the vectors. This function computes all pairwise distances and returns the vector with the smallest score.

multi_krum(aggregator, vectors)

This function extends krum to return the average of k vectors with the lowest scores, where k is the number of vectors to average in the end.

nearest_neighbor_mixing(aggregator, vectors, numb_iter=1)

Replace every vector by the average of its nearest neighbors. The number of iterations is determined by the `numb_iter` parameter.

bucketing(aggregator, vectors)

Organize vectors into buckets and compute the average for each bucket. The buckets are determined by the `bucket_size` attribute of the `aggregator`.

centered_clipping(aggregator, vectors, L_iter=3, clip_thresh=1)

Perform the centered clipping on vectors. The number of iterations and the clip threshold can be controlled by `L_iter` and `clip_thresh` parameters respectively.

MoNNA(aggregator, vectors)

Compute the N-f closest vectors to the pivot vector and return their average.


Byzantine Attacks

Sign Flipping

Performs the sign flipping attack on the honest vectors, inverting the direction of the averaged vector.

Label Flipping

Averages the flipped vectors without altering their direction.

Fall of Empires

Introduces a distortion to the average of the honest vectors by adjusting its magnitude using an attack factor.

Auto FOE

An automated variation of the Fall of Empires attack, which determines the optimal attack factor to maximize the disruption.

A Little Is Enough

Distorts the honest vectors' average by adding an attack vector with magnitude controlled by an attack factor.

Auto ALIE

An automated version of the A Little Is Enough attack, which computes the optimal attack factor for maximum disruption.

Mimic

Attempts to mimic a certain worker's behavior based on a heuristic. Depending on the learning phase, it either mimics the first worker or updates its heuristic to mimic the most influential worker.

Infinity Attack

Returns a vector filled with infinity values, potentially disrupting aggregations depending on the aggregator's behavior with infinite values.

Author: Serhan YILMAZ