Part V Chapter 22
Experiments on generated chips
Contents
Chapter 18 ended Part 4 with questions the real datasets couldn’t answer, because each of them is one chip with one noise level and one kind of masking. Does every masked chip produce a plateau and a jump, or only some? ESHARD’s network stayed at the easy step; was that the noise? And the paper suggests masking in a prime field, where the rule that makes parity easy breaks: does that stop a network from learning, or only slow it down?
With the generator of Chapter 20 each question becomes a set of chips that differ in one setting, and with the detector of Chapter 19 each training curve gets the same reading without anyone looking at it.
The experiment
The network and training are those of Chapter 11, with 50,000 training traces, now for 60 epochs. The chips vary in three settings:
- Noise: 0.05, 0.1, 0.2, 0.3 (the default), 0.45 and 0.6.
- Shares: one (no masking: the chip handles the secret value itself), two, or three, combined with XOR.
- Leakage: the Hamming weight of each byte, or a weighted sum of its bits.
That is 36 chips, each trained from three random starts: 108 networks. For each run we record the best perceived information on the test traces, and how the network got there. It learned at once if it had half of its best by the end of the first epoch, or in a jump that started by epoch 2. It waited if half of its best came in a single jump the detector marks later; the wait is the number of epochs before that jump. It learned nothing if it never got above 0.02 bits.
No mask: at once
Without masking, the network learns at once at every noise level and with both kinds of leakage, with 87% to 94% of its best after the first epoch. With Hamming-weight leakage at the lowest noise it reaches 2.56 bits, everything the test labels hold. With bit-weighted leakage it tops out at 1.6 bits even at the lowest noise, because the pulse doesn’t follow the Hamming weight.
So the plateau isn’t something this network does on any chip. It comes with the masking.
Two shares: the wait grows with the noise
With two shares and Hamming-weight leakage the network can learn all there is to learn from the two weights: 1.15 bits at noise 0.05 and 0.1, exactly what Chapter 11 computed for two weights read perfectly. How it gets there depends on the noise:
| Noise | Wait before the jump (three seeds) | Best perceived information | Best possible parity guess |
|---|---|---|---|
| 0.05 | 0, 0, 1 epochs | 1.15 bits | 100% |
| 0.1 | 0, 2, 3 | 1.14–1.15 | 100% |
| 0.2 | 3, 4, 4 | 0.95–0.96 | 97% |
| 0.3 | 6, 9, 9 | 0.47 | 81% |
| 0.45 | no second step | 0.09 | 60% |
| 0.6 | no second step | 0.07 | 53% |
The last column is the best possible accuracy on the label’s parity from the two share cycles, the ceiling of Chapter 20. As it shrinks from 100% to 81%, the wait grows from nothing to nine epochs. At 60% the second step never comes, not in 60 epochs and not in 200: we trained the three networks at noise 0.45 for 200 epochs, and parity information stayed at zero while perceived information on the test traces fell to between −0.05 and 0.01 bits, and on the training traces rose to about 0.25. Instead of learning parity, they memorized.
This fits the two-piece model of Chapter 11, where the wait grows as the pieces start smaller and pay off less: the noisier the readings of the two weights, the less parity built on them is worth, and the longer the network takes to start building it. Past some point it doesn’t start at all within any training we tried.
It also answers Chapter 18’s question about ESHARD. A network on a chip with two Hamming-weight shares and enough noise stays at the easy step, high versus low, and that is what ESHARD’s network did. That doesn’t prove noise is the reason on ESHARD, a different chip and network, but noise alone is enough to produce the same behaviour.
Three shares: mostly nothing
With three shares, 17 of the 18 runs learned nothing in 60 epochs. The exception is one run at the lowest noise: it sat at zero for 20 epochs, then jumped in epochs 21 to 27 to 0.98 bits, almost all of it parity, and reached 0.99 bits by epoch 200. The other two runs at that noise, and all three at noise 0.1, still had nothing after 200 epochs.
So at low enough noise three shares can be learned by this network, and when they are, it is in a jump after a long plateau, longer than for two shares at any noise. But two of three starts never got there, and at noise 0.1 none did. With three shares, whether the jump comes at all depended on the random start more than on the chip, and a curve that is still flat after 200 epochs doesn’t say the chip is safe: the same chip, trained from another start, may be broken.
Bit-weighted leakage: no parity
With bit-weighted leakage and two shares, the network never learns parity (at most 0.016 bits of it, in any run), as the ceiling of Chapter 20 predicted. It learns 0.07 to 0.23 bits depending on the noise, in a gradual rise or a small first step, with no plateau and no jump. With three shares it learns nothing.
Masking with addition
The paper suggests masking in a prime field, where shares add up modulo a prime instead of being XORed. We trained the same network on chips whose two shares add up modulo 256 or modulo 257, with Hamming-weight leakage, at the four lowest noise levels, three seeds each:
| Noise | XOR | Addition mod 256 | Addition mod 257 |
|---|---|---|---|
| 0.05 | 1.15 bits | 0.11–0.12 | 0.11 |
| 0.1 | 1.14–1.15 | 0.10–0.11 | 0.09–0.11 |
| 0.2 | 0.95–0.96 | 0.08 | 0.08 |
| 0.3 | 0.47 | 0.06 | 0.05–0.06 |
Addition doesn’t slow the network down: there is no plateau, and about three quarters of what it learns is there by epoch 10. It limits what there is to learn. With addition, the exact Hamming weights of the two shares say only 0.14 bits about the label’s weight (0.13 modulo 257), against 1.15 with XOR: carries scramble the relation between the weights of the shares and the weight of their sum. At the lowest noise the network gets 0.11 to 0.12 of those 0.14 bits modulo 256, and 0.11 of the 0.13 modulo 257.
On a chip that leaks Hamming weights, then, masking by addition doesn’t merely make the network’s job harder; it removes most of what the weights can say. Whether the modulus is prime makes no difference here. A chip that leaks more than the weight of each share, every bit separately for instance, would leave more to learn, and this experiment doesn’t test that.
What it doesn’t do
Everything here is one network and one recipe: Chapter 11’s four layers of 40 neurons, 50,000 traces, the same learning rate and weight penalty. A larger network, more traces, or another optimizer could move every boundary in the map. Three seeds per chip show how much starts differ, but not the odds precisely.
The noise levels are six points, so where exactly the second step stops arriving, between 0.3 and 0.45, isn’t pinned down.
And the chips are simulations, with the limits listed in Chapter 20.
What next?
All of Part 5 ran on simulated chips. The last step is a real one: recording traces from a board on a desk, with masks we chose, and running the whole pipeline on them. Chapter 23 will do that.