lexlms/legal-roberta-base

Model

should probably proofread and complete it, then remove this comment. -->

5

28 commits

1 linked in READMEs

updated May 15, 2023

See the code

README

LexLM base

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

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: 32
  • eval_batch_size: 32
  • seed: 42
  • distributed_type: tpu
  • num_devices: 8
  • gradient_accumulation_steps: 2
  • total_train_batch_size: 512
  • total_eval_batch_size: 256
  • 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.03890.05500000.9802
0.96850.11000000.9021
0.93370.151500000.8752
0.91060.22000000.8558
0.89810.252500000.8512
0.88131.033000000.8203
0.88991.083500000.8286
0.85811.134000000.8148
0.8561.184500000.8141
0.85271.235000000.8034
0.83452.025500000.7763
0.83422.076000000.7862
0.81472.126500000.7842
0.83692.177000000.7766
0.8142.227500000.7737
0.80462.278000000.7692
0.79413.058500000.7538
0.79563.19000000.7562
0.80683.159500000.7512
0.80663.210000000.7516

Framework versions

  • Transformers 4.20.0
  • Pytorch 1.12.0+cu102
  • Datasets 2.6.1
  • 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

28 commits

lexlms/legal-roberta-base

Model

should probably proofread and complete it, then remove this comment. -->

5

28 commits

1 linked in READMEs

updated May 15, 2023

See the code

README

LexLM base

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

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: 32
  • eval_batch_size: 32
  • seed: 42
  • distributed_type: tpu
  • num_devices: 8
  • gradient_accumulation_steps: 2
  • total_train_batch_size: 512
  • total_eval_batch_size: 256
  • 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.03890.05500000.9802
0.96850.11000000.9021
0.93370.151500000.8752
0.91060.22000000.8558
0.89810.252500000.8512
0.88131.033000000.8203
0.88991.083500000.8286
0.85811.134000000.8148
0.8561.184500000.8141
0.85271.235000000.8034
0.83452.025500000.7763
0.83422.076000000.7862
0.81472.126500000.7842
0.83692.177000000.7766
0.8142.227500000.7737
0.80462.278000000.7692
0.79413.058500000.7538
0.79563.19000000.7562
0.80683.159500000.7512
0.80663.210000000.7516

Framework versions

  • Transformers 4.20.0
  • Pytorch 1.12.0+cu102
  • Datasets 2.6.1
  • 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

28 commits