Hands-on work from my journey through the Hugging Face LLM Course and The Reasoning Course, plus a flagship end-to-end project: fine-tuning BERT for Romanian extractive question answering on the XQuAD-ro dataset.
Companion to my GitHub profile — the HF completion certificates (LLM Course Unit 1, Unit 3, and The Reasoning Course — Fundamentals of GRPO) shown there were earned working through the notebooks in this repo.
Two extractive QA models fine-tuned on the Romanian split of
XQuAD, loaded directly from the
DeepMind mirror as xquad.ro.json and prepared with 🤗 datasets.
| Notebook | Base model | Approach | Colab |
|---|---|---|---|
bert-base-romanian-cased-v1.ipynb |
dumitrescustefan/bert-base-romanian-cased-v1 |
Monolingual Romanian BERT | |
multilingual-bert.ipynb |
bert-base-multilingual-cased |
Multilingual BERT baseline |
Both notebooks cover the full pipeline: dataset download → tokenization with
sliding-window context → AutoModelForQuestionAnswering fine-tuning → post-
processing spans → EM / F1 evaluation. See
projects/romanian-qa-xquad-ro/README.md
for the model comparison.
Group Relative Policy Optimization — the RL algorithm behind reasoning models —
studied three ways: from scratch in raw PyTorch, with 🤗 trl, and with
unsloth for memory-efficient training.
| Notebook | What it covers |
|---|---|
GRPO_Implementation_in_PyTorch.ipynb |
GRPO from first principles on Qwen/Qwen2-Math-1.5B — group sampling, reward computation, advantage normalization and the policy update, written out by hand |
Fine_tuning_a_model_with_GRPO.ipynb |
GRPOTrainer from trl + LoRA (peft) on HuggingFaceTB/SmolLM-135M-Instruct over the mlabonne/smoltldr summarization set, tracked in Weights & Biases |
nb/Gemma3_(1B)-GRPO.ipynb |
google/gemma-3-1b-it on GSM8K with unsloth + vllm — custom reward functions for answer format and correctness, then pushing the result to the Hub |
Selected chapters from the Hugging Face LLM course, reworked with my own experiments and notes.
Task: GLUE / MRPC paraphrase classification with bert-base-uncased.
01_trainer_api.ipynb—TrainerAPI end-to-end02_full_training_loop.ipynb— same task with a hand-written PyTorch loop +accelerate03_learning_curves.ipynb— reading and debugging training curvesEvaluation.ipynb— metrics withevaluate
01_using_pretrained_models.ipynb02_using_and_sharing.ipynb— pushing checkpoints to the Hub
01_importing_external_datasets.ipynb— CSV / JSON / local files02_slicing_and_dicing.ipynb—map,filter,train_test_spliton UCI drugsCom reviews03_handling_big_datasets.ipynb— streaming + memory-mapping PubMed summarizationSemantic_Search_with_FAISS.ipynb— embedding thelewtun/github-issuescorpus and building a FAISS index
Fast_Tokenizers_Special_Powers.ipynb— offset mappings, word IDs, QA/NER pipelinesTraining_a_New_Tokenizer_from_an_Old_One.ipynb— retraining oncode_search_netNormalization_and_Pre-tokenization.ipynb— the pieces of the tokenization pipelineBuilding_A_Tokenizer_from_Scratch.ipynb— assembling one block by blockWordPiece_from_Scratch.ipynb— the WordPiece algorithm by handUnigram_from_Scratch.ipynb— the Unigram algorithm by hand
Each notebook fine-tunes and pushes a checkpoint to the Hub.
TokenClassification.ipynb— NER on CoNLL-2003 →bert-finetuned-nerFine-tuning_a_Masked_Language_Model.ipynb— domain-adapting DistilBERT to IMDBTranslation.ipynb—Helsinki-NLP/opus-mt-en-fron KDE4 en→frSummarization.ipynb—google/mt5-smallon multilingual Amazon reviewsQuestion_answering.ipynb— BERT on SQuAD (the English precursor to the XQuAD-ro project above)Training_a_Data_Science_Syntax_Auto_Completer_Model(Causal Language Model)_from_Scratch.ipynb— a GPT-2-style code completer trained from scratch on CodeParrot
error_fix_workflow.ipynb— debugging the training pipeline and reading tracebacks
Gradio_Interference_Class.ipynb— theInterfacebasicsAdvanced_Interface_features.ipynb— state, interpretation, layoutPlaying_with_the_Gradio_API.ipynb— driving a Space programmaticallyGradio_Integration_with_HuggingFace.ipynb— wiring demos to Hub models and Spaces
Chat_Templates.ipynb— chat formats across SmolLM2 / Qwen / Mistral, convertingsmoltalkto model-ready textSupervised Fine-Tuning with SFTTrainer.ipynb—SFTTraineronHuggingFaceTB/SmolLM2-135MLoRA SFT.ipynb— parameter-efficient SFT withpeftadapters, then merging them backEvaluation.ipynb— benchmarking withlighteval
Core transformers · datasets · evaluate · accelerate · torch · tokenizers
Fine-tuning & RL trl · peft · unsloth · bitsandbytes · vllm
Tooling gradio · lighteval · faiss · wandb · scikit-learn
pip install -r requirements.txt
jupyter labrequirements.txt covers the core course notebooks. The GRPO, SFT and
evaluation notebooks pull their heavier extras (trl, peft, unsloth,
vllm, lighteval, wandb) inline with pip install in the first cell, so
they run as-is in Colab.
Every notebook also carries an Open in Colab badge — a free GPU runtime is enough for most course notebooks; the QA fine-tuning and GRPO notebooks want a T4 or better.
projects/ Flagship end-to-end projects (Romanian QA)
course/ HF course chapter walkthroughs (ch3–ch9, ch11)
nb/ Standalone notebooks (Gemma 3 GRPO)
*.ipynb Reasoning course GRPO notebooks
- Author: @pop123-ux
- Medium write-ups: medium.com/@Pop123
MIT.