- In this machine learning and large-language model tutorial, we explain how to install and run locally DeepScaleR-1.5B model. This model is fine-tuned to solve advanced mathematics at the International Math Olympiad level.
- This model is fine-tuned from DeepSeek-R1-Distilled-Qwen-1.5B using distributed reinforcement learning (RL) to scale up to long context lengths.
The YouTube tutorial is given below.
Background Information about DeepScaleR-1.5B
This model fine-tuned on 40,000 problem-answer pairs from:
- AIME problems (1984-2023): refer to the challenging math problems presented on the American Invitational Mathematics Examination (AIME), a competition for high school students where each question requires an integer answer between 0 and 999, testing a wide range of mathematical concepts like algebra, geometry, number theory, and combinatorics, often demanding creative solutions and deep understanding of mathematical relationships
- AMC problems (prior to 2023): The American Mathematics Competition, better known as the AMC, is the first step to becoming America’s best mathlete and going all the way to the Math Olympiad. But the AMC is so much more than just the pathway to winning the title of America’s greatest high school mathematician.
- Omni-MATH dataset: A comprehensive and challenging benchmark specifically designed to assess LLMs’ mathematical reasoning at the Olympiad level.
- Still dataset.
Installation Instructions for DeepScaleR-1.5B
Here, we present the main installation instructions for DeepScaleR-1.5B. For thorough explanation of all installation steps see the YouTube tutorial.
First, you have to make sure that you have Microsoft Visual Studio C++ Compilers installed on your system. To do that, go to the official website and install the Microsoft Visual Studio C++. Then, make sure that you install the NVIDIA CUDA Toolkit by following the instructions given here. You also need to have Python installed on your system. The installation instructions on this website apply to Windows 10 or 11.
First, create workspace folder, and then, create and activate the Python virtual environments:
cd\
mkdir testModel
cd testModel
python -m venv env1
env1\Scripts\activate.bat
Then, make sure that you install the PyTorch by using the official website given here. The selection table on the website will produce this installation command:
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu126
Then, install transformers, accelerate, and huggingface_hub Python packages and libraries:
pip install transformers
pip install accelerate
pip install huggingface_hub
Then, execute this Python script that will download all the model files from the remote Hugginface repository:
from huggingface_hub import snapshot_download
snapshot_download(repo_id="agentica-org/DeepScaleR-1.5B-Preview",
local_dir="C:\\testModel\\")
This code will download all the model files. The next step is to write a test code. The code is given below.
import torch
import transformers
model_id="C:\\testModel\\"
pipeline = transformers.pipeline(
"text-generation",
model=model_id,
model_kwargs={"torch_dtype": "auto"},
device_map="auto",
)
problem="How to solve the equation sin(2x)=0.1x-0.2?"
messages = [
{"role": "system", "content": "You are a helpful assistant"},
{"role": "user", "content": problem},
]
outputs = pipeline(messages, max_new_tokens=2024)
print(outputs[0]["generated_text"][-1])