Study the paper
Scaling Laws for Neural Language Models
Lessons, visuals, quizzes, flashcards, and resourcesāorganized in teaching order.
Hyperparameter and Shape Independence
Hyperparameter and Shape Independence
Hyperparameter and Shape Independence
Robustness to Architectural Hyperparameters
Sources
S3.F5
Figure 5: Performance depends very mildly on model shape when the total number of non-embedding parameters NšN is held fixed. The loss varies only a few percent over a wide range of shapes. Small differences in parameter counts are compensated for by using the fit to Lā(N)šæšL(N) as a baseline. Aspect ratio in particular can vary by a factor of 40 while only slightly impacting performance; an (nlayer,dmodel)=(6,4288)subscriptšlayersubscriptšmodel64288(n_{\mathrm{layer}},d_{\mathrm{model}})=(6,4288) reaches a loss within 3% of the (48,1600)481600(48,1600) model used in [RWC+19].
Transformer performance depends very weakly on specific architectural hyperparametersāsuch as the number of layers , the number of attention heads , or the dimension of the feed-forward layers āwhen the total non-embedding parameter count is held constant.
Sources
S3.SS1.p1.10
Transformer performance depends very weakly on the shape parameters nlayer,nheadssubscriptšlayersubscriptšheadsn_{\rm layer},n_{\rm heads}, and dffsubscriptšffd_{\rm ff} when we hold the total non-embedding parameter count NšN fixed. To establish these results we trained models with fixed size while varying a single hyperparameter. This was simplest for the case of nheadssubscriptšheadsn_{\rm heads}. When varying nlayersubscriptšlayern_{\rm layer}, we simultaneously varied dmodelsubscriptšmodeld_{{\rm model}} while keeping Nā12ānlayerādmodel2š12subscriptšlayersuperscriptsubscriptšmodel2N\approx 12n_{\rm layer}d_{{\rm model}}^{2} fixed. Similarly, to vary dffsubscriptšffd_{\rm ff} at fixed model size we also simultaneously varied the dmodelsubscriptšmodeld_{{\rm model}} parameter, as required by the parameter counts in Table 1. Independence of nlayerssubscriptšlayersn_{\rm layers} would follow if deeper Transformers effectively behave as ensembles of shallower models, as has been suggested for ResNets [VWB16]. The results are shown in Figure 5.
For example, the aspect ratio of the model can vary by a factor of 40 with only a negligible impact on performance. A very shallow and wide model can achieve performance within 3% of a much deeper, narrower baseline model of the same total size . This independence suggests that deeper Transformers may behave similarly to ensembles of shallower models.
Sources
S3.F5
Figure 5: Performance depends very mildly on model shape when the total number of non-embedding parameters NšN is held fixed. The loss varies only a few percent over a wide range of shapes. Small differences in parameter counts are compensated for by using the fit to Lā(N)šæšL(N) as a baseline. Aspect ratio in particular can vary by a factor of 40 while only slightly impacting performance; an (nlayer,dmodel)=(6,4288)subscriptšlayersubscriptšmodel64288(n_{\mathrm{layer}},d_{\mathrm{model}})=(6,4288) reaches a loss within 3% of the (48,1600)481600(48,1600) model used in [RWC+19].
S3.SS1.p1.10
Transformer performance depends very weakly on the shape parameters nlayer,nheadssubscriptšlayersubscriptšheadsn_{\rm layer},n_{\rm heads}, and dffsubscriptšffd_{\rm ff} when we hold the total non-embedding parameter count NšN fixed. To establish these results we trained models with fixed size while varying a single hyperparameter. This was simplest for the case of nheadssubscriptšheadsn_{\rm heads}. When varying nlayersubscriptšlayern_{\rm layer}, we simultaneously varied dmodelsubscriptšmodeld_{{\rm model}} while keeping Nā12ānlayerādmodel2š12subscriptšlayersuperscriptsubscriptšmodel2N\approx 12n_{\rm layer}d_{{\rm model}}^{2} fixed. Similarly, to vary dffsubscriptšffd_{\rm ff} at fixed model size we also simultaneously varied the dmodelsubscriptšmodeld_{{\rm model}} parameter, as required by the parameter counts in Table 1. Independence of nlayerssubscriptšlayersn_{\rm layers} would follow if deeper Transformers effectively behave as ensembles of shallower models, as has been suggested for ResNets [VWB16]. The results are shown in Figure 5.