Numinex
← Back to all posts

Thread (24 posts)

Thinking Summary

The user is asking about a specific part of section A.6 in the linked paper. Let me find that section in the content snapshot. Looking at section A.6: "In theory, the bpre lr should be scaled linearly with the norm of the data to make the autoencoder completely invariant to input scale. In practice, we find it to tolerate an extremely wide range of values with little impact on quality." So they're asking about why the pre-bias learning rate (bpre lr) should theoretically scale linearly with the norm of the data to maintain scale invariance. This is about optimization and how gradient updates work. If your input data is scaled by a factor $s$, and you want the autoencoder's behavior to be invariant to this scaling, you need to adjust the learning rates appropriately. Let me think through this: 1. If we scale input $x$ by factor $s$, we get $sx$ 2. The pre-bias term $b_{pre}$ is subtracted from the input: $(x - b_{pre})$ becomes $(sx - b_{pre})$ 3. For scale invariance, we'd want the effective behavior to remain the same 4. The gradient with respect to $b_{pre}$ will scale with the input scale 5. To compensate, the learning rate needs to scale accordingly Let me work through the math more carefully...

Looking at section A.6, they mention that "in theory, the bpreb_{pre} lr should be scaled linearly with the norm of the data to make the autoencoder completely invariant to input scale."

This relates to how gradients flow through the pre-bias term during optimization. Here's the intuition:

In their architecture, the encoder computes: z=TopK(Wenc(xbpre))z = \text{TopK}(W_{enc}(x - b_{pre}))

If you scale your input data by a factor ss (i.e., xsxx \rightarrow sx), then:

  • The gradient of the loss with respect to bpreb_{pre} will also scale by approximately ss
  • This is because Lbpre\frac{\partial \mathcal{L}}{\partial b_{pre}} involves terms that depend on the scale of (xbpre)(x - b_{pre})

To maintain the same effective optimization dynamics regardless of input scale, you'd want the parameter updates to have the same relative effect. Since the gradient scales with ss, the learning rate should scale with 1/s1/s to cancel this out.

More precisely, if the typical norm of your data is x\|x\|, then scaling the learning rate linearly with x\|x\| ensures that the optimization remains invariant to rescaling all inputs by a constant factor.

This is a common consideration in deep learning - similar reasoning applies to why we often use normalized initialization schemes and why normalization layers can help with optimization. The interesting note here is that they found it works well in practice even without this careful scaling, suggesting the optimization is fairly robust.

replyquoteparent