We present a distillation version of the well named
CamemBERT
, a RoBERTa French model version, alias DistilCamemBERT. The aim of distillation is to drastically reduce the complexity of the model while preserving the performances. The proof of concept is shown in the
DistilBERT paper
and the code used for the training is inspired by the code of
DistilBERT
.
Loss function
The training for the distilled model (student model) is designed to be the closest as possible to the original model (teacher model). To perform this the loss function is composed of 3 parts:
DistilLoss: a distillation loss which measures the silimarity between the probabilities at the outputs of the student and teacher models with a cross-entropy loss on the MLM task ;
CosineLoss: a cosine embedding loss. This loss function is applied on the last hidden layers of student and teacher models to guarantee a collinearity between them ;
MLMLoss: and finaly a Masked Language Modeling (MLM) task loss to perform the student model with the original task of the teacher model.
The final loss function is a combination of these three losses functions. We use the following ponderation:
L
oss
=
0.5
×
D
i
s
t
i
l
L
oss
+
0.3
×
C
os
in
e
L
oss
+
0.2
×
M
L
M
L
oss
Dataset
To limit the bias between the student and teacher models, the dataset used for the DstilCamemBERT training is the same as the camembert-base training one: OSCAR. The French part of this dataset approximately represents 140 GB on a hard drive disk.
Training
We pre-trained the model on a nVidia Titan RTX during 18 days.
distilcamembert-base huggingface.co is an AI model on huggingface.co that provides distilcamembert-base's model effect (), which can be used instantly with this cmarkea distilcamembert-base model. huggingface.co supports a free trial of the distilcamembert-base model, and also provides paid use of the distilcamembert-base. Support call distilcamembert-base model through api, including Node.js, Python, http.
distilcamembert-base huggingface.co is an online trial and call api platform, which integrates distilcamembert-base's modeling effects, including api services, and provides a free online trial of distilcamembert-base, you can try distilcamembert-base online for free by clicking the link below.
cmarkea distilcamembert-base online free url in huggingface.co:
distilcamembert-base is an open source model from GitHub that offers a free installation service, and any user can find distilcamembert-base on GitHub to install. At the same time, huggingface.co provides the effect of distilcamembert-base install, users can directly use distilcamembert-base installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
distilcamembert-base install url in huggingface.co: