PHYSICAL PDF PAGE 17 / 17

                                  What Makes a Good Feedforward Computational Graph?



E. Models and Training

We test graphs on two different tasks: bit set parity, which is well known to be hard for transformer architectures without

Chain Of Thought (Kim & Suzuki, 2024) and finding the category of the maximum or second maximum element in the set.

We are interested in length generalisation properties of the tasks. So while we train on length up to 256 elements, we test

sequences of up to 1, 024 elements. We tuned the order-of-magnitude of the learning rate and the weight decay coefficient

using the fully-connected graph experiments only, and then reused the tuned parameters everywhere else.



E.1. Maximum Retrieval

For ’maximum’ tasks we utilise simple transformer architecture. It consists of one attention block, which is a single attention

layer followed by two feedforward layers with GELU activations and pre-norm in between. This attention block is repeated

(with shared parameters) for log n steps for an input of n nodes. We use the cross-entropy loss function and the AdamW

optimiser with 10−3 learning rate and 256 batch size. Training is performed over 10, 000 steps. We utilise casual attention

mask in conjunction with mask provided by graphs.



E.2. Parity

We use a model similar to Gemma 2 (Team et al., 2024b), but with only only 8 layers and using standard multi-head attention

with 8 heads, the vocabulary size was 2, as there are only 2 symbols in a bitstring, and the embedding dimension was 256.

The loss is a crossentropy and is computed over all positions in the sequence, so the model must predict the parity for all

prefixes of the input bitstring. To train the model we used the LaProp optimizer (Ziyin et al., 2021) with weight decay and

RMSClip (Shazeer & Stern, 2018) for 1 million steps, with batch size of 128 sequences. Our hyperparameters were:





                                               Table 1. LaProp Hyperparameters

                                                Hyperparameter        Value

                                                 Learning Rate      1 × 10−3

                                                      β1               0.9

                                                      β2               0.9

                                                 Weight Decay       5 × 10−4

                                                 RMSClip’s d            1





As an indication of the utility of various feedforward graphs in the setting where nodes correspond to natural language

tokens, we also fine-tuned Gemma 2B (Team et al., 2024a) – utilising these graphs as attention masks across all Transformer

layers – on the standard Wikipedia dataset4 containing texts obtained from Wikipedia database dumps.

After 3, 000 batches of training, we found that the perplexities obtained by the FS graph were comparable with the fully

connected graph, while significantly improving on the line graph—a trend which is consistent throughout training.









   4

       https://www.tensorflow.org/datasets/catalog/wikipedia



                                                              17

