lexlms/legal-roberta-large

Model

LexLM large

15

33 commits

1 linked in READMEs

updated Aug 31, 2023

See the code

README

LexLM large

This model was continued pre-trained from RoBERTa large (https://huggingface.co/roberta-large) on the LeXFiles corpus (https://huggingface.co/datasets/lexlms/lex_files).

Model description

LexLM (Base/Large) are our newly released RoBERTa models. We follow a series of best-practices in language model development:

  • We warm-start (initialize) our models from the original RoBERTa checkpoints (base or large) of Liu et al. (2019).
  • We train a new tokenizer of 50k BPEs, but we reuse the original embeddings for all lexically overlapping tokens (Pfeiffer et al., 2021).
  • We continue pre-training our models on the diverse LeXFiles corpus for additional 1M steps with batches of 512 samples, and a 20/30% masking rate (Wettig et al., 2022), for base/large models, respectively.
  • We use a sentence sampler with exponential smoothing of the sub-corpora sampling rate following Conneau et al. (2019) since there is a disparate proportion of tokens across sub-corpora and we aim to preserve per-corpus capacity (avoid overfitting).
  • We consider mixed cased models, similar to all recently developed large PLMs.

Intended uses & limitations

More information needed

Training and evaluation data

The model was trained on the LeXFiles corpus (https://huggingface.co/datasets/lexlms/lexfiles). For evaluation results, please consider our work "LeXFiles and LegalLAMA: Facilitating English Multinational Legal Language Model Development" (Chalkidis* et al, 2023).

Training procedure

Training hyperparameters

The following hyperparameters were used during training:

  • learning_rate: 0.0001
  • train_batch_size: 8
  • eval_batch_size: 8
  • seed: 42
  • distributed_type: tpu
  • num_devices: 8
  • gradient_accumulation_steps: 4
  • total_train_batch_size: 256
  • total_eval_batch_size: 64
  • optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
  • lr_scheduler_type: cosine
  • lr_scheduler_warmup_ratio: 0.05
  • training_steps: 1000000

Training results

Training LossEpochStepValidation Loss
1.13220.05500000.8690
1.01370.11000000.8053
1.02250.151500000.7951
0.99120.22000000.7786
0.9760.252500000.7648
0.95940.33000000.7550
0.95250.353500000.7482
0.91520.44000000.7343
0.89440.454500000.7245
0.8930.55000000.7216
0.89971.025500000.6843
0.85171.076000000.6687
0.85441.126500000.6624
0.85351.177000000.6565
0.80641.227500000.6523
0.79531.278000000.6462
0.80511.328500000.6386
0.81481.379000000.6383
0.80041.429500000.6408
0.80311.4710000000.6314

Framework versions

  • Transformers 4.20.0
  • Pytorch 1.12.0+cu102
  • Datasets 2.7.0
  • Tokenizers 0.12.0

Citation

Ilias Chalkidis*, Nicolas Garneau*, Catalina E.C. Goanta, Daniel Martin Katz, and Anders Søgaard. LeXFiles and LegalLAMA: Facilitating English Multinational Legal Language Model Development. 2022. In the Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics. Toronto, Canada.

@inproceedings{chalkidis-garneau-etal-2023-lexlms,
    title = {{LeXFiles and LegalLAMA: Facilitating English Multinational Legal Language Model Development}},
    author = "Chalkidis*, Ilias and 
              Garneau*, Nicolas and
              Goanta, Catalina and 
              Katz, Daniel Martin and 
              Søgaard, Anders",
    booktitle = "Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics",
    month = july,
    year = "2023",
    address = "Toronto, Canada",
    publisher = "Association for Computational Linguistics",
    url = "https://arxiv.org/abs/2305.07507",
}
endpoints_compatible
fill-mask
legal
pytorch
roberta
tensorboard
transformers

Contributors

kiddothe2b

32 commits

jkao

1 commits

lexlms/legal-roberta-large

Model

LexLM large

15

33 commits

1 linked in READMEs

updated Aug 31, 2023

See the code

README

LexLM large

This model was continued pre-trained from RoBERTa large (https://huggingface.co/roberta-large) on the LeXFiles corpus (https://huggingface.co/datasets/lexlms/lex_files).

Model description

LexLM (Base/Large) are our newly released RoBERTa models. We follow a series of best-practices in language model development:

  • We warm-start (initialize) our models from the original RoBERTa checkpoints (base or large) of Liu et al. (2019).
  • We train a new tokenizer of 50k BPEs, but we reuse the original embeddings for all lexically overlapping tokens (Pfeiffer et al., 2021).
  • We continue pre-training our models on the diverse LeXFiles corpus for additional 1M steps with batches of 512 samples, and a 20/30% masking rate (Wettig et al., 2022), for base/large models, respectively.
  • We use a sentence sampler with exponential smoothing of the sub-corpora sampling rate following Conneau et al. (2019) since there is a disparate proportion of tokens across sub-corpora and we aim to preserve per-corpus capacity (avoid overfitting).
  • We consider mixed cased models, similar to all recently developed large PLMs.

Intended uses & limitations

More information needed

Training and evaluation data

The model was trained on the LeXFiles corpus (https://huggingface.co/datasets/lexlms/lexfiles). For evaluation results, please consider our work "LeXFiles and LegalLAMA: Facilitating English Multinational Legal Language Model Development" (Chalkidis* et al, 2023).

Training procedure

Training hyperparameters

The following hyperparameters were used during training:

  • learning_rate: 0.0001
  • train_batch_size: 8
  • eval_batch_size: 8
  • seed: 42
  • distributed_type: tpu
  • num_devices: 8
  • gradient_accumulation_steps: 4
  • total_train_batch_size: 256
  • total_eval_batch_size: 64
  • optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
  • lr_scheduler_type: cosine
  • lr_scheduler_warmup_ratio: 0.05
  • training_steps: 1000000

Training results

Training LossEpochStepValidation Loss
1.13220.05500000.8690
1.01370.11000000.8053
1.02250.151500000.7951
0.99120.22000000.7786
0.9760.252500000.7648
0.95940.33000000.7550
0.95250.353500000.7482
0.91520.44000000.7343
0.89440.454500000.7245
0.8930.55000000.7216
0.89971.025500000.6843
0.85171.076000000.6687
0.85441.126500000.6624
0.85351.177000000.6565
0.80641.227500000.6523
0.79531.278000000.6462
0.80511.328500000.6386
0.81481.379000000.6383
0.80041.429500000.6408
0.80311.4710000000.6314

Framework versions

  • Transformers 4.20.0
  • Pytorch 1.12.0+cu102
  • Datasets 2.7.0
  • Tokenizers 0.12.0

Citation

Ilias Chalkidis*, Nicolas Garneau*, Catalina E.C. Goanta, Daniel Martin Katz, and Anders Søgaard. LeXFiles and LegalLAMA: Facilitating English Multinational Legal Language Model Development. 2022. In the Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics. Toronto, Canada.

@inproceedings{chalkidis-garneau-etal-2023-lexlms,
    title = {{LeXFiles and LegalLAMA: Facilitating English Multinational Legal Language Model Development}},
    author = "Chalkidis*, Ilias and 
              Garneau*, Nicolas and
              Goanta, Catalina and 
              Katz, Daniel Martin and 
              Søgaard, Anders",
    booktitle = "Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics",
    month = july,
    year = "2023",
    address = "Toronto, Canada",
    publisher = "Association for Computational Linguistics",
    url = "https://arxiv.org/abs/2305.07507",
}
endpoints_compatible
fill-mask
legal
pytorch
roberta
tensorboard
transformers

Contributors

kiddothe2b

32 commits

jkao

1 commits