Part V Chapter 21

The automatic pipeline

Contents
  1. Five steps
  2. On the default chip
  3. Where the hand choice fails
  4. On the other chips
  5. What the check can and can’t tell
  6. What it doesn’t do
  7. What next?

Chapter 14 read the weights of the masks out of a network, but a person made three choices along the way: which layer to look at (the first, before its ReLU), which plane in it (its first two principal components), and how the two shares combine into the label (XOR, through the table of Chapter 12). Each choice came from looking at the network first. An evaluator facing dozens of networks can’t do that for each one, and a choice that fits one network may not fit the next.

This chapter replaces all three with a search, chains it to the detector of Chapter 19, and runs the whole thing on the generated chips of Chapter 20, where the masks are known and the answers can be scored.

Five steps

The pipeline gets what an evaluator has: a network’s checkpoints, the attack traces, and their labels. Not the masks.

  1. When. Run the detector on the curve of perceived information. If it marks nothing, stop: there is no jump to explain. Otherwise take two checkpoints: the one where the last jump ends, and the one just before it starts.
  2. What. Split the network’s information into its two parts from Chapter 12: high versus low, and parity. Comparing the two checkpoints says which part the jump brought.
  3. Where. At the checkpoint after the jump, take every hidden layer before its ReLU, and in each one every pair among its first six principal components: 60 planes. Turn each plane, as in Chapter 14, until the two weights it implies predict the labels best through a table, trying two tables: XOR, and addition modulo 256. Keep the plane and the table that fit best.
  4. Read. Pin each axis of that plane at one end and read the other share’s weight from the network’s answers, as in Chapter 14. Orient each reading so that it rises with the trace where it leaks, and name the one that leaks first the mask.
  5. Check. Without the masks, ask three things. Does each reading leak in the trace more than any of 100 random shuffles of it? Do the two leak at different samples? And put back through the table, do they predict the labels better than they predict any of 100 shuffles of the labels?

Steps 3 to 5 use different traces. The plane is chosen on half of the 5,000 test traces, and everything after it is measured on the other half, so that a plane chosen for fitting by chance can’t also pass the check by chance.

Step 1 of the pipeline: when00.4916110203040epoch; perceived information on test traces

The detector marks epochs 1 to 4 and epochs 10 to 16. The pipeline takes the checkpoint where the last jump ends, epoch 16, and the one before it starts, epoch 9.

On the default chip

Five networks trained on the default chip from five random starts, for 40 epochs each. The detector finds the jump in all five, ending between epochs 10 and 16.

Where. In all five, the search picks layer 1, components 1 and 2, and the XOR table: exactly what Chapter 14 chose by hand. Out of 60 planes, that one fits the labels best every time, with a correlation of 0.35.

Read. After the jump, the readings are exact for 85% to 89% of the held-out traces, and correlate 0.96 to 0.97 with the true weights. The mask is named correctly in all five: the first reading leaks at sample 12, in the mask’s cycle, and the second at sample 32. At epoch 40 they match Chapter 14’s 88%. Guessing at random in the right proportions would be exact 20% of the time.

What. Before the jump the network already carries the two weights: the same search reads them 80% to 86% exactly at the checkpoint before the jump. What the jump changes is parity. Information about it goes from between 0.002 and 0.04 bits before the jump to between 0.25 and 0.31 after, while high versus low barely moves, from about 0.10 to 0.11. The pipeline arrives at Chapter 12’s conclusion on its own: the jump is parity arriving, built from readings the network already had.

Where the hand choice fails

With up to 2 samples of jitter, Chapter 14’s choice stops working. On layer 1’s first two components the best table fits the labels with a correlation of only 0.10 to 0.14, and the readings it gives are exact for 15% to 55% of traces, one of them running opposite to the truth (correlation −0.63).

The search moves on its own to layer 2, again to its first two components and the XOR table, which fit 0.33 to 0.34. The readings there are exact for 63% to 80% of traces after the jump, and correlate 0.90 to 0.95 with the true weights. By epoch 40 they reach 75% to 82%. A plausible reason is that a shifted pulse spreads each share’s weight over several neurons of layer 1, and layer 2 is where the network has gathered it back. Whatever the reason, the layer where the shares are easiest to read depends on the chip, and a fixed choice would miss it.

On the other chips

On the chips where only the first step happens, the pipeline treats that step as the jump and reads at its end:

ChipRuns with a jumpPlane chosenTableExactCorrelation with truth
default5 of 5layer 1, 1+2XOR85–89%0.96–0.97
jitter of ±2 samples3 of 3layer 2, 1+2XOR63–80%0.90–0.95
addition mod 2562 of 3layer 1, 1+2addition46–58%0.73–0.84
bit-weighted leakage3 of 3layer 1, 1+2XOR57–58%0.94–0.95
twice the noise3 of 3layer 1, 1+2XOR55–57%0.86–0.88
three shares0 of 1
shuffled cycles0 of 1

With addition the search picks the addition table every time, without being told how the chip masks. Its readings are rougher, as expected from a network that only learned 0.05 bits.

With bit-weighted leakage only 57% of the readings give the exact Hamming weight, but they correlate 0.94 with what the chip actually leaks, the weighted sum of the bits. The pipeline reads what the network reads, and on this chip that isn’t the Hamming weight.

On three shares and shuffled cycles there is no jump and the pipeline stops, which is right: the network found nothing. On one of the addition runs it also stops, which is wrong: that network did learn about 0.05 bits, slowly enough that the detector saw no jump.

What the check can and can’t tell

After the last jump, all 16 runs that got that far pass the check. At the first epoch of the chips with only one step, when the network has barely started, four of eight runs fail it: their readings, put through the table, predict the held-out labels no better than shuffled labels.

But the check also passes the hand choice’s readings on the jittered chip, the ones that are exact for 15% to 55% of traces. Readings that come from a trained network always leak somewhere in the trace and always predict the labels a little. The check says that the network holds something there. It can’t say that it is the masks.

What separated right from wrong on the jittered chip was how well the table fit: 0.29 to 0.34 on the held-out traces for the search’s plane, 0.11 to 0.12 for the hand choice. The search picks the best fit by design, and that comparison is what made it right. On its own, though, the size of the fit isn’t a test either: the correct readings on the addition chip fit only 0.12 to 0.13, because the network knows little and the addition table is flatter.

What it doesn’t do

It assumes two shares, leakage that grows with the bits of each share, and one of two ways to combine them. A chip with three shares, or a combination not on the list, gets no hypothesis that fits, and the pipeline would report the best of wrong answers.

It needs a jump. A network that learns slowly, without one, is skipped.

It was tested only on generated chips. The real networks of Part 4 were read by hand with these same steps; running the pipeline itself on them is the obvious next test, and isn’t done here.

What next?

The pipeline and the generator together can answer questions that need many networks: which chips does the network learn in steps, and which in one smooth rise or not at all? How does that depend on the noise, the number of shares, and the way the chip leaks? Chapter 22 maps it.