Run this model with HF Jobs
Run rIsHu009/distilbert-imdb-mlm-trainer on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/rIsHu009/distilbert-imdb-mlm-trainer. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/rIsHu009/distilbert-imdb-mlm-trainer on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use rIsHu009/distilbert-imdb-mlm-trainer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rIsHu009/distilbert-imdb-mlm-trainer with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="rIsHu009/distilbert-imdb-mlm-trainer")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("rIsHu009/distilbert-imdb-mlm-trainer") model = AutoModelForMaskedLM.from_pretrained("rIsHu009/distilbert-imdb-mlm-trainer", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- DistilBERT IMDb β Masked Language Modeling (Trainer)
DistilBERT IMDb β Masked Language Modeling (Trainer)
A DistilBERT masked-language model adapted on IMDb movie-review text as part of my hands-on study of language-model fine-tuning with the Hugging Face ecosystem.
This checkpoint represents the Hugging Face Trainer implementation of the experiment.
Its companion repository preserves the corresponding Accelerate-based workflow:
β‘οΈ rIsHu009/distilbert-imdb-mlm-accelerate
Despite the historical repository name containing
finetuned-imdb, this is not a sentiment classifier. The preserved model architecture and weights confirm that the training objective is masked language modeling.
Experiment
The experiment explores continued masked-language-model training on movie-review text.
Rather than predicting whether a review is positive or negative, the model learns to reconstruct masked tokens from their surrounding context.
IMDb review text
β
DistilBERT tokenizer
β
random token masking
β
DistilBERT encoder
β
masked-token prediction
This is a form of domain-oriented language-model adaptation rather than supervised sentiment classification.
Model Details
| Property | Value |
|---|---|
| Architecture | DistilBertForMaskedLM |
| Task | Masked Language Modeling |
| Pipeline | Fill-Mask |
| Base model | distilbert-base-uncased |
| Text domain | Movie reviews / IMDb |
| Transformer layers | 6 |
| Hidden size | 768 |
| Attention heads | 12 |
| FFN dimension | 3,072 |
| Vocabulary size | 30,522 |
| Maximum sequence length | 512 |
| Weight precision | FP32 |
The saved configuration explicitly identifies DistilBertForMaskedLM. The checkpoint uses six Transformer layers, 768-dimensional hidden states and 12 attention heads. ξfileciteξturn100file5ξL2-L22ξ
Verified MLM Head
The saved model.safetensors contains the masked-language-model prediction components:
vocab_transform
vocab_layer_norm
vocab_projector
with a vocabulary projection over 30,522 tokens.
This confirms that the checkpoint is a masked-language model rather than a two-class IMDb sentiment classifier.
Training Configuration
The historical Trainer metadata preserves:
| Hyperparameter | Value |
|---|---|
| Learning rate | 2e-5 |
| Train batch size | 128 |
| Evaluation batch size | 128 |
| Seed | 42 |
| Optimizer | AdamW |
| LR scheduler | Linear |
| Epochs | 3 |
| Mixed precision | Native AMP |
ξfileciteξturn100file0ξL35-L45ξ
Historical software environment
- Transformers
4.51.3 - PyTorch
2.6.0+cu124 - Datasets
3.6.0 - Tokenizers
0.21.1
ξfileciteξturn100file0ξL56-L61ξ
Training Results
The preserved training history shows:
| Epoch | Step | Validation Loss |
|---|---|---|
| 1 | 79 | 3.2982 |
| 2 | 158 | 3.2832 |
| 3 | 237 | 3.2784 |
The original automatically generated card also recorded an evaluation loss of approximately 3.2700. ξfileciteξturn100file0ξL15-L19ξ
The epoch-by-epoch validation loss decreased from 3.2982 β 3.2832 β 3.2784 during the preserved run. ξfileciteξturn100file0ξL47-L53ξ
These are historical training results preserved from the original experiment rather than newly recomputed benchmarks.
Quick Start
from transformers import pipeline
MODEL_ID = "rIsHu009/distilbert-imdb-mlm-trainer"
fill_mask = pipeline(
"fill-mask",
model=MODEL_ID,
)
predictions = fill_mask(
"The movie was absolutely [MASK] and worth watching."
)
for prediction in predictions:
print(
prediction["token_str"],
prediction["score"],
)
The model predicts tokens that could plausibly replace [MASK] based on the surrounding context.
Direct Usage
from transformers import (
AutoTokenizer,
AutoModelForMaskedLM,
)
MODEL_ID = "rIsHu009/distilbert-imdb-mlm-trainer"
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
model = AutoModelForMaskedLM.from_pretrained(
MODEL_ID
)
Tokenizer
The checkpoint uses the standard uncased DistilBERT WordPiece tokenizer.
Important tokenizer properties include:
Tokenizer: DistilBertTokenizer
Vocabulary: 30,522 tokens
Maximum sequence length: 512
Lowercasing: enabled
Special tokens:
[PAD]
[UNK]
[CLS]
[SEP]
[MASK]
The preserved tokenizer configuration confirms lowercasing, a 512-token maximum length, and the standard [MASK] token required for masked-language modeling. ξfileciteξturn100file2ξL35-L55ξ
Masked LM vs Sentiment Classification
IMDb is commonly used for binary sentiment classification, but that is not the objective represented by this checkpoint.
A sentiment model would typically contain a classification head producing positive/negative logits.
This checkpoint instead contains a vocabulary-prediction head:
DistilBERT
β
vocab_transform
β
vocab_layer_norm
β
vocab_projector
β
30,522-token distribution
Its purpose is therefore predicting masked tokens in review-domain text.
Trainer vs Accelerate
This experiment is intentionally preserved as a pair:
| Repository | Training approach |
|---|---|
distilbert-imdb-mlm-trainer |
Hugging Face Trainer |
distilbert-imdb-mlm-accelerate |
Accelerate/manual training workflow |
The pair documents two different levels of abstraction for masked-language-model training.
Intended Use
This checkpoint is primarily useful for:
- masked-token prediction;
- studying masked language modeling;
- learning continued language-model training;
- experimenting with movie-review-domain text;
- learning Hugging Face
Trainer; - comparing Trainer and Accelerate;
- educational NLP experiments.
It is not intended as an IMDb sentiment classifier.
Evaluation
No downstream sentiment-classification accuracy is claimed because the checkpoint was not preserved as a sequence-classification model.
Likewise, no unsupported benchmark metrics are inferred from the repository.
The documented losses describe the masked-language-model training/evaluation objective.
Limitations
The model:
- is not a sentiment classifier;
- may produce incorrect or contextually strange token predictions;
- may inherit biases from DistilBERT's original pretraining data;
- may inherit biases or undesirable language patterns from movie-review text;
- should not be treated as a general-purpose generative model;
- has not been validated for high-stakes applications.
Masked-token predictions should be interpreted as language-model outputs rather than factual answers.
Learning Context
This checkpoint was created during hands-on study of Hugging Face NLP and Transformer training workflows.
It represents a progression involving:
pretrained DistilBERT
β
masked language modeling
β
domain-oriented text adaptation
β
Trainer
β
Accelerate / explicit training loop
Other learning artifacts on this profile cover question answering, translation, code language modeling, tokenization and other Transformer workflows.
Repository Contents
The repository includes:
model.safetensorsβ MLM checkpointconfig.jsonβ DistilBERT architecturetokenizer.jsontokenizer_config.jsonvocab.txt- special-token configuration
- historical Trainer arguments
- TensorBoard training artifacts
Companion Model
Accelerate implementation
rIsHu009/distilbert-imdb-mlm-accelerate
The companion repository preserves the corresponding lower-level Accelerate training workflow.
Author
Naman Chanana
- Hugging Face:
rIsHu009 - GitHub:
Rishy-09
Educational masked-language-modeling artifact preserved as part of an ongoing study of NLP, LLMs, and the Hugging Face ecosystem.
- Downloads last month
- 13
Model tree for rIsHu009/distilbert-imdb-mlm-trainer
Base model
distilbert/distilbert-base-uncased