108 lines
1.9 KiB
Markdown
108 lines
1.9 KiB
Markdown
---
|
|
library_name: transformers
|
|
language:
|
|
- en
|
|
base_model:
|
|
- meta-llama/Llama-3.2-3B-Instruct
|
|
---
|
|
|
|
# LLaMA 3B Instruct Reasoning Model
|
|
|
|
This model is a **fine-tuned version of LLaMA 3B Instruct**, optimized for reasoning tasks such as step-by-step problem solving and logical question answering.
|
|
|
|
The model was fine-tuned using **LoRA (PEFT)** and later merged into the base model to create a **fully standalone model**.
|
|
|
|
---
|
|
|
|
## Base Model
|
|
|
|
- `meta-llama/Llama-3-3b-instruct`
|
|
|
|
---
|
|
|
|
## Model Details
|
|
|
|
- **Architecture:** LLaMA 3B
|
|
- **Fine-tuning method:** LoRA (merged)
|
|
- **Task:** Causal Language Modeling
|
|
- **Use case:** Reasoning / instruction-following
|
|
|
|
---
|
|
|
|
## Features
|
|
|
|
- Improved step-by-step reasoning
|
|
- Better structured answers
|
|
- Enhanced instruction following
|
|
- Suitable for logical tasks
|
|
|
|
---
|
|
## Training Details
|
|
|
|
This model was fine-tuned on a reasoning dataset from Hugging Face using LoRA.
|
|
|
|
The LoRA weights were merged with the base model to produce a standalone model for easier deployment and usage.
|
|
|
|
## How to Use
|
|
|
|
```python
|
|
from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
|
|
model_id = "shaw2037/Llama-3.2-3B-Instruct-Reasoning"
|
|
|
|
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
|
|
|
model = AutoModelForCausalLM.from_pretrained(
|
|
model_id,
|
|
device_map="auto"
|
|
)
|
|
|
|
prompt = "Solve step by step: If 2x + 3 = 11, what is x?"
|
|
|
|
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
|
|
|
outputs = model.generate(
|
|
**inputs,
|
|
max_new_tokens=200,
|
|
|
|
)
|
|
|
|
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
|
```
|
|
|
|
|
|
|
|
## Limitations
|
|
May produce incorrect reasoning steps.
|
|
|
|
Can hallucinate in complex scenarios.
|
|
|
|
Not guaranteed to be mathematically perfect.
|
|
|
|
|
|
## Intended Use
|
|
|
|
## Suitable for:
|
|
|
|
reasoning experiments
|
|
|
|
educational projects
|
|
|
|
LLM research
|
|
|
|
|
|
## Not suitable for:
|
|
|
|
medical advice
|
|
|
|
legal advice
|
|
|
|
financial decisions
|
|
|
|
safety-critical applications
|
|
|
|
|
|
### Install dependencies
|
|
|
|
```bash
|
|
pip install transformers accelerate torch |