News for hackers. Stuff that matters.
Re:Simplifying Transformer Blocks by Bayes7 on Tuesday November 28, 2023 @03:41AM (#38443677)
"[...] modern neural network (NN) architectures have complex designs with many components [...]"

I find the Transformer architecture actually very simple compared to previous models like LSTMs or other recurrent models. You could argue that their vision counterparts like ViT are conceptually maybe even simpler than ConvNets?

Also, can someone explain why they are so keen to remove the skip connections? At least when it comes to coding, nothing is simpler than adding a skip connection and computationally the effect should be marginal?

Re:Simplifying Transformer Blocks by SuchAnonMuchWow on Tuesday November 28, 2023 @04:47AM (#38444125)
Skip connection increase the live range of one intermediate result across the whole part of the network skiped: the tensor at the beginning of a skip connection must be stored in memory for longer while unrelated computation happen: it increase the pressure on the memory hierarchy (either the L2, or scratchpad memory).

This is especially true for example for inference for vision transformers, where it decrease the batch size you can use before hitting the L2 capacity wall.

Re:Simplifying Transformer Blocks by Bayes7 on Tuesday November 28, 2023 @06:47AM (#38444747)
Okay, I see that for inference. But for training it shouldn't matter because I need to hold on to all my activations for my backwards pass anyways? But yeah, fair point!
Re:Simplifying Transformer Blocks by jksk61 on Tuesday November 28, 2023 @05:32AM (#38444352)
also removing skip connections leads to a rougher loss landscape, hence it should be harder to find the optimal weights.
Re:Simplifying Transformer Blocks by sdenton4 on Tuesday November 28, 2023 @06:09AM (#38444565)
Yes there's very good theoretical reasons for skip connections. If your initial matrix M is noise centered at 0, then 1+M is a noisy identity operation, while 0+M is a noisy deletion... It's better to do nothing if you don't know what to do, and avoid destroying information.

I appreciate the sibling comment perspective that memory pressure is a problem, but that can be mediated by using fewer/longer skip connections across blocks of layers.