[Paper Review] CharacterBERT: Reconciling ELMo and BERT for Word-Level Open-Vocabulary Representations From Characters
CharacterBERT proposes a BERT variant that replaces subword tokenization with a character-level CNN to generate word-level, open-vocabulary representations, improving performance and robustness on medical NLP tasks without relying on predefined wordpiece vocabularies. It outperforms BERT on specialized medical benchmarks and shows greater resilience to spelling errors.
Due to the compelling improvements brought by BERT, many recent representation models adopted the Transformer architecture as their main building block, consequently inheriting the wordpiece tokenization system despite it not being intrinsically linked to the notion of Transformers. While this system is thought to achieve a good balance between the flexibility of characters and the efficiency of full words, using predefined wordpiece vocabularies from the general domain is not always suitable, especially when building models for specialized domains (e.g., the medical domain). Moreover, adopting a wordpiece tokenization shifts the focus from the word level to the subword level, making the models conceptually more complex and arguably less convenient in practice. For these reasons, we propose CharacterBERT, a new variant of BERT that drops the wordpiece system altogether and uses a Character-CNN module instead to represent entire words by consulting their characters. We show that this new model improves the performance of BERT on a variety of medical domain tasks while at the same time producing robust, word-level and open-vocabulary representations.
Motivation & Objective
- To address the limitations of general-domain wordpiece vocabularies in specialized domains like medicine, where they may not capture domain-specific terminology effectively.
- To develop a BERT variant that produces word-level contextual representations without relying on subword tokenization, simplifying model design and interpretation.
- To evaluate whether character-based representation learning improves robustness to spelling errors and outperforms standard BERT in specialized domains.
- To enable reproducibility by releasing pre-trained models and code for the NLP community.
Proposed method
- Replace BERT’s wordpiece embedding layer with a Character-CNN module that processes individual characters of each token to produce contextualized word representations.
- Use the same Transformer encoder architecture as BERT, preserving attention mechanisms and multi-layered self-attention, while replacing only the input embedding component.
- Pre-train the model on a large corpus of medical text (MIMIC-III and PMC OA) using masked language modeling and next sentence prediction, similar to BERT.
- Fine-tune the model on downstream medical NLP tasks such as clinical text similarity, natural language inference, and named entity recognition.
- Apply noise augmentation during evaluation by introducing single-character errors (e.g., substitution, insertion, deletion, swap) to test robustness.
- Perform Almost Stochastic Order (ASO) tests to assess statistical significance of performance differences between CharacterBERT and BERT across multiple runs.
Experimental results
Research questions
- RQ1Is the use of general-domain wordpiece vocabularies suboptimal for specialized domains such as biomedicine?
- RQ2Can a character-level representation system produce better performance than subword tokenization in domain-specific NLP tasks?
- RQ3Does replacing wordpiece tokenization with character-level encoding improve robustness to spelling errors in medical text?
- RQ4Is it possible to maintain BERT-level performance while simplifying the model’s input representation to operate at the word level?
Key findings
- CharacterBERT outperforms BERT on all evaluated medical NLP tasks, including ClinicalSTS, MEDNLI, and NER, with statistically significant improvements confirmed by Almost Stochastic Order tests.
- On the MEDNLI benchmark, CharacterBERT medical achieved an F1 score of 86.3, outperforming BERT medical (85.8) and showing a 5-point advantage under 40% test set noise.
- When tested under 40% test set noise, CharacterBERT maintained a 5 F1-point advantage over BERT, indicating superior robustness to spelling errors.
- The model reduces wordpiece splitting for rare or domain-specific terms—only 13% of tokens were split by the general-domain vocabulary, compared to a higher rate in BERT.
- CharacterBERT pre-training is slower than BERT’s, but fine-tuning and inference are comparable or slightly faster, making it practical for deployment.
- The model achieves state-of-the-art performance on the BLUE benchmark, with the best results observed in the medical-specific variant, validating its effectiveness in domain-specific settings.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.