TokenFormer: Rethinking Transformer Scaling with Tokenized Model Parameters

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ธ.ค. 2024

ความคิดเห็น • 9

  • @SiD-hq2fo
    @SiD-hq2fo 23 วันที่ผ่านมา +1

    really appreciate for explaining such papers, please keep them coming

  • @AM-yk5yd
    @AM-yk5yd 25 วันที่ผ่านมา +1

    8:00 "It's just MLP" yeah, I felt bamboolzed. MLP originally was upscale, relu, downscale; later got beautiful gradient-bearing curves of ReLU replacement and additional multiplication(eg GeGLU instead of GELU). Here during initial explanation I felt that up proj and down proj got renamed to K, V.
    It doesn't feel like cross attention at all as their K V don't depend on any part of the input.
    23:01 It may be because they moved lots parms around: finetuning MLP layers works so much worse than finetuning QKVO. By having MLP inside they have more parms to play a role on multi head attention which is still used.
    It also might be training. Their results at image classification feel feel more revealing than NLP tasks: dataset is way more fixed than "pick your favorite part of pile, filter bad parts" and models have the same weight class, and there is no different tokenizers(they use same with pythia so comparing ppl against it doesn't raise eyebrows)
    In ideal world they would also train at least pythia 160M from scratch on the same training data, but considering it's "up to 300B tokens", it's not exactly surprising they didn't. Also in ideal world they would put in ablation study "hey, let's not add non-linearity to Q K V proj and instead of new weights for 3 P-attentions we simply make dimension of heads bigger keeping around the same parm count"
    Also Pythia has an outdated MLP architecture: it use gelu, not geglu. P attention doesn't use GeGLU as well, but their architecture replaces MLP which already is replaced in modern LLMs.
    Speaking of their results in images: Their winning model in table 2 image classification has more parameters that ViT. If it's excluded, their small 86M model loses to another 86M model, though their 307M model still wins.
    (Also I remember trying somewhat similar but more naive idea on imdb dataset: replace Q,K,Vs proj with self attentions. Idea was walk toward super hierarchical nested attention: if you replace one Q projection with attention, you can go deeper and replace projection inside nested self-attn of Q with another attention and once walking over this inception is done the initial layer knows so well what token it has to attend to other token.
    Worked awful. Results were worse, number of parms went through the roof(as single proj got replaced with several, though will not be surprised if better hyper parms can make it at least bad rather than awful)

    • @AM-yk5yd
      @AM-yk5yd 24 วันที่ผ่านมา +1

      Oh, they actually did train transformer from scratch: "Table 6 compares Transformer models trained from scratch and Tokenformer trained by parameter
      reusing with varying amounts of seen tokens during training. It is evident that Transformers trained
      with the same number of seen tokens do not reach the performance level of Tokenformer with
      parameter reusing"
      Even if modern MLP would improve transformer results, training costs still seems to be much better which is really impressive

    • @gabrielmongaras
      @gabrielmongaras  20 วันที่ผ่านมา +1

      I think most of the results only look impressive because they slightly scale the model above the baseline. From the experiments I've done, it seems like the activation they develop is worse than normal GeLU and moving params from the MLP into the Q K V O projections performs the same given the same # of params.

  • @ak-cm5eu
    @ak-cm5eu 12 วันที่ผ่านมา +1

    Can I ask what tablet/app you use to produce these videos? Thank you!

  • @Ryu-ix8qs
    @Ryu-ix8qs 27 วันที่ผ่านมา +3

    Thanks

  • @rohollahhosseyni8564
    @rohollahhosseyni8564 26 วันที่ผ่านมา

    I think in pattention (cross-attention), the tokens can kinda communicate with each other, so it does not act like an MLP layer.

    • @gabrielmongaras
      @gabrielmongaras  26 วันที่ผ่านมา +3

      Pattention is mathematically the same as an MLP tho. Pattention has the following formulation:
      O = f(X K^T) V
      and a two layer MLP with an intermediate activation looks like the following:
      O = f(X W_1) W_2
      Since we are doing an inner product with the input and keys, "token interaction" is just a function applied on the input space R^d, of which there are n tokens, or rather n functions, if W_1 = K^T is of shape (d x n). Basically cross attention with learnable K,V is an MLP where the up projection is renamed to K, the down projection is renamed to V, and the activation is changed from GeLU to GeLU(Norm())

  • @f6y7t5
    @f6y7t5 24 วันที่ผ่านมา

    Diffusion forcing? Please