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.

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 checkpoint
  • config.json β€” DistilBERT architecture
  • tokenizer.json
  • tokenizer_config.json
  • vocab.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
Safetensors
Model size
67M params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for rIsHu009/distilbert-imdb-mlm-trainer

Finetuned
(13,052)
this model

Dataset used to train rIsHu009/distilbert-imdb-mlm-trainer

Collection including rIsHu009/distilbert-imdb-mlm-trainer