AliBERT: A Pre-trained Language Model for French Biomedical Text
Paper · 2023 · Aman Berhe, Guillaume Draznieks, Vincent Martenot et al.
Summary
A system that reads French can recognize the words around a medical term and still struggle to identify the term itself or tell where a longer medical description ends. AliBERT investigates whether pretraining on French biomedical writing gives a better starting point for those decisions than pretraining on general French. The authors built a 7.0 GB collection from scientific publications, thesis abstracts and medication information. They also trained a subword tokenizer on the collection. This determines which words the system can read as single units and which it reads as sequences of smaller pieces. The authors standardized spacing around selected punctuation before learning that vocabulary.
Both AliBERT variants began their pretraining from scratch. AliBERT learned to restore material hidden in a passage. AliBERT-ELECTRA used the same vocabulary and learned to decide whether a token had been substituted. The authors then used fine-tuning to adapt each system to labeled examples. Their main test was named entity recognition, which asks a system to locate a mention and label it as, for example, a symptom or an anatomical structure. On the selected categories in the CAS clinical cases, macro F1, an average across categories that reflects both correctness and coverage, was 0.88 for AliBERT and 0.89 for AliBERT-ELECTRA. The general French baseline, CamemBERT, scored 0.81. On the selected categories in QUAERO-MEDLINE article titles, AliBERT scored 0.793, AliBERT-ELECTRA 0.782 and CamemBERT 0.655.
The averages conceal an important exception. CamemBERT scored highest on CAS pathology mentions, which can extend through long descriptions. Both biomedical variants did better on the disorder category in QUAERO-MEDLINE and recovered device mentions for which CamemBERT scored 0.000 F1. In a separate exercise, AliBERT recovered the hidden item as its first prediction with an accuracy of 0.72, compared with 0.49 for CamemBERT. The results were closer on the private text classification dataset. The first-choice accuracy was 0.68 for each AliBERT variant and 0.66 for CamemBERT.
The tokenizer experiments favored lowercasing and punctuation normalization. A run using the LAMB optimizer reduced pretraining loss sooner, while the default Adam run achieved higher F1 in most categories in the CAS optimizer comparison. The best-supported result is that the complete biomedical setup improved several kinds of prediction on the authors’ evaluations. The experiments leave open how much of that advantage came from the training documents and how much came from the vocabulary. The authors also identify physicians’ notes as a source they would need to add to test a broader range of clinical writing.
Deep dive: AliBERT: A Pre-trained Language Model for French Biomedical Text
AliBERT learns from French biomedical writing to identify medical mentions, recover missing terms, and classify texts by topic or category. · about 33 minutes to read
The problem and its context
Specializing in a language and a field
Biomedical writing gives fairly ordinary words specialized work to do. A number can belong to an examination result, a phrase about a body part can delimit a clinical finding, and several words together can describe a disease. A system intended for information extraction needs to pick out those expressions within sentences that also contain ordinary French. The authors therefore approach French biomedicine as a problem involving both a language and a set of writing practices.
A general French training collection can supply many examples of how the surrounding sentences work. The question is how frequently it exposes the system to the terms and patterns useful for medical tasks, and in what contexts. A dedicated biomedical collection changes the distribution of those examples. It also offers a different basis for deciding which text fragments deserve their own entries in the vocabulary. The authors make both changes in AliBERT. Their question concerns what that combination can offer when the eventual task involves recognizing or classifying specialized text.
The paper describes earlier research on word embeddings for French health documents. These are numerical representations learned from patterns of word use. One study compared word2vec and GloVe for that material. This established a precedent for deriving representations from French health text. AliBERT asks what can be gained by learning a representation for a particular occurrence in its sentence. The same vocabulary item can then be represented differently depending on the words around it and the role it plays in the passage.
That distinction matters when an annotation describes a phrase. The vocabulary may contain the main noun in a description of a disease. A system still has to decide whether the annotation includes adjoining words about the location or extent of the finding. An embedding for the noun offers a representation of an item in the vocabulary. An encoder that processes the whole sequence can also learn how the words around that item affect its role. The paper situates AliBERT in the development of contextual encoders because its intended tasks depend on that additional information.
What pretraining made possible
The architecture comes from the Transformer family. Its attention mechanism lets the representation at a position draw on other positions in the sequence. The paper identifies BERT as an important precedent for learning these representations and adapting them to many tasks. The training recipe has a practical attraction. A large collection of raw text supplies the initial learning exercises, and a more focused collection of labeled text supplies examples of the task the system will eventually perform.
The first stage is called pretraining because it takes place before the target task is taught. The exercises can be self-supervised, meaning that the original text supplies the answers. Hiding a word creates a prediction problem whose solution is already available in the source sentence. At the later stage, a clinical annotation supplies a kind of answer the original text alone cannot provide. The text shows what the clinician wrote. The annotation records which part of that writing the dataset treats as a symptom, a measurement or another defined category.
French systems already showed how this training pattern could be applied to a particular language. CamemBERT drew on French text from OSCAR, and the paper also describes FlauBERT as trained on broad French material. It reports 71 GB of raw text for FlauBERT. Those systems provided examples of the scale and organization of general French pretraining. AliBERT’s authors wanted to apply the same broad approach to a collection whose organizing principle was the subject of the writing as well as its language.
The paper also gives examples of work that narrows the training material in other ways. BERTweetFR started with CamemBERT and used French tweets for further training. JuriBERT was developed for French legal language, with 6.3 GB of raw legal text. These examples illustrate different reasons to define a training collection narrowly. A system can be prepared for a particular medium, such as short posts, or for the terminology and conventions of a profession.
Routes into biomedical specialization
As the authors describe it, much of the earlier biomedical work used English text. BioBERT began with BERT and extended its training using biomedical writing, including article abstracts. This is an example of continual pretraining. The initial system has already acquired representations from a general collection, and training continues on material from a more focused field. The paper also names PubMedBERT and BioELECTRA among the biomedical precedents. These examples establish the setting for the authors’ choice of training strategy and objective.
Another strategy discussed in the paper is mixed-domain pretraining, where general and specialized material contribute to the training collection. Training exclusively on specialized text from scratch is a further option. It gives the project control over which vocabulary it starts with and which texts shape the parameters from the outset. Continuing from an existing system gives the project a starting set of representations learned on a different collection. The paper distinguishes these strategies because all of them can produce a system intended for specialized use, although they reach that point through different training histories.
There was already work on contextual representations for French biomedical text. The authors describe CamemBioBERT as a CamemBERT adaptation that used biomedical material from DEFT, a Francophone text-mining evaluation campaign. Their discussion also covers the EDS effort, which drew on 21 million French clinical reports taken from electronic health records linked to hospitals around Paris. EDS explored training from scratch as well as extending CamemBERT. The authors characterize the EDS research as ongoing work on proprietary clinical material. Learning structures of the French clinical language
The distinction among these projects is partly a distinction among kinds of text. Clinical reports are written in the course of care. Publications and drug documents are written for other purposes and can organize biomedical information differently. The review cited by the authors likewise covers training sources ranging from scientific literature to radiology reports and social media. A project that draws from one of those sources is exposed to a different set of terms in context from a project that draws from another. AliBERT’s place in that history is defined by its French biomedical collection, its separately learned vocabulary and its decision to train new encoders from scratch.
The method, step by step
Gather the documents
The authors first assembled a corpus, a collection of text for training. The full collection is listed at 7.0 GB. The research component included French biomedical publications selected from ScienceDirect using a subscription API. It also included pages from Cochrane and thesis abstracts obtained through SuDoc, a university documentation catalog. Thesis entries in the source inventory refer to summaries. That distinction matters because a large count of summaries can correspond to a smaller amount of text than a collection of longer publications.
The other major component was medication information. The authors retrieved short passages and some complete sentences from a public drug database that describes drug characteristics. They also collected product characteristics from the RCP source, whose audience is biomedical professionals. A medicine can therefore appear in material written with different levels of technical detail. Bringing these sources together provides recurring terminology in several kinds of surrounding prose.
The authors record both quantities and sizes for the source collections. The ScienceDirect articles account for 500K items at 4300Mb, and the RCP entry lists 35K items at 2200Mb. The public drug database is listed at 23K items and 550Mb. The thesis source contributes 300K items at 300Mb, while Cochrane contributes 7.6K items at 27Mb. These are the units used in the source inventory. They describe the material gathered, and the counts cover items of different kinds and lengths.
The range of material matters more to the training argument than any individual count. An abstract compresses a research topic into a short passage. An article can use a specialized expression repeatedly while developing its subject. A medication entry can put a product name near expressions about its characteristics. Pretraining samples from such contexts, and the vocabulary learner also takes its evidence from the strings they contain. Thus the collection influences the system twice, first through the choice of input pieces and then through the examples that teach how those pieces are used.
From biomedical source documents to evaluated predictions
The steps in order.
Make punctuation boundaries more consistent
Tokenization turns a string of written text into discrete units, called tokens, that the encoder can look up and process. Some tokens may stand for words. Others are pieces that can be reused across words. A rare medical expression can therefore still be read when the vocabulary lacks an entry for the entire expression. It will occupy several positions in the input, and its parts can share representations with pieces found elsewhere.
Before learning the vocabulary, the authors changed the spacing around selected punctuation. The appendix illustrates inserting a space after punctuation and removing preceding space in the cases shown. Opening parentheses, colons and hyphens appear among the marks discussed in connection with the procedure. The operation addresses the boundary between punctuation and an adjacent string. A word next to a mark can yield a different candidate from the same word preceded by a space, even though a reader recognizes it as the same word.
The paper illustrates this problem with token spellings that differ in an underscore used to represent a boundary. The underscore in that comparison is part of the tokenizer’s representation. Several candidates can therefore account for text that looks closely related on the page. Changing the punctuation spacing before counting and evaluating pieces gives the vocabulary learner a more consistent view of those boundaries. The authors describe the resulting reduction of duplicate forms as one reason to include normalization.
The appendix uses the same sample text to show how alternative tokenizers respond. One implementation of Unigram preserves case, another converts the input to lower-case, and another skips the punctuation normalization. CamemBERT’s tokenizer provides an additional comparison. The case and spacing settings act on different properties. Lowercasing brings capitalized and uncapitalized spellings together. The spacing routine changes whether the pieces adjoining punctuation are learned and applied under similar boundary conditions.
This is the specific text treatment behind the authors’ description of a regularized tokenizer. The concrete procedure they document is standardization of the input strings. An illustration can make its effect on a token sequence visible immediately. The question of whether it helps an encoder learn a better representation, or helps it spot the limits of an annotated entity, belongs to the comparisons after the vocabulary has been built.
Choose which pieces stay in the vocabulary
The authors experimented with Unigram, WordPiece and byte-pair encoding, considering such settings as vocabulary size and normalization. Unigram was their choice for AliBERT. Its vocabulary training begins with a large set of possible pieces. For the current set, it evaluates a loss on the corpus. Loss here indicates how well the available pieces account for the observed text, with a worse fit incurring a higher loss. The procedure estimates the effect of removing individual entries and uses those estimates to decide which pieces to prune.
Consider a long form that can already be expressed through useful smaller pieces. Removing its separate entry may cost little if those pieces account for the form well. A different entry might account for many occurrences that would otherwise be represented less effectively, making it more valuable to keep. The inventory shrinks until it reaches the intended scale. The authors describe this operation verbally. They do not give a mathematical expression for the loss or for the pruning rule.
The experiment settings call the vocabulary 40K sub-word units. In the discussion, where the authors compare actual inventories, they give AliBERT’s size as 40,008 and CamemBERT’s as 32,005. They report about 10,000 entries shared between the vocabularies. Those figures describe the available pieces, so the common entries do not have to be the pieces used most frequently in both systems. Nor does an entry unique to AliBERT have to stand for a complete biomedical term. The comparison shows the scale of the change in how the same language can be represented.
A vocabulary contains a finite number of entries, so its design determines which recurring strings get a position of their own. The authors’ view is that training on specialist material gives biomedical forms a better chance to be preserved as useful pieces. The choice also affects how much text fits into an input. A piece that covers an entire word takes a single position, while a spelling represented through several fragments consumes more positions. That relationship is relevant to the authors’ fixed sequence budget.
Prepare sequences for contextual learning
In the AliBERT base description, the paper uses L for what it calls the architecture’s length, H for its height and A for the number of self-attention heads. It gives L as 12, H as 512 and A as 12. L describes the depth of the encoder stack and H its internal representation size as reported by the authors. A counts the attention heads, which give a layer several ways to draw on relationships among token positions. These are configuration settings from the paper. The limit on the number of input tokens is a separate setting.
The text is converted to a token sequence, with padding or truncation used to respect a maximum length of 512 tokens. Padding fills spare positions in short inputs. Truncation sets a boundary on how much of a long sequence can be passed through an input at once. The authors mention [CLS] and [PAD] among the special tokens in this preparation. The cap counts encoded units, including such special tokens where present. Its practical meaning for a quantity of original prose depends on how the tokenizer segments that prose.
After packaging, the units are converted to numerical embeddings. The Transformer layers use them to build contextual representations, drawing on relationships in the sequence. This is the point at which a token’s surroundings become part of its representation. Its initial identity comes from the vocabulary. The encoder’s output at a position depends on the whole input it can attend to. The prediction component then uses that contextual output to make the decision required by the training exercise.
Restore hidden material in AliBERT
AliBERT uses masked language modeling, abbreviated MLM in the paper. The input is turned into a prediction exercise by withholding selected material. The original text provides the answer at each selected position, and the remaining context supplies the evidence. The authors describe hiding 15% of the input words. Their account discusses the prediction in terms of words or tokens and does not specify how a word split into several pieces is handled in the masking procedure.
The authors implement the masked approach with a RoBERTa variant of BERT. At the end of the encoder, a feed-forward component produces a probability distribution over candidates for each hidden position. A probability distribution gives each candidate a score interpretable as its predicted chance of being the missing item, relative to the other candidates. Training adjusts the parameters using the original item as the target. Repeating this exercise across different documents teaches the encoder to use both local cues and the patterns common to the collection.
A phrase introducing an examination result can make a measurement or unit plausible. A sentence describing treatment can make a drug expression plausible. Those kinds of cues come directly from the surrounding text. The same pretraining procedure on general prose would still reward using context, but the examples would give different patterns of terminology and sentence structure different amounts of practice. Training AliBERT from scratch lets the corpus supply the early as well as later exposure to those patterns.
Recognize substitutions in AliBERT-ELECTRA
AliBERT-ELECTRA shares the biomedical tokenization and vocabulary. For this variant the authors use replaced token detection, abbreviated RTD. A generator supplies predictions for hidden positions. Those predictions are inserted into the sequence, and a discriminator receives the resulting text. The discriminator learns to classify each token as original or substituted. The unaltered source gives the training process the information needed to mark which positions changed.
The generator and discriminator have different jobs. The generator must propose a candidate suitable for a gap. The discriminator sees the candidate in place and must decide whether it belongs to the original sequence. The substitutions can therefore be plausible in their surroundings. A replacement can look like an ordinary word and still be unusual in a particular technical phrase. The practice for the discriminator is to become sensitive to that mismatch.
As training targets, the two exercises ask different questions about a position. In the masked version, the target is an entry from the vocabulary that the system has to restore. In replacement detection, the input already includes a token at the position and the target identifies its status. The common tokenizer makes the ensuing comparison informative about the two recipes. The generator and discriminator also make replacement detection a different training arrangement, a distinction that matters when assigning credit to the objective alone.
Control the training updates
The default optimizer is Adam. In training, an optimizer uses information about how the loss changes with the parameters to decide how to update them. The paper describes Adam as a first-order method using adaptive estimates of moments derived from the gradients. In practical terms, it adjusts the updates using accumulated information about the recent training signal. The authors also trained an AliBERT variant with LAMB, motivated by previous work on speeding up BERT training with large batches. Large Batch Optimization for Deep Learning
For AliBERT base, the stated run used 48 Nvidia A100 GPUs for 20 hours. The hardware was spread across 12 nodes, each with 4 GPUs. The batch size was 960, with 20 per GPU, and the input setting was 512 tokens. The batch size describes the set of examples grouped for an update. The time describes a run on those resources. The separate LAMB comparison concerns the course of the loss during training and the recognition results obtained after adapting the resulting encoder.
Turn the pretrained encoders into task systems
For entity recognition the authors used the HuggingFace token classification pipeline. This attaches predictions to positions in the input. The annotated passages guide training by identifying which expressions count as mentions and what kind of entity each represents. The system must learn the category and the extent of an expression, since the annotation may cover a substance name, a measurement together with its unit, or a longer description. The set of possible labels comes from the evaluation dataset.
The private classification task used HuggingFace sequence classification. Its output is attached to the text as a whole. The input may contain many entities, but the supervised answer is a category assigned to the sequence. The system’s output ranks the eligible classes, and an evaluation can ask where the assigned answer appeared in that ranking. This is a different adaptation of the pretrained encoder from attaching predictions to token positions.
Masked prediction provides a third use of the systems. It evaluates candidates for hidden material directly. That score concerns recovery of an item in context and uses a different answer space from text classification, where the candidates are classes. The paper reports pretrained AliBERT materials through Hugging Face under the name Quinten-datalab/AliBERT and identifies its AliBERT project repository in connection with the data made available. The CAS and QUAERO entity datasets are public. The collection used for sequence classification is private.
Experiments and results
Reading the comparisons
CamemBERT is the general French comparator in the main numerical results. The entity experiments give per-category precision, recall and F1. Precision describes the proportion of predictions that count as correct under the evaluation. Recall describes the proportion of annotated entities that the system recovers. F1 combines those measures through their harmonic mean, so a system with high precision and weak recall can receive a relatively low F1. The macro averages give every included category equal weight. A category with fewer annotations can therefore have as much influence on macro F1 as a more frequent one.
The paper also reports first-choice accuracy and wider ranking cutoffs for the masked prediction and classification tasks. Here the question is whether the designated answer is among a specified number of candidates. Accuracy at the most restrictive cutoff asks whether the first candidate is correct. At a wider cutoff, the target can be outranked and still count as recovered. This interpretation applies to both ranking tasks, although the objects being ranked are different. A missing token and a label for a whole text test different uses of the pretrained representations.
CAS clinical cases
CAS provides French clinical texts from specialties including cardiology, urology and oncology. The authors kept the five categories that had the most annotations. Substance refers to pharmacological mentions, including commercial and generic names. Symptom covers findings used in reaching a diagnosis. Anatomy includes body parts and structures, value includes quantities or grades associated with examinations and findings, and pathology covers diseases or descriptions of pathological conditions.
The annotation inventory lists 2,009 substance occurrences, 5,240 symptom occurrences, 4,780 anatomy occurrences and 1,743 value occurrences. Those numbers refer to the annotated dataset as described in the appendix. They cannot be read as counts for an identified test partition. For the main CAS comparison the paper gives the fine-tuning batch size as 80, the learning rate as 2e-5 and the weight decay as 0.01. The learning rate sets the scale for parameter updates, and weight decay constrains the growth of parameters during fine-tuning.
Macro F1 on the selected CAS clinical entity categories
Both biomedical variants score above CamemBERT, and AliBERT-ELECTRA has the highest macro F1.
The numbers
| System or setting | F1 |
|---|---|
| CamemBERT | 0.81 |
| AliBERT | 0.88 |
| AliBERT-ELECTRA (this paper) | 0.89 |
Within the CAS results, the aggregate precision and recall give a more specific account of how the systems scored. AliBERT’s macro precision is 0.94 and its macro recall is 0.85. AliBERT-ELECTRA has 0.92 precision and 0.87 recall. CamemBERT obtains 0.89 and 0.79 on these measures. The biomedical variants improve both aggregates relative to the baseline, with the AliBERT run stronger on macro precision and the replacement-detection run stronger on macro recall.
Value recognition shows how such a gain can arise. CamemBERT has precision of 0.88, recall of 0.46 and F1 of 0.60 for values. AliBERT reports 0.98 precision, 0.99 recall and 0.98 F1. AliBERT-ELECTRA scores 0.93 on each of those measures. Relative to its own precision score, CamemBERT’s low recall identifies the more conspicuous difficulty in this category. It can make correct value predictions, but many of the annotated occurrences escape it. The AliBERT result combines more complete coverage with more reliable predictions.
The improvements appear in the other shorter or more medically specific categories as well. For CAS symptoms the F1 scores are 0.90 for CamemBERT, 0.97 for AliBERT and 0.96 for AliBERT-ELECTRA. The substance scores are 0.91 for CamemBERT and 0.93 for each biomedical variant. On anatomy the paper gives respective F1 scores of 0.88, 0.98 and 0.96. These are results for the particular categories in CAS. A high anatomy score, for instance, describes recovery of the annotated expressions in these cases under the definitions used by CAS.
Pathology changes the ordering. The baseline reaches 0.74 F1, followed by AliBERT-ELECTRA at 0.68 and AliBERT at 0.52. In the comparison between CamemBERT and AliBERT, the masked-pretraining variant has slightly higher pathology precision, 0.81 against 0.79, while its recall is 0.39 against 0.70 for CamemBERT. AliBERT-ELECTRA’s pathology precision is 0.85 and its recall is 0.57. For both biomedical variants, recall is the part of the result that makes it difficult to match CamemBERT’s pathology F1.
The authors suggest an explanation involving the extent of the annotated spans. They give a case in which a tumor mention includes both a description of its malignant appearance and a passage about the areas of the bladder it invades. The annotation treats the extended phrase as a single pathology mention. Much of the expression consists of the ordinary French needed to connect the medical details. A specialized vocabulary might represent its principal medical terms well and still offer little direct help determining how far the annotation extends. The example illustrates the hypothesis behind the authors’ interpretation. The score table reports the behavior of the full category.
QUAERO-MEDLINE article titles
The QUAERO-MEDLINE experiment evaluates entity recognition on article titles from MEDLINE. The QUAERO resource defines its categories using semantic groups from the Unified Medical Language System. The paper describes automatic pre-annotation followed by validation by trained annotators. AliBERT’s authors selected the categories they regarded as closest to biomedical concepts. Those categories are anatomy, chemical, device, disorder and procedure.
The resource’s definitions establish what a correct prediction has to capture. Anatomy refers to body parts, and chemical covers such entities as proteins and enzymes as well as drugs. A procedure can be an activity practiced in biomedicine, while the device category covers equipment used in that field. Disorder includes diseases and other abnormalities, with symptoms among the examples in the description. In the appendix the reported annotation counts include 1,464 for anatomy, 1,028 for chemical, 2,825 for disorder and 1,631 for procedure. As with CAS, these are inventory counts.
Macro F1 on the selected QUAERO-MEDLINE title entities
AliBERT has the highest macro F1, with both biomedical systems ahead of CamemBERT.
The numbers
| System or setting | F1 |
|---|---|
| CamemBERT | 0.655 |
| AliBERT (this paper) | 0.793 |
| AliBERT-ELECTRA | 0.782 |
Here AliBERT reaches 0.807 macro precision and 0.783 macro recall. AliBERT-ELECTRA has 0.818 and 0.755, respectively. CamemBERT records 0.655 precision and 0.656 recall. AliBERT-ELECTRA has the highest macro precision in this experiment, while AliBERT has the highest recall and F1. In CAS the relationship between the variants’ aggregate precision and recall went the other way. Both tables reward coverage as well as correct predictions, and the variant with the highest precision differs from the F1 leader.
The device category gives the clearest separation from the baseline. CamemBERT scores 0.000 for precision, recall and F1. AliBERT has device precision of 0.506 and recall of 0.356, leading to F1 of 0.418. AliBERT-ELECTRA reaches 0.549 precision, 0.338 recall and 0.419 F1. The variants thus recover device mentions under conditions in which CamemBERT receives no credit. Their recall also shows that recognizing devices remains difficult. Even the biomedical systems leave much of that annotation category unrecovered.
At the other end of the score range, procedure recognition has high F1 across the comparison. CamemBERT reaches 0.887, AliBERT 0.968 and AliBERT-ELECTRA 0.960. For anatomy the corresponding system scores are 0.645, 0.803 and 0.800. In the chemical category, AliBERT leads at 0.885, AliBERT-ELECTRA scores 0.856 and CamemBERT scores 0.846. The combined result includes gains on entities the general system already handles fairly well as well as the difference on devices.
Disorder F1 is 0.850 for AliBERT and 0.845 for AliBERT-ELECTRA, compared with 0.794 for CamemBERT. The paper draws attention to the difference from CAS pathology. Both categories include descriptions related to disease, but the title dataset uses a different annotation scheme and contains a different kind of text. A disorder mention in a title comes with the context a title can supply. A pathology annotation in a narrative can extend through a description of what was observed. The two experiments establish how well the systems meet each dataset’s own requirements.
Predicting the item behind a mask
For this evaluation the authors selected 3000 texts. The sample contains 1000 ScienceDirect articles, 1000 Cochrane articles and 1000 SuDoc thesis abstracts. These source types also contribute to the pretraining collection. The experiment assesses prediction in the sorts of French biomedical writing the project set out to represent. It asks where the original item places in the proposed answers, with separate scores for the first candidate and for wider cutoffs.
First-choice accuracy on the French biomedical masked-text sample
Both AliBERT variants put the original item first more often than CamemBERT does.
The numbers
| System or setting | Accuracy |
|---|---|
| CamemBERT | 0.49 |
| AliBERT (this paper) | 0.72 |
| AliBERT-ELECTRA | 0.71 |
CamemBERT reaches 0.57 when the evaluation accepts an answer among the first three predictions and 0.62 when it accepts one among the first five. Both AliBERT variants give 0.83 at the three-candidate cutoff and 0.87 at the five-candidate cutoff. The first-choice result therefore captures only part of the pattern. Widening the acceptance rule still leaves the biomedical systems ahead and places the two variants at the same reported accuracy.
The appendix displays individual masked sentences with ranked candidates. In its visual convention, green marks an original answer ranked first, blue marks one ranked second and purple marks one ranked third. Red indicates that the answer is absent from the displayed list, which contains the first five candidates. The examples connect the score to a simple test. A system can assign substantial probability to a word and still lose first-choice credit if it gives another word a higher rank. The target throughout is the item that appeared in the original biomedical text.
The ranking is therefore a measure of recovering the original expression in context. Some gaps can admit multiple plausible completions, and the score credits a particular one. The use of wider cutoffs distinguishes a system that frequently puts that expression within reach from one that rarely includes it among its strongest candidates. The examples make this distinction visible, while the scores summarize the behavior across the selected collection.
Classifying a biomedical sequence
The private collection begins with 410,000 examples in 789 classes. The authors describe the full collection as an extreme classification problem because of the large set of possible labels. They retain classes represented by more than 1000 examples, producing a 50-class task for the reported experiment. The accuracy measures apply to this filtered task. The paper does not identify the class contents, so the available comparison concerns the ranks of the assigned labels under the reported setup.
At the first-choice cutoff, CamemBERT scores 0.66 and both biomedical variants score 0.68. At the cutoff that accepts any of the first three predictions, the scores are 0.72 for CamemBERT and 0.73 for each variant. When the evaluation accepts the first five predictions, all systems reach 0.99. The gaps that remain visible concern how high the system places the correct label among its leading choices. The reported classification results distinguish neither of the biomedical variants from the other.
The masking and classification comparisons use the same idea of ranked accuracy but put different demands on the encoder. A blank in a biomedical passage may directly reward familiarity with a recurring expression. A class assigned to a sequence may be supported by several expressions or by broader properties of the passage. The results indicate that the biomedical pretraining setup was useful for the first-choice decision in both experiments. The gain appears much more prominently for the hidden items than for the label rankings in the filtered private collection.
What the ablations show
Which changes affect segmentation
The paper reports several comparisons that examine choices inside the AliBERT setup. The tokenizer appendix compares families of tokenizers and versions of Unigram that change the input preparation. The plotted diagnostic concerns the proportion of individual words that can be encoded below different splitting thresholds. It is a measure of how readily the learned inventory accounts for words with a small number of pieces. Unigram is reported to handle a larger share of words favorably under this comparison and to learn faster.
That diagnostic has a direct interpretation for the input. If the chosen pieces account for a word in fewer positions, the encoder receives a more compact sequence for that word. It can consume the same amount of original prose using fewer of its available positions. A segmentation plot establishes which tokenizer tends to do this under the comparison. It measures compactness, and downstream experiments are needed to establish whether the resulting pieces offer better evidence about the identity and extent of an annotated mention.
The authors also report that Unigram with their normalization was the strongest choice in their training and fine-tuning experience. Their case comparison favors converting the text to lower-case. They explain that capitalized forms occur in the biomedical corpus but judged the examples insufficient to justify retaining the original case in their setting. Lowercasing gives the vocabulary learner more occasions to treat different casing of a spelling as the same form. The choice is consequential wherever case itself might help distinguish the uses of a string, so the observed preference applies to the setup the authors tested.
The illustrated segmentation comparison gives punctuation normalization a more concrete role. Where a spelling appears beside punctuation in different layouts, altered spacing can let the learner reuse a piece it would otherwise encounter under a different boundary. The authors use this observation to motivate a vocabulary with fewer redundant entries. The reported overlap with CamemBERT supplies complementary evidence that the ultimate inventories are substantially different. It does not establish what fraction of those differences comes from layout, casing, the texts used to learn pieces or the size of the vocabulary.
What changes with the training exercise
The objective comparison retains the biomedical vocabulary while moving from masked prediction to replacement detection. The result depends on the task. The replacement-detection variant leads on macro F1 in CAS, and it recovers more of the CAS pathology annotations than the masked variant. The masked variant leads on macro F1 in QUAERO-MEDLINE. In that title-based test it also gives higher recall for several categories while the replacement-detection variant has higher macro precision.
For the masked-text sample the masked variant has the better first-choice score, and the two match at the wider cutoffs. In classification they match at every reported cutoff. Taken together, those results are consistent with the authors’ description of modest differences between their objectives. They also give the comparison a more precise interpretation. It is possible for the higher-scoring objective to change with the definition of success, including between the maximum F1 in a clinical case collection and the leading recovery rate for a masked item.
This is a comparison between implementations of the objectives. The masking procedure uses a vocabulary prediction head during pretraining. Replacement detection involves a generator and a discriminator. Their input pieces come from the same inventory, which removes one source of variation and makes the contrast more focused than the comparison with the general French baseline. The study reports the outcomes of the configured systems. It does not give a run-by-run estimate of the variation that would accompany repeating these comparisons.
How the optimizer changes speed and recognition
The optimizer appendix compares AliBERT using Adam with AliBERT-LAMB. The training curve shows a quicker decrease in loss with LAMB. The speed result concerns the objective being optimized during pretraining. The CAS comparison asks how useful the resulting parameters are after the encoder has been adapted to entity annotations. A faster decrease in the original loss and a stronger result after adaptation are distinct outcomes.
The CAS optimizer table gives value F1 of 0.98 for Adam and 0.86 for LAMB. Symptom F1 is 0.97 for Adam and 0.96 for LAMB. For anatomy the respective scores are 0.98 and 0.96. In that table Adam also has the higher substance F1, at 0.90 compared with 0.88 for LAMB. The differences are category-specific. For anatomy, for example, both entries have a precision of 0.97, while the recall scores are 0.97 for Adam and 0.95 for LAMB.
Pathology favors LAMB on this comparison. Its precision is 0.87 and its recall is 0.52, with F1 of 0.65. The Adam entry has 0.81 precision, 0.39 recall and 0.52 F1. The exception accompanies better scores on both of the components used to evaluate recognition. CAS therefore offers a case where the faster-pretrained version recovers a category better, alongside several categories where the default version gives the stronger F1.
There is also a reporting difference to retain when reading the optimizer results. The main CAS comparison gives AliBERT 0.93 substance F1, whereas the Adam entry for the optimizer comparison gives 0.90. The paper supplies no explanation reconciling those entries. The categories compared within the optimizer table still establish the reported direction of the Adam and LAMB results under that comparison. In particular, the improvements for Adam on values and for LAMB on pathology can be read directly from the paired rows.
The speed curve and the recognition table provide evidence for different decisions. The curve supports LAMB as a way to make faster progress on the training loss in the authors’ test. The recognition table favors Adam for most of the categories they examine and identifies pathology as an exception. The paper provides this downstream optimizer comparison for CAS. Whether the advantage for a particular category or optimizer carries over to another genre, such as article titles, remains an empirical question.
Limitations
Limits identified by the authors
The authors identify corpus diversity as a limit. The collection is built from several sources, but the source inventory concentrates on research and medication-related material. The authors specifically want to add electronic health records and, within them, physicians’ notes. These would provide examples of how practitioners express observations and decisions in clinical documents. The CAS evaluation provides evidence on clinical cases after adaptation. Including forms of clinical writing in pretraining would change the examples that teach the encoder before that adaptation takes place.
Another stated limit is the 512-token sequence length. Truncation controls the size of the input at the expense of any context beyond it. Its effect will vary with the length of the original passage and the tokenizer’s division of its words. A title can generally be considered as a short unit in its own right, while the context for a decision in a longer document can be spread across the passage. The authors point to work on longer sequences when discussing how AliBERT could be extended. Big Bird
Continual pretraining remains open as another route to French biomedical specialization. The authors suggest starting with CamemBERT and extending its training using the biomedical corpus, as BioBERT did in the English setting described in the paper. A continuation experiment would have to account for the fact that AliBERT and CamemBERT use different inventories and text preparation. The authors discuss that issue and leave this comparison for later work. They also mention generation of biomedical text as a future direction. Their masked evaluation measures ranking at a selected gap in an existing passage, leaving longer-form generation outside its scope.
The authors estimate roughly 20,160 hours of GPU computation for the three pretrained systems they describe. Their environmental estimate is 1.45 MWh or 71.11 kg CO2e, using Green Algorithms. Those figures concern the study-wide computation cited in the limitations. The 20 hours in the base training description measures elapsed time for a specific distributed run. An efficiency comparison with a general French system would need equivalent accounting of what the training figures include and what hardware and conditions they reflect.
The paper’s ethics statement discusses bias, privacy, misinformation, access and accountability. The numerical evaluations measure annotation recovery, class ranking and recovery of hidden text. Evidence about performance on those tasks has a narrower scope than evidence about the effect of adopting a system in care. For example, an aggregate recognition result provides no breakdown by population or record source. The paper’s aim of supporting work with biomedical information can be assessed directly through its text experiments, while consequences for healthcare decisions remain outside those experiments.
Limits of the comparisons
The main effectiveness comparison changes several things at once. The exact training strings, the input normalization and the learned token inventory differ between AliBERT and CamemBERT. The resulting comparison shows what happened when the authors used the full biomedical setup in place of the general French baseline. It leaves the size of the independent effects uncertain. The segmentation diagnostics support the authors’ explanation for why the vocabulary might help. They cannot tell how much of the CAS or QUAERO result would remain if the encoder were trained on the whole biomedical corpus with a general French vocabulary.
The scope of the baseline also matters. The authors report that they could not include a comparable French biomedical pretrained system in the main numerical comparisons. CamemBioBERT and EDS appear in the discussion of related research. The central performance tables use CamemBERT. This gives a direct test against the general French starting point the authors chose, while differences between the various French biomedical routes remain unsettled. The broad performance claims in the paper are most securely read through the named systems and conditions in those tables.
The results for named entities are bounded by the label choices. CAS favors categories with enough annotation to support the chosen evaluation. The QUAERO subset favors groups the authors judge closely related to biomedicine. The macro measures describe those categories. Rare types excluded from CAS and the remaining semantic groups in QUAERO do not contribute to the averages. The datasets also define different spans for related phenomena. The behavior on a long CAS pathology description carries limited information about the behavior on a disorder in an article title.
The paper says the downstream datasets were excluded from pretraining, while explicitly allowing the possibility of overlap in QUAERO-MEDLINE titles. A title can appear as an evaluation item and also occur within source material collected for pretraining. Familiarity with the title’s words and access to its evaluation annotations are different forms of exposure. The paper does not quantify the overlap or give a separate result on verified unseen titles. This leaves uncertainty about how much of the title comparison reflects transfer to previously unencountered strings.
The masked prediction experiment raises a related comparability issue. Its source types also appear in the training inventory. The paper gives the makeup of the evaluation sample without supplying enough detail to reconstruct how individual texts were separated from pretraining. It also supplies little detail on how differently segmented target expressions were handled across vocabularies. A target word can take several positions in one tokenizer and a single position in another. The scores establish the ranking results reported under the authors’ procedure, while the precise consequences of those differences in representation remain open.
AliBERT-ELECTRA’s participation in the masked-text test presents a further question about the procedure. Its discriminator was trained to identify whether a presented token was replaced. The masking evaluation requires an ordered set of candidates for a gap. The paper reports that variant’s scores in the table and shows individual predictions in the appendix, but gives limited detail about how the candidates were produced and ranked for that comparison. This distinction matters especially when interpreting the small gap between the biomedical variants at the first-choice cutoff.
The private classification experiment is both narrower and harder to reproduce than the original size of the collection might suggest. Its scores concern frequent classes selected from the available labels. The initial figures describe the source collection and do not describe the evaluation partition after filtering. The main table supplies ranked accuracy, while the private labels and examples are unavailable for further scrutiny. In the discussion the authors even describe the private results as unreported, although their results table gives aggregate values. The table supports a comparison at those cutoffs. The details needed to locate the gain among particular classes or document types remain unspecified.
Finally, the reported numbers are point scores. The paper describes the objective differences as small, and its tables give no repeated-run variation or statistical test that would establish how stable those differences are. The direction of a larger contrast, such as the device result relative to CamemBERT, is readily visible in the reported runs. The fine ordering of AliBERT and AliBERT-ELECTRA across tasks requires more caution. Their rankings depend on the dataset and metric, so the observed results support a preference for a variant in a given comparison rather than a claim that one training exercise is uniformly superior.
What came after
In 2024, a later study cited AliBERT while taking evaluation of French clinical named entity recognition as its subject. AliBERT had used annotated clinical cases to ask whether biomedical pretraining could improve the transfer to a recognition task. The later work makes the clinical recognition benchmark itself the focus. A Benchmark Evaluation of Clinical Named Entity Recognition in French
The citation places AliBERT in the history of that evaluation problem. The documented connection is limited to the citation and the benchmark’s stated subject. It does not establish whether the later study tested AliBERT as a baseline, reused its weights, or adopted its vocabulary or corpus. The earlier paper’s contribution to the shared question is concrete. It shows why performance on French clinical entities needs to be read at the level of both the category and the genre. The stronger aggregate recognition scores coexist with weaker pathology recognition on CAS, and the disease-related comparison changes on article titles. A French clinical benchmark addresses the setting in which those distinctions matter most directly.
Cite
Cite as Aman Berhe, Guillaume Draznieks, Vincent Martenot, Valentin Masdeu, Lucas Davy and Jean-Daniel Zucker. 2023. AliBERT: A Pre-trained Language Model for French Biomedical Text. Proceedings of the 22nd Workshop on Biomedical Natural Language Processing and BioNLP Shared Tasks.
@inproceedings{berhe2023alibert,
title = {{AliBERT: A Pre-trained Language Model for French Biomedical Text}},
author = {Aman Berhe, Guillaume Draznieks, Vincent Martenot, Valentin Masdeu, Lucas Davy and Jean-Daniel Zucker},
booktitle = {Proceedings of the 22nd Workshop on Biomedical Natural Language Processing and BioNLP Shared Tasks},
year = {2023},
doi = {10.18653/v1/2023.bionlp-1.19},
url = {https://doi.org/10.18653/v1/2023.bionlp-1.19}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/berhe-2023-alibert-pre-trained-language-model/