Introduction to LLMs in Python
Learn to run, fine-tune and evaluate pre-trained large language models in Python with Hugging Face, including metrics such as BLEU and ROUGE.
Large language models can summarize, translate and generate text. Using one well means knowing how it is put together, how to adapt it to a task and how to judge what it produces. You run pre-trained Hugging Face models in Python pipelines, tell the main transformer structures apart, fine-tune a model on a tokenized dataset, and score its answers with metrics built for language tasks and with checks for toxicity and bias.
What You Will Achieve
- Run Hugging Face pipelines that summarize, generate and translate text, then clean up the replies
- Tell encoder-only, decoder-only and encoder-decoder transformers apart and pick the right model structure for a task
- Tokenize a dataset, configure a training run and apply the resulting fine-tuned model to new text
- Score model output with perplexity, BLEU, ROUGE, METEOR and exact match, and check it for toxicity and regard
Program Overview
Large Language Model Basics and the Transformer
Starts with what large language models can do and how they work, using pre-trained models for common language tasks.
- Summarization and text generation pipelines
- Translation with pre-trained models
- Transformer architecture and model structures
Fine-Tuning Pre-Trained Models
Covers preparing Hugging Face data and adapting a pre-trained model through training and transfer learning.
- Tokenization and mapping
- Training arguments and the trainer
- Fine-tuning approaches
- One-shot and other transfer learning approaches
Evaluation Metrics and Safeguarding LLMs
Turns to the evaluate library and the metrics suited to each language task, then the risks of real-world use.
- Loading and describing metrics with evaluate
- Perplexity, BLEU, ROUGE, METEOR and exact match
- Toxicity and regard checks
Certificate Awarded (Paid)
Job Outlook
These skills are used in natural language processing and machine learning work, where teams adapt pre-trained language models for summarization, translation and text generation and check their output for quality and safety.
Good for: Python learners who want hands-on practice adapting pre-trained language models and measuring their output with standard text metrics.
Keep in mind: The exercises rely on pre-trained Hugging Face models and datasets rather than external APIs, and the ethics material is limited to a few closing lessons on safeguarding, toxicity and regard.
Bottom line: A code-first route through the transformer types, a full fine-tuning run and the main text metrics, all with Hugging Face tools.
Frequently Asked Questions
Which Hugging Face tools do the exercises use?
The exercises use pipelines for summarization, generation and translation, tokenizers and the trainer for fine-tuning, and the evaluate library for loading and computing metrics. The work runs on pre-trained models and datasets in Python, with no external APIs involved.
How deep does the transformer material go?
The transformer lessons stay at a high level. They explain how the architecture works and how to tell encoder-only, decoder-only and encoder-decoder models apart, so you can match the right model structure to the language task in front of you.
What does the course say about LLM safety?
The final chapter closes with safeguarding. You check generated text for toxicity and measure regard, two ways to spot harmful or biased output, as part of a look at the challenges of applying large language models in the real world.
User Reviews
Write your review
You must be logged in to post a review.
Reviews can only be posted by registered learners. Log in or create a free account, then you will return here to post.


There are no reviews yet.