How to Fine-tune the DistilRoBERTa for Propaganda Detection

Jun 12, 2022 | Educational

Are you fascinated by the potential of artificial intelligence in identifying and classifying propaganda? If so, you’re in the right place! This guide will walk you through fine-tuning the DistilRoBERTa model on the QCRI propaganda dataset. We’ll cover the setup, training procedures, and how to interpret the results for effective implementation.

Understanding the Model and Data

The distilroberta-propaganda-2class model is a specialized version of distilroberta-base, adjusted to classify propaganda into two classes. This performance was achieved using the QCRI propaganda dataset, which includes 19 different propaganda classes, all merged into a single category for simplification.

Training and Evaluation Data

  • Training Data: The 19-class QCRI propaganda data.
  • Evaluation Results:
    • Loss: 0.5087
    • Accuracy: 74.24%

Training Procedure

Here’s a breakdown of the training procedures and their parameters:

  • Learning Rate: 5e-05
  • Batch Sizes:
    • Training: 32
    • Evaluation: 32
  • Optimizer: Adam (betas=(0.9, 0.999), epsilon=1e-08)
  • Learning Rate Scheduler: Linear with warmup for 16 steps
  • Number of Epochs: 20
  • Mixed Precision Training: Native AMP

Training Results

Over the 20 epochs, the model’s loss and accuracy were recorded as follows. You can think of each training epoch as a practice session for a candidate in a talent show, where each round helps the contestant get better suited for the final performance:

Epoch   Validation Loss  Accuracy
1.0     0.5998           65.15%
2.0     0.5530           70.80%
3.0     0.5331           72.58%
4.0     0.5247           73.39%
5.0     0.5392           71.99%
6.0     0.5124           74.66%
...
20.0    0.5087           74.24%

As you can see, through 20 rounds of training, the model progressively improved its scores, eventually demonstrating significant proficiency in propaganda detection.

Framework Versions

This model was built using the following frameworks:

  • Transformers: 4.11.2
  • Pytorch: 1.7.1
  • Datasets: 1.11.0
  • Tokenizers: 0.10.3

Troubleshooting Tips

As you embark on your journey fine-tuning and deploying this model, you might encounter certain challenges. Here are some troubleshooting ideas:

  • Issue: Model does not seem to improve during training.
    Solution: Check the learning rate; it may be too high or too low. Adjust accordingly.
  • Issue: Inconsistent evaluation results.
    Solution: Look for potential data leakage between training and evaluation datasets, and ensure proper data categorization.
  • Issue: Training stops unexpectedly.
    Solution: Ensure adequate memory is available and clear cache as needed.

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

Conclusion

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox