![Fine-Tuning DeepSeek R1 on Reasoning Task with Unsloth [Part 2] Fine-Tuning DeepSeek R1 on Reasoning Task with Unsloth [Part 2]](https://miro.medium.com/v2/resize:fit:500/1*xlk4CAk_rf1ClPQdHBH1gw.png)
Fine-Tuning DeepSeek R1 on Reasoning Task with Unsloth [Part 2]
Author(s): Youssef Hosni
Originally published on Towards AI.
Hands-On Fine-Tuning DeepSeek on Medical Reasoning Dataset
This member-only story is on us. Upgrade to access all of Medium.
DeepSeek company recently released DeepSeek-R1, the next step in their work on reasoning models. It’s an upgrade from their earlier DeepSeek-R1-Lite-Preview and shows they’re serious about competing with OpenAI’s o1.
In this two-part hands-on tutorial, we will fine-tune the DeepSeek-R1-Distill-Llama-8B model on the Medical Chain-of-Thought Dataset from Hugging Face using Unsloth.
In the first part of this article, we covered the introduction to the DeepSeek R1 model and then we set up the working environment, downloaded the model and the tokenizer, and finally tested the model with zero-shot inference and observed the result without fine-tuning.
In this part, we will start with loading and processing the medical reasoning dataset that we will use to fine-tune the model. Once the data is ready we will fine-tune the model and finally, we will test the fine-tuned model and save it locally and on Hugging Face.
Join thousands of data leaders on the AI newsletter. Join over 80,000 subscribers and keep up to date with the latest developments in AI. From research to projects and ideas. If you are building an AI startup, an AI-related product, or a service, we invite you to consider becoming a sponsor.
Published via Towards AI
Take our 90+ lesson From Beginner to Advanced LLM Developer Certification: From choosing a project to deploying a working product this is the most comprehensive and practical LLM course out there!
Towards AI has published Building LLMs for Production—our 470+ page guide to mastering LLMs with practical projects and expert insights!

Discover Your Dream AI Career at Towards AI Jobs
Towards AI has built a jobs board tailored specifically to Machine Learning and Data Science Jobs and Skills. Our software searches for live AI jobs each hour, labels and categorises them and makes them easily searchable. Explore over 40,000 live jobs today with Towards AI Jobs!
Note: Content contains the views of the contributing authors and not Towards AI.