CoolFace
Modelpublic

stefanbschneider/led-base-16384-lfqa-ans-len-512

sourceHugging Faceapache-2.0updated 2y agoView on Hugging Face
0likes29downloads
Model Card

Longformer Encoder-Decoder (LED) Fine-tuned for Generative Q&A

This model uses Allenai's Longformer Encoder-Decoder (LED) as base model, which supports very long contexts. It is trained to generate answers to questions based on given contexts with answers of up to 512 tokens.

This model is a fine-tuned version of allenai/led-base-16384 on the long-form question answering (LFQA) dataset stefanbschneider/lfqa-max-answer-length-512.

I used the script `led-finetune-lfqa-train.py` in this repo to fine-tune the model on a GTX 4070s Ti.

For details, see my blog post: [Fine-Tuning a Pre-Trained LLM](https://stefanbschneider.github.io/blog/posts/llm-fine-tuning/)

Intended uses & limitations

Intended use: Generative/abstractive question answering with potentially very long contexts and multi-sentence answers.

Limitations: Limited training/fine-tuning, i.e., the model tends to ramble and the generated answers do not always make sense.

Training and evaluation data

The model was fine-tuned on stefanbschneider/lfqa-max-answer-length-512. Due to limited resources, I only trained on 50% of the full training set for only one epoch and performed evaluation on a small, fixed subset of the validation set.

It achieves the following results on the subset of the evaluation set:

  • —Loss: 3.2574
  • —Rouge2: 0.0416

Training procedure

Training hyperparameters

The following hyperparameters were used during training:

  • —learning_rate: 5e-05
  • —trainbatchsize: 2
  • —evalbatchsize: 2
  • —seed: 42
  • —optimizer: Use adamwtorch with betas=(0.9,0.999) and epsilon=1e-08 and optimizerargs=No additional optimizer arguments
  • —lrschedulertype: linear
  • —num_epochs: 1
  • —mixedprecisiontraining: Native AMP

Training results

Training LossEpochStepValidation LossRouge2
3.66850.019710003.56480.0353
3.6410.039520003.52590.0366
3.5580.059230003.52240.0411
3.60130.078940003.48330.0327
3.59620.098650003.47950.0349
3.53250.118460003.48630.035
3.56180.138170003.46710.041
3.53440.157880003.45760.0339
3.5150.177590003.44830.038
3.46720.1973100003.44220.0343
3.4480.2170110003.43240.0369
3.51450.2367120003.43040.0353
3.45650.2565130003.41690.0382
3.44460.2762140003.40610.0376
3.52980.2959150003.39830.0368
3.4590.3156160003.39710.0387
3.48250.3354170003.39850.04
3.39530.3551180003.40340.0389
3.38490.3748190003.38780.0345
3.49790.3945200003.38900.038
3.46670.4143210003.37440.0381
3.41540.4340220003.38820.0376
3.41910.4537230003.35850.0437
3.43720.4734240003.35920.0395
3.45560.4932250003.35570.0384
3.42340.5129260003.35960.0386
3.4130.5326270003.35650.0329
3.38550.5524280003.34750.0388
3.44960.5721290003.33920.0372
3.44720.5918300003.33320.0405
3.41090.6115310003.32860.0413
3.41770.6313320003.31940.046
3.44290.6510330003.30430.0438
3.38350.6707340003.29920.0411
3.40860.6904350003.29840.04
3.41130.7102360003.29730.0393
3.39860.7299370003.29200.0418
3.37410.7496380003.29150.0391
3.34730.7694390003.28650.0434
3.36130.7891400003.27760.0429
3.34110.8088410003.28490.0385
3.27080.8285420003.27600.0411
3.37550.8483430003.27150.04
3.35510.8680440003.27340.0363
3.30640.8877450003.26780.0394
3.29620.9074460003.26630.0434
3.27610.9272470003.26580.0421
3.34950.9469480003.26260.0433
3.30160.9666490003.26000.0427
3.25450.9863500003.25740.0416

Framework versions

  • —Transformers 4.48.3
  • —Pytorch 2.5.1+cu121
  • —Datasets 3.2.0
  • —Tokenizers 0.21.0