What Is a Second Pass Through the Same Layer Worth?

A graphics card can only hold so many weights. I can spend 50 million parameters on ten fairly wide layers, or I can make each layer narrower and fit twenty. I can also send the text through a layer twice. That gives the model another round of computation while storing just one set of weights. I tried all three approaches and measured what they cost.

Ten wide layers or twenty narrow ones?

The original model had ten layers, each 640 numbers wide. Reducing the width to 448 let me fit twenty layers at about the same parameter count. After 300 million tokens, the deeper model scored 1.1330 bits per byte (BPB), exactly the two-run average for the original. Lower is better. The deeper model processed about 137,000 tokens per second on my card, compared with 164,000 for the original. Its extra attention work and smaller matrices made it slower. At this training budget I kept the ten-layer design.

Running the middle layers twice

I let the first and last layers run once and varied how many times the model used the layers in between. All four models below read 300 million tokens. A value of 1.00 in the compute column is the work the normal ten-layer model does per token.

Layers and passes Parameters Relative compute per token Validation BPB
6 layers, one pass each 32.5M 0.63 1.1638
6 layers, middle 4 used twice 32.5M 1.00 1.1497
10 layers, one pass each 50.7M 1.00 1.1330
10 layers, middle 8 used twice 50.7M 1.73 1.1257

With a limit of 32.5M parameters, a second pass through the middle four layers helped. The score fell from 1.1638 to 1.1497. With enough memory for ten independent layers, the ten-layer model did better at the same compute, reaching 1.1330. Running the middle eight of those layers twice improved the score a little further, at the cost of 73% more work per token.

Could I train with two passes and ask for a third when a passage is difficult? The ten-layer model scored 1.126 with the two passes it had learned to use, 1.151 with three, and 1.192 with four. I also trained a six-layer model with a random choice of one to four passes. It could then cope with different pass counts, but gained little from the extra passes. Finally I took a trained v1 model, made it reuse its middle layers, and continued training for 200M tokens. It scored 1.0723. The same compute bought about 347M tokens of ordinary continued training, which reached 1.0657.

Giving the model a second token to predict

My usual training task asks for the next token. I added a small module that took the model's representation at the current position and the next token from the training text. Its job was to predict the token after that. This is called multi-token prediction, or MTP. I could discard the extra module after training.

At a billion tokens, the MTP run scored 1.0592 against a three-run average of 1.0624 for ordinary training. Each token cost about 19% more compute. Partway through training, while the learning rate was constant, I compared at equal compute. MTP scored 1.1363 at step 4,000. The ordinary model could afford 4,750 steps and scored 1.1318. I did not run an equal-compute comparison through the final cooldown.

Reviewing the code uncovered another wrinkle. The two runs used the same random seed and read the text in the same order. But creating the extra module consumed random numbers before the shared network was initialized, so 51 of its weight tensors started with different values. I fixed the initialization for future runs. The recorded 0.0032 BPB improvement at a billion tokens could partly reflect that change in starting weights. For the long training run, I kept v1. Model implementation · Architecture experiments