CoolFace
Modelpublic

hrezaei/T5LA

sourceHugging Faceupdated 25d agoView on Hugging Face
0likes160downloads
Model Card

<!-- This model card has been generated automatically according to the information the Trainer had access to. You should probably proofread and complete it, then remove this comment. -->

T5LA

This model is part of the work published in the paper Interactive Text Games: Lookahead Is All You Need!

Four models are introduced in the above paper:

These models are implemented in this repository which is a customized version of nanoGPT.

The same variations are also implemented in this fork of Transformers library, on top of Google-t5/T5 implementation. These models are also trained and published as follows:

All the above models are on the scale of GPT2 (~100M parameters). The work is in progress to train them on larger scales.

Model description

This model is not fine-tuned on any instruction or human feedback datasets. It is just pre-trained on the HuggingFaceFW/fineweb sample-10BT dataset. It achieves the following results on the evaluation set:

  • —Loss: 5.5467
  • —Accuracy: 0.0322

Since the above fork is not merged into the main Transformers library yet, if you need to load it with AutoModel.frompretrained(), you need to first install Transformers from [this branch](https://github.com/HRezaei/transformers/tree/feature/lookaheadmodels), which contains the code for T5LA models. This can be done by:

shell
pip install git+https://github.com/HRezaei/transformers.git@feature/lookahead_models

Intended uses & limitations

The model is designed to predict not only the next immediate token after the prompt (which normal LLMs do), but also to predict the second, third, ..., up to K next tokens, conditioned on the prompt. These future predictions can be useful for approximated ranking, where a set of potential responses are needed to be ranked based on the approximated probability of their tokens conditioned on the prompt, rather than conditioned on their previous tokens.

The main limitation is that future predictions are generaly not suitable for generating text, as they don't consider token interdependencies, i.e. the future tokens are not conditioned on the previous tokens. Thus, for generation, one should rely only on the next immediate token. However, the quality of next immediate token prediction is also degraded, because during training, the loss function has more terms to minimize (one term for next immediate token like original LLMs, and one extra term per each future tokens).

Training and evaluation data

This model is not fine-tuned on any instruction or human feedback datasets. It is just pre-trained on the HuggingFaceFW/fineweb sample-10BT dataset. It achieves the following results on the evaluation set:

  • —Loss: 5.5467
  • —Accuracy: 0.0322

Training procedure

Training hyperparameters

The following hyperparameters were used during training:

  • —learning_rate: 5e-05
  • —trainbatchsize: 8
  • —evalbatchsize: 8
  • —seed: 42
  • —distributed_type: multi-GPU
  • —num_devices: 2
  • —totaltrainbatch_size: 16
  • —totalevalbatch_size: 16
  • —optimizer: Use adamwtorch with betas=(0.9,0.999) and epsilon=1e-08 and optimizerargs=No additional optimizer arguments
  • —lrschedulertype: linear
  • —training_steps: 200000
  • —mixedprecisiontraining: Native AMP

Training results

Training LossEpochStepAccuracyValidation Loss
9.40560.0110000.04359.1215
8.40620.0220000.04438.1939
7.73070.0330000.04447.6024
7.390.0440000.04447.3338
7.25460.0550000.04417.2452
7.19850.0660000.03697.1682
7.10090.0770000.03467.0718
7.0040.0880000.03326.9778
6.91590.0990000.03256.8964
6.85480.1100000.03256.8307
6.78330.11110000.03266.7702
6.73760.12120000.03376.7163
6.68210.13130000.03466.6615
6.63730.14140000.03496.6086
6.58950.15150000.03446.5569
6.54210.16160000.03546.5119
6.50510.17170000.03556.4678
6.43910.18180000.03606.4324
6.42420.19190000.03556.4015
6.38890.2200000.03736.3553
6.36310.21210000.03676.3285
6.32960.22220000.03696.3015
6.30810.23230000.03646.2699
6.27840.24240000.03706.2454
6.25890.25250000.03746.2167
6.23710.26260000.03706.1890
6.19780.27270000.03766.1660
6.18950.28280000.03756.1378
6.16360.29290000.03666.1213
6.12620.3300000.03706.0967
6.13450.31310000.03616.0745
6.10960.32320000.03606.0556
6.07940.33330000.03576.0413
6.06430.34340000.03636.0136
6.0570.35350000.03625.9965
6.03370.36360000.03545.9806
6.02170.37370000.03635.9584
6.00450.38380000.03595.9526
5.98960.39390000.03555.9288
5.97110.4400000.03525.9152
5.96290.41410000.03495.8962
5.94650.42420000.03595.8821
5.94630.43430000.03455.8692
5.93170.44440000.03435.8699
5.90971.0034450000.03465.8483
5.91071.0134460000.03485.8352
5.88381.0234470000.03435.8188
5.8871.0334480000.03405.8086
5.85631.0434490000.03385.7971
5.85761.0534500000.03395.7968
5.85671.0635510000.03435.7797
5.8411.0735520000.03375.7677
5.81921.0835530000.03325.7613
5.82141.0935540000.03385.7486
5.81661.1035550000.03385.7409
5.8061.1135560000.03335.7342
5.79611.1235570000.03355.7236
5.78471.1335580000.03335.7164
5.7871.1435590000.03305.7096
5.77111.1535600000.03285.7035
5.76991.1635610000.03315.6888
5.7631.1734620000.03345.6875
5.74341.1835630000.03305.6809
5.74771.1934640000.03295.6686
5.74091.2034650000.03305.6624
5.7371.2134660000.03395.6758
5.7291.2234670000.03265.6546
5.72321.2334680000.03295.6467
5.71271.2434690000.03295.6449
5.71871.2534700000.03295.6352
5.7171.2634710000.03265.6264
5.7141.2734720000.03305.6219
5.70791.2834730000.03305.6169
5.70341.2934740000.03265.6131
5.67681.3034750000.03255.6125
5.69551.3135760000.03285.6075
5.69471.3235770000.03255.6017
5.70561.3335780000.03235.5956
5.66361.3435790000.03265.5921
5.67231.3535800000.03265.5881
5.6591.3635810000.03245.5823
5.67291.3735820000.03265.5795
5.65951.3835830000.03225.5794
5.65651.3935840000.03285.5758
5.66491.4034850000.03255.5716
5.65611.4135860000.03215.5695
5.64051.4234870000.03235.5654
5.64821.4335880000.03215.5628
5.64251.4434890000.03235.5622
5.63792.0069900000.03235.5582
5.63572.0169910000.03225.5573
5.63812.0269920000.03205.5568
5.64272.0369930000.03245.5526
5.63642.0469940000.03235.5526
5.6262.0569950000.03215.5501
5.6362.0669960000.03245.5492
5.6322.0769970000.03235.5489
5.61332.0869980000.03235.5479
5.62912.0969990000.03235.5477
5.62712.10691000000.03225.5470

Framework versions

  • —Transformers 4.49.0.dev0
  • —Pytorch 2.5.1+cu121
  • —Datasets 3.2.0
  • —Tokenizers 0.21.0