- Federated reinforcement learning
- Cell sleep control
- Model poisoning
- GAN attack
- Knowledge distillation
- Meme model
- Krum
- PyTorch
At three in the morning a residential neighbourhood barely uses its network. The small cells mounted on lamp posts could sleep, saving power, and let the macro tower carry the trickle of traffic. Deciding when each one should nod off, and how deeply, is a good job for reinforcement learning. Letting twenty cells pool what they learn through federated learning makes it better still. It also means that one cell with a compromised controller can teach all the others to sleep through the evening rush.
Han Zhang, Hao Zhou and Melike Erol-Kantarci at the University of Ottawa, working with Medhat Elsayed and colleagues at Ericsson, study exactly that failure. Earlier poisoning research mostly targeted image classifiers trained on identical data splits. This paper attacks a federated deep Q network that controls real radio hardware, uses deliberately mismatched traffic at every cell, and proposes a defense built from knowledge distillation instead of outlier detection. The attacks are convincing. The defense works in simulation. The theorem meant to guarantee it needs repair, and we show where.
Key points
- Twenty small cells each run a deep Q network choosing active, sleep or deep sleep, and a macro cell averages them with FedAvg.
- With 3 of 20 cells compromised, a regularization attack cut throughput by 69.3 percent and energy efficiency by 79.5 percent, far more than plain data poisoning.
- A meme model defense lets each cell refuse global knowledge that disagrees with its own data, restoring at least 94.2 percent of secure energy efficiency under the strongest attack.
- The Proposition 1 bound drops the softmax normaliser, so its energy term grows with the scale of the Q values, and it averages over states where a valid bound needs the minimum.
- The threshold and mixing weight are never reported, and there is no baseline where every cell trains alone, which is where the defense falls back when it rejects the global model.
Why a sleep controller is a tempting target
Base station sleep control sounds harmless. It decides power states, not routing or encryption. That is exactly why the authors chose it. A bad decision here has a direct and measurable cost. Put a cell into deep sleep while its users are streaming, and their traffic either spills onto an already loaded macro cell or gets dropped. Keep every cell awake all night, and the operator pays for power that serves nobody. Attack the learning loop that sets these states, and you can push the network toward either failure without touching user data.
The federated setup amplifies the risk. Each small cell trains on its own slice of traffic, uploads model weights, and receives an average back. A malicious update does not stay local. It is mixed into the global model and then installed in every honest cell on the next round. This is the reason operators want federated learning in the first place, shared experience without shared data, turned against them. For a broader view of how often this pattern appears in edge security research, our review of 131 studies on federated learning for edge cyberattack detection found the same tension again and again.
The network the authors simulate
The simulation is a 3GPP urban macro layout with one macro base station and 20 small cells. Small cells transmit at 4 watts on 3.5 GHz, the macro at 40 watts on 2.0 GHz, over 20 MHz split into 100 resource blocks. Each small cell serves between 3 and 11 users, and peak loads are set to 12, 14, 16 or 18 Mbps. Sleep mode draws half the power of active mode and deep sleep 15 percent. Every episode replays a typical 24 hour residential traffic pattern.
Different user counts and loads at each cell make the local data deliberately non IID. That choice is the paper’s best contribution to realism. When every client sees the same distribution, honest models cluster tightly and a poisoned one stands out. When every client sees something different, honest outliers and attackers look alike. The authors show this with a principal component plot of model weights, where IID models sit in a tight knot and non IID models scatter until the attackers hide among them.
What each cell learns
Each small cell runs a deep Q network with two hidden layers of 64 and 32 units. Its state includes its own sleep status, its traffic over the last five slots, the macro cell’s traffic over the last five slots and its current throughput, sixteen numbers in total. It picks one of three actions, and its reward balances throughput, packet loss and power.
The weights are 0.25 for throughput, 1 for packet loss and 0.05 for power. Learning rate 0.01, discount 0.8, exploration 0.05, batch 256. Results are averaged over ten runs and reported with 95 percent confidence intervals, a level of care many poisoning papers skip.
Two attacks that try not to look like attacks
Writing fake weights with a GAN
Earlier GAN attacks on federated learning used the generator to invent poisoned training images. This paper uses it to invent model weights directly. The obstacle is data. A compromised cell sees exactly one real sample per round, the global model it receives. So the attacker restricts the GAN to the output layer of the Q network, collects one sample per round until it has a batch, warms the generator with an autoencoder, then trains the usual adversarial pair.
In the attack phase the noise comes from a different distribution than in training. The idea is that the output looks like a real output layer to any distance check, but carries information the honest models never learned. It is a clever trick, and the authors are frank about its limits. The fake weights have no particular goal. They are a disturbance, not a steering signal, which is why this attack turns out weaker than the next one.
Training to lose, quietly
The regularization attack is simpler and nastier. A compromised cell changes its loss so the Q network learns the negative of the usual target, which makes the highest Q value point at the worst action. An L2 term then pulls its weights back toward the global model, so its update does not look unusual to a server that compares distances.
This mirrors the optimisation view of model poisoning that Fang and colleagues introduced for Byzantine robust classifiers, adapted to Q learning. Its cost is almost nothing, one extra norm per step. The baseline is ordinary data poisoning, which flips the sign of the highest rewards in about 5 percent of a compromised cell’s replay buffer.
| Attack, 3 of 20 cells | Throughput change | Energy efficiency change |
|---|---|---|
| Data poisoning baseline | minus 10.2% | minus 3.9% |
| GAN enhanced model poisoning | minus 36.5% | minus 28.7% |
| Regularization based model poisoning | minus 69.3% | minus 79.5% |
Three cells out of twenty is 15 percent of the federation. That is a meaningful but not extreme share, and the gap between data poisoning and model poisoning is the most useful practical lesson in the paper. Corrupting a few rewards is diluted by the honest data in the same buffer. Corrupting the weights is not.
An attacker who can change what a cell uploads is far more dangerous than one who can only corrupt its data. In this simulation, weight level poisoning did seven to twenty times more damage to energy efficiency than reward flipping.
The defenses, and why the meme model is the interesting one
Krum and an autoencoder at the server
The baseline is Krum, from Blanchard and colleagues, which picks the single update that sits closest to the others and uses it as the next global model. The paper describes it as choosing the update with the smallest average distance to all others. Original Krum scores each update only by its nearest neighbours, excluding the expected number of attackers, so the version tested here is a simplified one. Under non IID data, keeping just one cell’s model also throws away what the other nineteen learned.
The first proposed defense refines that idea in two steps. A quick pass keeps the updates with the smallest average distance as a reliable set. An autoencoder is then trained on that set and used to reconstruct every update, and any update whose reconstruction error is above the average error is excluded from aggregation. Comparing reconstruction error rather than raw distance is meant to blunt the effect of honest heterogeneity.
Note the threshold. Excluding everything above the mean error will always exclude some updates, even if no attacker is present, and in a non IID federation those are likely to be the honest minority cells whose traffic looks unusual. The paper does not report how many honest cells were dropped, or how often attackers slipped through. Detection precision and recall would tell readers more than the end to end throughput alone.
The meme model on each client
The second defense moves the decision from the server to every cell. Each cell keeps two networks, its local Q network and a meme model that is overwritten with the global model each round. Both see the same local batch. Their Q values are turned into action probabilities with a softmax and compared by KL divergence.
When the global policy agrees with what the cell’s own data supports, the cell distils from it. When they disagree sharply, the cell assumes the global model has been poisoned, trains only on local data, and pulls its meme model toward its own policy. The meme model, not the local network, is what gets uploaded. Readers who want the mechanics of temperature, soft targets and KL behind this step can find them in our explainer on the mathematics of knowledge distillation.
The design has a clear strength. It never needs to identify an attacker, so it does not care how stealthy the attack is. A poisoned global model that looks perfectly normal in weight space still produces a policy that disagrees with honest local data, and that disagreement is what the test measures.
| Defense | GAN attack, throughput | GAN attack, energy efficiency | Regularization attack, throughput | Regularization attack, energy efficiency |
|---|---|---|---|---|
| Krum, as tested | close to no defense | close to no defense | 74.6% of secure | 72.3% of secure |
| Autoencoder two step | plus 29.9% over attacked | plus 9.4% over attacked | 81.17% of secure | 82.3% of secure |
| KD with meme model | 95.3% of secure | 95.7% of secure | almost equal to secure | at least 94.2% of secure |
Two patterns are worth noting. The autoencoder wins against the crude attack and loses against the stealthy ones, which is what you would expect from any detector built on similarity. Krum and the autoencoder also swap places as traffic load changes, Krum better at high load and the autoencoder at low load, which tells an operator that their behaviour depends on conditions the defender does not control.
Checking the guarantee in Proposition 1
The paper’s headline theoretical claim is that the meme model defense caps the damage from any poisoning attack. Proposition 1 bounds the probability that an honest cell picks a non optimal action by the threshold divided by an energy term.
The intuition is sound. To flip the best action, an attacker must make the meme model’s policy rank the second action at least as high as the first, and that costs a minimum amount of KL divergence. If the defense only accepts a total KL of \(\Theta\) per batch, only so many states can be flipped. We rebuilt the argument and found three problems that change what the bound actually says.
The energy term is missing a normaliser
Working the minimisation through, the cheapest way to flip the top action of \(p=\text{softmax}(q)\) puts equal mass on the top two actions and leaves the third alone. The true minimum KL is
The printed \(E_0\) is exactly that quantity multiplied by the softmax normaliser \(Z\), because the derivation used \(e^{q_i}\) where it needed \(\text{softmax}(q_i)\). Our code checks this three ways. For Q values of 12, 11 and 5, the closed form and a brute force optimiser both give a minimum KL of 0.111, while the printed \(E_0\) is about 24,699. Dividing \(E_0\) by \(Z\) recovers 0.111. Since \(\Theta\) is compared with a properly normalised KL in the algorithm, the printed bound shrinks by a factor of \(Z\), which depends on how large the Q values are and therefore on how the reward is scaled. Multiply every reward by ten and the printed guarantee looks dramatically stronger without anything changing in the network.
An average where a minimum is needed
The proof averages \(E_0\) over the training batch. An attacker who wants to flip as many actions as possible within a KL budget will not spend evenly. It will flip the states that are cheapest to flip, the near ties where \(q_1\) barely exceeds \(q_2\). There the minimum KL approaches zero. With \(q_1\) just 0.01 above \(q_2\), our code returns a flip cost of about 0.00001. A bound written in terms of the average cost does not cap an attacker who chooses where to spend, and a bound written in terms of the minimum cost is vacuous whenever near ties exist.
There is a fair reply. Flipping a near tie does little harm, since the two actions are almost equally good by definition. That suggests the right statement is a bound on lost value, the regret, rather than on the probability of a non optimal action. A regret bound would be both correct and more useful to an operator.
Two directions of KL
Algorithm 2 tests \(D_{KL}(p^M\Vert p^L)\) against the threshold, while the proof bounds \(D_{KL}(p^L\Vert p^M)\). KL divergence is not symmetric, so a budget on one direction does not translate directly into a budget on the other. This is fixable, but as written the guarantee is about a quantity the algorithm does not check.
“theoretically be effective against any type of poisoning attack”Zhang et al., discussion of Proposition 1, IEEE Transactions on Wireless Communications
None of this undermines the simulation results. It means the paper’s general claim, that the defense is effective against any poisoning attack, rests on the experiments rather than on the theorem.
What the evaluation leaves open
The missing local training baseline
When the KL test fails, a cell stops learning from the federation and trains on its own data. Under a strong attack that may happen on most batches. So the KD defense, at its most active, approaches the setting where every cell trains alone. The paper never reports that setting. Without it, a reader cannot tell whether 95 percent of secure performance means the defense preserved the benefit of federation or simply fell back to local learning that happens to be nearly as good in this simulation. Our implementation includes a local only mode so the comparison takes one line to run.
Protecting clients is not protecting the model
Every compromised cell still uploads whatever it likes, and the server still averages it. The meme model defense protects each honest cell from installing a bad policy, but the global model itself stays poisoned. That matters if the operator ever wants to deploy the global model to a new cell with little local data, which is one of the main reasons to federate. A new cell has no strong local policy with which to judge the global one.
Unreported settings and a narrow threat model
The paper never gives values for \(\Theta\) or \(\xi\), the two parameters that decide how the defense behaves. A tight threshold blocks attacks and useful global knowledge alike. A loose one lets poison through. A sweep over both would show where the defense actually sits on that trade off. The attacks are also fixed. Neither adapts to the KD defense, for example by keeping the KL just under \(\Theta\) and concentrating on near tie states, which is exactly what the bound analysis says a smart attacker would do.
The comparison set is thin as well. The authors’ own earlier workshop paper proposed a refined Krum that does not need to know the number of attackers, and it is not included here. Common robust aggregators such as coordinate wise median and trimmed mean are absent. Everything runs in one simulated layout with 20 small cells, and the GAN attacker is assumed able to inject fake participants into the federation, which in a real operator network would usually require compromising authentication as well.
The meme model defense is a sound engineering idea with strong simulated results. Its formal guarantee needs a normalised energy term, a worst case rather than average cost, and a consistent KL direction before it can be relied on, and its evaluation needs a local only baseline and the values of its two control parameters.
What this means for operators and researchers
For anyone deploying federated control in a radio access network, three lessons survive the critique. First, weight level poisoning is the threat to plan for, since it was far more damaging than data poisoning. Second, similarity based detection at the server breaks down exactly when traffic differs from cell to cell, which is always. Third, letting each client check the global policy against its own data is a defense that does not depend on spotting the attacker, and that property is worth keeping even if the exact algorithm changes.
For researchers, the paper is a good base to build on. Fix the bound, state it as regret, report the KL acceptance rate over training, and add adaptive attackers that know the defense. The same client side verification idea could also carry over to other federated control problems where clients have their own measurable reward, such as power allocation or handover tuning. Related concerns about how attacks are catalogued across AI systems appear in our piece on MITRE ATLAS and the shape of adversarial attacks, and the other federated studies on this site are collected in the Federated Learning and AI Privacy category.
Reference implementation in PyTorch
The authors did not release code. The implementation below is ours, written from the paper’s description. It includes a small toy heterogeneous network with residential traffic, federated DQN clients, the data poisoning, regularization and output layer GAN attacks, Krum as the paper describes it, the two step autoencoder filter, the meme model defense, and a local only baseline. It also checks the Proposition 1 quantities numerically. The toy network is far simpler than the authors’ 3GPP simulator, so its throughput numbers are only a smoke test and should not be compared with the paper’s results. The full run takes about ten seconds on a CPU.
"""
Federated DQN cell sleep control with intelligent poisoning attacks and two defenses.
Educational PyTorch reimplementation written from the description in
Zhang, Zhou, Elsayed, Bavand, Gaigalas, Ozcan and Erol-Kantarci,
"Intelligent Attacks and Defense Methods in Federated Learning-enabled Energy-Efficient
Wireless Networks", IEEE Transactions on Wireless Communications (arXiv:2504.18519).
The authors did not release code. This is not their implementation, and the radio
simulator below is a small toy, not their 3GPP urban macro simulator.
Contents
ToyHetNet one macro BS, N small BSs, three sleep modes, residential traffic
DQN, Client local deep Q learning with a replay buffer
fedavg, krum_paper aggregation, and Krum as described in the paper (average distance)
attacks data poisoning, regularization based poisoning, GAN on the output layer
autoencoder_defense two step server side filter
KDClient meme model, KL check against a threshold, mutual distillation
min_flip_kl, paper_E0 the Proposition 1 quantities, checked numerically
"""
import math
import random
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
ACTIVE, SLEEP, DEEP = 0, 1, 2
POWER = {ACTIVE: 1.0, SLEEP: 0.5, DEEP: 0.15} # energy share per mode, Table II
W1, W2, W3 = 0.25, 1.0, 0.05 # reward weights, Section VI A
# ----------------------------------------------------------------------------
# Toy heterogeneous network. Non IID because every SBS gets its own peak load and UE count
# ----------------------------------------------------------------------------
def residential_profile(hour):
"""Smooth daily curve, low at night, peak in the evening (shape only, not the paper's trace)."""
return 0.25 + 0.75 * math.exp(-((hour - 20.5) / 4.0) ** 2) + 0.25 * math.exp(-((hour - 12) / 3.0) ** 2)
class ToyHetNet:
def __init__(self, n_sbs=20, peak=(12, 18), mbs_spare=40.0, sbs_cap=25.0, seed=0):
self.rng = np.random.default_rng(seed)
self.n = n_sbs
self.peak = self.rng.uniform(*peak, n_sbs) # Mbps, one peak per SBS
self.ues = self.rng.integers(3, 12, n_sbs) # 3 to 11 UEs per SBS
self.mbs_spare, self.sbs_cap = mbs_spare, sbs_cap
self.reset()
def reset(self):
self.t = 0
self.mode = np.zeros(self.n, dtype=int)
self.hist = np.zeros((self.n, 5))
self.mbs_hist = np.zeros(5)
self.tput = np.zeros(self.n)
return self.states()
def loads(self):
hour = (self.t % 96) / 4.0 # one TTI is a 15 minute slot
base = residential_profile(hour)
noise = self.rng.normal(1.0, 0.1 + 0.02 * self.ues / 11, self.n)
return np.clip(self.peak * base * noise, 0, None)
def states(self):
"""16 numbers. Mode one hot (3), own load history (5), macro load history (5),
own throughput (1), hour as sine and cosine (2)."""
hour = (self.t % 96) / 96 * 2 * math.pi
s = np.zeros((self.n, 16), dtype=np.float32)
s[np.arange(self.n), self.mode] = 1
s[:, 3:8] = self.hist / 20
s[:, 8:13] = self.mbs_hist / 40
s[:, 13] = self.tput / 20
s[:, 14], s[:, 15] = math.sin(hour), math.cos(hour)
return s
def step(self, actions):
load = self.loads()
waking = (self.mode == DEEP) & (np.asarray(actions) == ACTIVE) # deep sleep wakes one slot late
self.mode = np.asarray(actions)
served = np.where((self.mode == ACTIVE) & ~waking, np.minimum(load, self.sbs_cap), 0.0)
offload = (load - served).sum()
mbs_served = min(offload, self.mbs_spare)
share = np.where(load - served > 0, (load - served) / max(offload, 1e-9), 0)
served_total = served + share * mbs_served
drop = np.where(load > 0, 1 - served_total / np.maximum(load, 1e-9), 0)
power = np.array([POWER[m] for m in self.mode])
reward = W1 * served_total / 4 - W2 * drop - W3 * power * 10
ee = (served_total.sum()) / (power.sum() * 4 + 40) # Eq. 4 shape, MBS always on
self.hist = np.roll(self.hist, -1, 1); self.hist[:, -1] = load
self.mbs_hist = np.roll(self.mbs_hist, -1); self.mbs_hist[-1] = mbs_served
self.tput = served_total
self.t += 1
return self.states(), reward.astype(np.float32), {"throughput": served_total.mean(), "ee": ee}
# ----------------------------------------------------------------------------
# Local learner. Two hidden layers of 64 and 32 units, three actions
# ----------------------------------------------------------------------------
class DQN(nn.Module):
def __init__(self, d_in=16, n_act=3):
super().__init__()
self.body = nn.Sequential(nn.Linear(d_in, 64), nn.ReLU(), nn.Linear(64, 32), nn.ReLU())
self.out = nn.Linear(32, n_act)
def forward(self, s):
return self.out(self.body(s))
def flat(model):
return torch.cat([p.detach().flatten() for p in model.parameters()])
def load_flat(model, vec):
i = 0
for p in model.parameters():
n = p.numel()
p.data.copy_(vec[i:i + n].view_as(p))
i += n
class Client:
def __init__(self, idx, lr=0.01, gamma=0.8, eps=0.05, batch=256, buf=5000):
self.idx, self.gamma, self.eps, self.batch = idx, gamma, eps, batch
self.model = DQN()
self.opt = torch.optim.Adam(self.model.parameters(), lr=lr)
self.buf, self.cap = [], buf
self.malicious = False
def act(self, s):
if random.random() < self.eps:
return random.randrange(3)
with torch.no_grad():
return int(self.model(torch.tensor(s)).argmax())
def remember(self, s, a, r, s2):
self.buf.append((s, a, r, s2))
if len(self.buf) > self.cap:
self.buf.pop(0)
def sample(self):
b = random.sample(self.buf, min(self.batch, len(self.buf)))
s, a, r, s2 = map(np.array, zip(*b))
return (torch.tensor(s), torch.tensor(a), torch.tensor(r, dtype=torch.float32), torch.tensor(s2))
def td_loss(self, model, s, a, r, s2):
"""Eq. 9 written as a loss. Target r + gamma max Q(s')."""
with torch.no_grad():
target = r + self.gamma * model(s2).max(1).values
q = model(s).gather(1, a[:, None]).squeeze(1)
return F.mse_loss(q, target)
def train_step(self):
if len(self.buf) < 32:
return
loss = self.td_loss(self.model, *self.sample())
self.opt.zero_grad(); loss.backward(); self.opt.step()
# ----------------------------------------------------------------------------
# Aggregation
# ----------------------------------------------------------------------------
def fedavg(vectors):
"""Eq. 10. Equal weights because every SBS has the same buffer size."""
return torch.stack(vectors).mean(0)
def pairwise_update_distance(vectors, global_vec):
"""Eqs. 16 to 18. Distance between updates, then each update's average distance to all others."""
G = torch.stack([v - global_vec for v in vectors])
D = torch.cdist(G, G)
return D.mean(1)
def krum_paper(vectors, global_vec):
"""Krum as the paper describes it, the single model with the smallest average distance.
Original Krum scores each model by its n minus f minus 2 nearest neighbours only."""
return vectors[int(pairwise_update_distance(vectors, global_vec).argmin())].clone()
# ----------------------------------------------------------------------------
# Attacks
# ----------------------------------------------------------------------------
def data_poison(client, frac=0.05):
"""Baseline. Flip the sign of the highest positive rewards in about 5 percent of the buffer."""
k = max(1, int(frac * len(client.buf)))
order = sorted(range(len(client.buf)), key=lambda i: -client.buf[i][2])[:k]
for i in order:
s, a, r, s2 = client.buf[i]
if r > 0:
client.buf[i] = (s, a, -r, s2)
def regularization_attack_step(client, global_vec, omega=1.0):
"""Eq. 14. Fit Q(s,a) to minus the TD target so argmax picks the worst action,
while an L2 term keeps the parameters close to the global model to stay stealthy."""
if len(client.buf) < 32:
return
s, a, r, s2 = client.sample()
with torch.no_grad():
target = r + client.gamma * client.model(s2).max(1).values
q = client.model(s).gather(1, a[:, None]).squeeze(1)
attack = ((target + q) ** 2).mean()
reg = omega * (flat_params(client.model) - global_vec).pow(2).sum()
loss = attack + reg
client.opt.zero_grad(); loss.backward(); client.opt.step()
def flat_params(model):
return torch.cat([p.flatten() for p in model.parameters()])
class ParamGAN(nn.Module):
"""Generator and discriminator over the output layer only (32 x 3 weights plus 3 biases),
because the attacker sees one real sample per round, the broadcast global model."""
def __init__(self, dim=99, z=8):
super().__init__()
self.z = z
self.G = nn.Sequential(nn.Linear(z, 64), nn.ReLU(), nn.Linear(64, dim))
self.D = nn.Sequential(nn.Linear(dim, 64), nn.LeakyReLU(0.2), nn.Linear(64, 1))
self.og = torch.optim.Adam(self.G.parameters(), lr=1e-3)
self.od = torch.optim.Adam(self.D.parameters(), lr=1e-3)
self.real = []
def observe(self, out_layer_vec):
self.real.append(out_layer_vec.clone())
def fit(self, steps=50, mu=0.0, sigma=1.0):
"""Eqs. 12 and 13 with the usual non saturating generator loss."""
X = torch.stack(self.real)
for _ in range(steps):
z = torch.randn(len(X), self.z) * sigma + mu
fake = self.G(z)
d_loss = F.binary_cross_entropy_with_logits(self.D(X), torch.ones(len(X), 1)) + \
F.binary_cross_entropy_with_logits(self.D(fake.detach()), torch.zeros(len(X), 1))
self.od.zero_grad(); d_loss.backward(); self.od.step()
g_loss = F.binary_cross_entropy_with_logits(self.D(self.G(z)), torch.ones(len(X), 1))
self.og.zero_grad(); g_loss.backward(); self.og.step()
@torch.no_grad()
def sample(self, mu=2.0, sigma=2.0):
"""Attack phase. Noise drawn from a different distribution than in training."""
return self.G(torch.randn(1, self.z) * sigma + mu)[0]
def out_layer_slice(model):
n_body = sum(p.numel() for p in model.body.parameters())
return slice(n_body, n_body + sum(p.numel() for p in model.out.parameters()))
# ----------------------------------------------------------------------------
# Defense 1. Autoencoder two step filter at the server
# ----------------------------------------------------------------------------
def autoencoder_defense(vectors, global_vec, keep=8, epochs=200, code=16):
"""Step one keeps the `keep` updates with the smallest average distance (Eq. 18).
Step two trains an autoencoder on those and drops every model whose reconstruction
error (Eq. 19) is above the mean error of all models."""
dist = pairwise_update_distance(vectors, global_vec)
reliable = torch.stack([vectors[i] for i in dist.argsort()[:keep]])
mu, sd = reliable.mean(0), reliable.std(0) + 1e-6
dim = reliable.shape[1]
ae = nn.Sequential(nn.Linear(dim, 64), nn.ReLU(), nn.Linear(64, code), nn.ReLU(), nn.Linear(code, 64), nn.ReLU(), nn.Linear(64, dim))
opt = torch.optim.Adam(ae.parameters(), lr=1e-3)
Xr = (reliable - mu) / sd
for _ in range(epochs):
loss = F.mse_loss(ae(Xr), Xr)
opt.zero_grad(); loss.backward(); opt.step()
with torch.no_grad():
X = (torch.stack(vectors) - mu) / sd
err = torch.nan_to_num((ae(X) - X).pow(2).mean(1), nan=float("inf"))
accepted = [i for i in range(len(vectors)) if err[i] <= err.mean() + 1e-9]
if not accepted: # all errors equal or undefined, fall back to step one
accepted = dist.argsort()[:keep].tolist()
return fedavg([vectors[i] for i in accepted]), accepted
# ----------------------------------------------------------------------------
# Defense 2. Meme model with a KL check and mutual distillation on each client
# ----------------------------------------------------------------------------
def kl_from_q(q_from, q_to):
"""Eqs. 20 and 21. Softmax over Q values, KL(p_from || p_to) averaged over the batch."""
return F.kl_div(F.log_softmax(q_to, 1), F.log_softmax(q_from, 1), log_target=True, reduction="batchmean")
class KDClient(Client):
def __init__(self, idx, theta=0.05, xi=0.7, **kw):
super().__init__(idx, **kw)
self.meme = DQN()
self.meme_opt = torch.optim.Adam(self.meme.parameters(), lr=kw.get("lr", 0.01))
self.theta, self.xi = theta, xi # the paper does not report either value
self.accepted = 0
def receive_global(self, global_vec):
load_flat(self.meme, global_vec) # Algorithm 2, line 22
def train_step(self):
if len(self.buf) < 32:
return
s, a, r, s2 = self.sample()
qL, qM = self.model(s), self.meme(s)
kl = kl_from_q(qM.detach(), qL.detach()) # KL(pM || pL), as in Algorithm 2 line 11
if kl < self.theta:
# Eq. 25. Local model learns from local data and from the global (meme) policy
loss = self.xi * self.td_loss(self.model, s, a, r, s2) + (1 - self.xi) * kl_from_q(qM.detach(), self.model(s))
self.opt.zero_grad(); loss.backward(); self.opt.step()
self.accepted += 1
else:
# Global looks poisoned. Train locally, and pull the meme toward the local policy (Eq. 24)
loss = self.td_loss(self.model, s, a, r, s2)
self.opt.zero_grad(); loss.backward(); self.opt.step()
m_loss = kl_from_q(self.model(s).detach(), self.meme(s))
self.meme_opt.zero_grad(); m_loss.backward(); self.meme_opt.step()
def upload(self):
return flat(self.meme) # meme parameters are submitted, not local ones
# ----------------------------------------------------------------------------
# Proposition 1, checked numerically
# ----------------------------------------------------------------------------
def min_flip_kl(q):
"""Smallest KL(p || p') over all p' whose top action differs, for p = softmax(q) with q1 > q2 > q3.
The infimum puts equal mass on the top two actions. Closed form, our derivation."""
p = torch.softmax(torch.as_tensor(q, dtype=torch.float64), 0)
p1, p2 = p[0], p[1]
return float(p1 * torch.log(2 * p1 / (p1 + p2)) + p2 * torch.log(2 * p2 / (p1 + p2)))
def paper_E0(q):
"""Eq. 27 exactly as printed, using exp(q) without the softmax normaliser."""
e1, e2 = math.exp(q[0]), math.exp(q[1])
return -(e1 + e2) * math.log(e1 + e2) + e1 * math.log(2 * e1) + e2 * math.log(2 * e2)
def min_flip_kl_numeric(q, steps=3000):
"""Brute force check. Optimise free logits of p' under a penalty that forces q2' >= q1'."""
p = torch.softmax(torch.as_tensor(q, dtype=torch.float64), 0)
w = torch.tensor(q, dtype=torch.float64, requires_grad=True)
opt = torch.optim.Adam([w], lr=0.01)
for _ in range(steps):
logm = torch.log_softmax(w, 0)
loss = (p * (torch.log(p) - logm)).sum() + 1e3 * F.relu(w[0] - w[1]) ** 2
opt.zero_grad(); loss.backward(); opt.step()
return float((p * (torch.log(p) - torch.log_softmax(w.detach(), 0))).sum())
# ----------------------------------------------------------------------------
# One federated run
# ----------------------------------------------------------------------------
def run(attack=None, defense=None, n=20, n_bad=3, episodes=6, tti=96, local_steps=2, seed=0):
random.seed(seed); np.random.seed(seed); torch.manual_seed(seed)
env = ToyHetNet(n, seed=seed)
cls = KDClient if defense == "kd" else Client
clients = [cls(i) for i in range(n)]
init = flat(clients[0].model)
for c in clients:
load_flat(c.model, init)
if defense == "kd":
c.receive_global(init)
bad = set(range(n_bad)) if attack else set()
for i in bad:
clients[i].malicious = True
gan = ParamGAN(dim=out_layer_slice(clients[0].model).stop - out_layer_slice(clients[0].model).start)
global_vec, log = init.clone(), []
for ep in range(episodes):
s = env.reset(); ee = tp = 0.0
for t in range(tti):
acts = [c.act(s[i]) for i, c in enumerate(clients)]
s2, r, info = env.step(acts)
ee += info["ee"]; tp += info["throughput"]
for i, c in enumerate(clients):
c.remember(s[i], acts[i], float(r[i]), s2[i])
s = s2
for i, c in enumerate(clients):
for _ in range(local_steps):
if i in bad and attack == "regularization":
regularization_attack_step(c, global_vec)
else:
c.train_step()
if attack == "data" and t % 24 == 0:
for i in bad:
data_poison(clients[i])
# one federated round per slot
ups = [c.upload() if defense == "kd" else flat(c.model) for c in clients]
if attack == "gan":
sl = out_layer_slice(clients[0].model)
gan.observe(global_vec[sl])
if len(gan.real) > 16:
gan.fit(steps=5)
for i in bad:
v = global_vec.clone(); v[sl] = gan.sample(); ups[i] = v
if defense == "krum":
global_vec = krum_paper(ups, global_vec)
elif defense == "autoencoder":
global_vec, _ = autoencoder_defense(ups, global_vec, epochs=30)
else:
global_vec = fedavg(ups)
if defense == "local":
continue # no federation at all, the baseline the paper omits
for i, c in enumerate(clients):
if defense == "kd":
c.receive_global(global_vec)
else:
load_flat(c.model, global_vec)
log.append((tp / tti, ee / tti))
return log
if __name__ == "__main__":
print("Proposition 1. True minimum KL to flip the top action versus the printed E0")
for q in ([1.0, 0.5, -1.0], [3.0, 2.8, 0.0], [12.0, 11.0, 5.0]):
z = sum(math.exp(v) for v in q)
print(f" q {q}: closed form {min_flip_kl(q):.4f}, brute force {min_flip_kl_numeric(q):.4f}, "
f"E0 {paper_E0(q):.4f}, E0 / softmax sum {paper_E0(q) / z:.4f}")
print(" near tie q1 = q2 + 0.01:", round(min_flip_kl([1.01, 1.0, 0.0]), 8), "so a bound of theta over min E0 is vacuous")
torch.set_num_threads(2)
cases = [("secure", None, None), ("local only, no federation", None, "local"), ("regularization attack", "regularization", None),
("regularization plus krum", "regularization", "krum"),
("regularization plus autoencoder", "regularization", "autoencoder"),
("regularization plus KD", "regularization", "kd"),
("gan attack", "gan", None), ("data poisoning", "data", None)]
for name, att, dfn in cases:
log = run(att, dfn, episodes=2, tti=24, local_steps=1)
tp, ee = log[-1]
print(f" {name:32s} throughput {tp:6.2f} EE {ee:.3f}")
print("smoke test passed")
Where this leaves federated control security
This paper takes poisoning research out of the image classification setting where most of it lives and puts it inside a control loop that switches real radio hardware on and off. The attacks are realistic in cost, the data are deliberately non IID, and the results are averaged over ten runs with confidence intervals. That alone makes it more useful than many papers in the area.
The conceptual shift is in the defense. Rather than asking the server to spot bad updates, the meme model asks each client whether the shared policy still makes sense on its own data. That turns stealth, the attacker’s best tool against similarity checks, into something that no longer helps. An attack that hides perfectly in weight space still has to change behaviour to do harm, and behaviour is what the client measures.
The idea transfers well beyond cell sleep control. Any federated system where clients can evaluate the global model on local data, from power control to recommendation, could use the same check. The two halves of the meme model, distilling when policies agree and refusing when they do not, are easy to bolt onto existing FedAvg pipelines.
The limits are just as clear. The formal bound, as printed, measures the wrong quantity by a factor that depends on reward scale and assumes an attacker who spreads its effort evenly. The two control parameters are unreported, the local only baseline is missing, the global model stays poisoned, and the attackers never adapt to the defense. Each of these is a fixable gap rather than a flaw in the idea.
The natural next study would sweep the threshold and mixing weight, add an attacker that targets near tie states under a KL budget, report regret rather than action error, and compare against local training and the authors’ own refined Krum. If the meme model still holds up under those conditions, operators will have a defense that does not need to know who is lying, only what their own data says.
Frequently asked questions
What is federated deep reinforcement learning for cell sleep control?
Each small base station runs its own deep Q network that decides every slot whether to stay active, sleep or enter deep sleep, trading throughput against energy use. A macro base station acts as the federated learning server and averages the local networks into a global model, so stations share experience without sharing raw traffic data.
How do the GAN and regularization poisoning attacks work?
The GAN attack trains a small generative adversarial network on the global model’s output layer, which the attacker sees every round, then submits fake output layer weights that look statistically normal. The regularization attack flips the training objective so the local Q network learns to prefer the worst action, while an L2 penalty keeps its weights close to the global model so it does not stand out.
How much damage did the attacks do in the paper?
With 3 of 20 small cells compromised, the GAN attack cut system throughput by 36.5 percent and energy efficiency by 28.7 percent. The regularization attack cut throughput by 69.3 percent and energy efficiency by 79.5 percent. A plain data poisoning baseline cut them by only 10.2 and 3.9 percent.
How does the knowledge distillation defense protect each base station?
Every station keeps a meme model, a copy of the latest global model. It compares the policies of its local and meme models with a KL divergence. When they are close, the local model distills from the meme model. When they differ by more than a threshold, the station trains only on its own data and pushes the meme model toward its local policy before uploading it.
Does the theoretical bound in Proposition 1 hold?
Not as printed. The energy term E0 leaves out the softmax normaliser, so it is the true minimum KL needed to flip an action multiplied by the sum of exponentiated Q values, which grows with the reward scale. The bound also uses an average over states where a valid bound needs the smallest value, and near ties make that value approach zero.
Is there code for this paper?
The authors did not release code. This article includes an independent PyTorch reimplementation with a toy heterogeneous network, federated DQN clients, all three attacks, the Krum, autoencoder and meme model defenses, a local training baseline, and a numerical check of the Proposition 1 quantities.
Read the paper by Zhang, Zhou, Elsayed, Bavand, Gaigalas, Ozcan and Erol-Kantarci, accepted in IEEE Transactions on Wireless Communications, or the authors’ earlier workshop study of attacks on the same cell sleep scenario.
Read the paper Earlier workshop paperZhang H., Zhou H., Elsayed M., Bavand M., Gaigalas R., Ozcan Y., Erol-Kantarci M. Intelligent attacks and defense methods in federated learning enabled energy efficient wireless networks. Accepted in IEEE Transactions on Wireless Communications. Preprint arXiv:2504.18519, 2025.
This analysis is based on the published paper and an independent evaluation of its claims.

Pingback: 7 Breakthroughs & 1 Critical Flaw in DSCA: The Ultimate Digital Subtraction Angiography Dataset and Model for Cerebral Artery Segmentation - aitrendblend.com
Pingback: 15× Faster & Smarter: The Revolutionary One-Class Classifier Fusion That Outperforms (And What Slows Others Down) - aitrendblend.com