Instructions to use LumiOpen/Llama-Poro-2-8B-Long-Math-Reasoning-SFT-Preview with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LumiOpen/Llama-Poro-2-8B-Long-Math-Reasoning-SFT-Preview with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LumiOpen/Llama-Poro-2-8B-Long-Math-Reasoning-SFT-Preview") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("LumiOpen/Llama-Poro-2-8B-Long-Math-Reasoning-SFT-Preview") model = AutoModelForCausalLM.from_pretrained("LumiOpen/Llama-Poro-2-8B-Long-Math-Reasoning-SFT-Preview", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use LumiOpen/Llama-Poro-2-8B-Long-Math-Reasoning-SFT-Preview with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LumiOpen/Llama-Poro-2-8B-Long-Math-Reasoning-SFT-Preview" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LumiOpen/Llama-Poro-2-8B-Long-Math-Reasoning-SFT-Preview", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/LumiOpen/Llama-Poro-2-8B-Long-Math-Reasoning-SFT-Preview
- SGLang
How to use LumiOpen/Llama-Poro-2-8B-Long-Math-Reasoning-SFT-Preview with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "LumiOpen/Llama-Poro-2-8B-Long-Math-Reasoning-SFT-Preview" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LumiOpen/Llama-Poro-2-8B-Long-Math-Reasoning-SFT-Preview", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "LumiOpen/Llama-Poro-2-8B-Long-Math-Reasoning-SFT-Preview" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LumiOpen/Llama-Poro-2-8B-Long-Math-Reasoning-SFT-Preview", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use LumiOpen/Llama-Poro-2-8B-Long-Math-Reasoning-SFT-Preview with Docker Model Runner:
docker model run hf.co/LumiOpen/Llama-Poro-2-8B-Long-Math-Reasoning-SFT-Preview
Poro 2 8B Math Reasoning SFT Preview Model Card
Poro 2 8B Math Reasoning SFT Preview is a specialized model focused on mathematical reasoning and problem-solving. This preview model was created through supervised fine-tuning of a context-extended base model. This model excels at mathematical reasoning tasks but is not optimized for general conversational use or other domains.
The model produces reasoning traces in both English and Finnish, adapting the language of its reasoning based on the language of the input prompt.
Poro 2 was created in a collaboration between AMD Silo AI, the TurkuNLP group of the University of Turku, and High Performance Language Technologies (HPLT). Training was conducted on the LUMI supercomputer, using compute resources generously provided by CSC - IT Center for Science, Finland.
Poro 2 Long Model Family
The Poro 2 Long model family extends the Poro 2 models with longer context support and checkpoints trained especially on math reasoning. There are four checkpoints released: a base model, an instruction-tuned model, a math reasoning SFT checkpoint, and the final math reasoning RL checkpoint.
| Base Model | Instruct | Math Reasoning SFT | Math Reasoning RL |
|---|---|---|---|
| Poro 2 Long Base | Poro 2 Long Instruct | Poro 2 Long Math Reasoning SFT | Poro 2 Long Math Reasoning RL |
Model Overview
Poro 2 8B Math Reasoning SFT based on the Llama 3.1 8B architecture and has been fine-tuned for mathematical reasoning and problem-solving. The model supports both English and Finnish reasoning.
| Hyperparameter | Value |
|---|---|
| n_parameters | 8.03B |
| n_layers | 32 |
| n_heads | 32 |
| n_kv_heads | 8 |
| d_model | 4096 |
| vocab_size | 128384 |
| max_sequence_length | 131072 |
| base_model | Poro 2 Long Base |
Training Process
Context Extension
The base model underwent context extension using LongRoPE scaling to support 131k tokens.
Supervised Fine-Tuning (SFT)
The SFT phase focused on mathematical reasoning and used:
- 2.2M English math reasoning samples from nvidia/Llama-Nemotron-Post-Training-Dataset
- 1.4M Finnish translations of the reasoning samples
Training Dataset
| Stage | Model | Dataset | License |
|---|---|---|---|
| CPT | Llama-Poro-2-Long-Base | https://huggingface.co/datasets/HuggingFaceFW/finepdfs-edu | ODC-BY-1.0 |
| CPT | Llama-Poro-2-Long-Base | https://huggingface.co/datasets/HuggingFaceTB/finemath | ODC-BY-1.0 |
| CPT | Llama-Poro-2-Long-Base | https://huggingface.co/datasets/bigcode/starcoderdata | Refer source materials |
| Instruct SFT | Llama-Poro-2-Long-Instruct | https://huggingface.co/datasets/LumiOpen/poro2-instruction-collection | Llama 3 Community License |
| Math SFT | Llama-Poro-2-Long-Math-Reasoning-SFT-Preview | https://huggingface.co/datasets/nvidia/Llama-Nemotron-Post-Training-Dataset | CC-BY-4.0 |
| Math SFT | Llama-Poro-2-Long-Math-Reasoning-SFT-Preview | https://huggingface.co/datasets/LumiOpen/Llama-Nemotron-Post-Training-Dataset-SFT-math-FI | CC-BY-4.0 |
| Math RL | Llama-Poro-2-8B-Long-Math-Reasoning-RL-Preview | https://huggingface.co/datasets/Kwai-Klear/KlearReasoner-MathSub-30K | Apache-2.0 |
Post-Training Hyperparameters
SFT
| Hyperparameter | Value |
|---|---|
| Epochs | 3 |
| Global batch size | 128 |
| Learning rate | 5e-5 |
| Max sequence length | 32,768 |
| Packing | Yes |
Evaluation Results
Poro 2 8B Math Reasoning SFT Preview demonstrates strong mathematical reasoning capabilities in both English and Finnish, showing substantial improvements over the original Poro 2 8B Instruct model.
| Model | Math-500 EN | Math-500 FI | AIME25 EN | AIME25 FI | AIME26 EN | AIME26 FI |
|---|---|---|---|---|---|---|
| Poro 2 8B Math Reasoning SFT Preview | 0.96 | 0.928 | 0.499 | 0.403 | 0.604 | 0.478 |
| Poro 2 8B Instruct | 0.47 | 0.392 | 0.009 | 0.003 | 0.010 | 0.006 |
Usage
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model_name = "LumiOpen/Llama-Poro-2-Long-Math-Reasoning-SFT-Preview"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype=torch.bfloat16,
device_map="auto"
)
# Finnish conversation example
messages = [
{"role": "user", "content": "Kuinka monta positiivista kokonaislukujakajaa luvulla 196 on?"}
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
return_tensors="pt"
)
outputs = model.generate(
inputs,
max_new_tokens=32000,
temperature=0.7,
do_sample=True,
pad_token_id=tokenizer.eos_token_id
)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
Intended Use
Poro 2 8B Math Reasoning SFT Preview is designed for:
- Mathematical problem-solving and reasoning tasks
- Step-by-step mathematical reasoning with explicit reasoning traces
- Math education and tutoring applications
- Competition mathematics (e.g., AIME-level problems)
- Mathematical reasoning in both English and Finnish
Note: This model is optimized specifically for mathematical reasoning and is not suitable for general conversational AI or other domains.
Ethical Considerations and Limitations
Poro 2 8B Math Reasoning SFT Preview is a specialized model optimized for mathematical reasoning in English and Finnish. As a preview release, this model has specific limitations:
Key limitations:
- Optimized exclusively for mathematical reasoning; not suitable for general conversation, coding, creative writing, or other domains
- This is an early preview release
- Reasoning traces are in English or Finnish depending on prompt language; limited proficiency in other languages
- May occasionally generate biased, inappropriate, or factually incorrect content
Safety Considerations:
- Users should verify important factual claims independently
- The model should not be used for medical, legal, or financial advice without human oversight
- Responses should be reviewed for appropriateness in sensitive contexts
License
Built with Llama
Poro 2 8B Math Reasoning SFT Preview is released under the Llama 3.1 Community License. Please review the license terms before use.
Citation
@misc{poro2_long_2025, title={}, author={}, year={}, howpublished={} }
Acknowledgments
We thank CSC - IT Center for Science, Finland for providing access to the LUMI supercomputer. This work was supported by the High Performance Language Technologies (HPLT) project and conducted in collaboration with TurkuNLP from the University of Turku. This project has received funding from the European Union's Horizon Europe research and innovation programme under grant agreement No 101070350.
- Downloads last month
- 3