Update README.md
Browse files
README.md
CHANGED
|
@@ -4,6 +4,98 @@ datasets:
|
|
| 4 |
- nvidia/OpenCodeReasoning
|
| 5 |
- nvidia/OpenMathReasoning
|
| 6 |
- prithivMLmods/Helios-R-6M
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
---
|
| 8 |
|
| 9 |
-

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
- nvidia/OpenCodeReasoning
|
| 5 |
- nvidia/OpenMathReasoning
|
| 6 |
- prithivMLmods/Helios-R-6M
|
| 7 |
+
language:
|
| 8 |
+
- en
|
| 9 |
+
base_model:
|
| 10 |
+
- Qwen/Qwen3-4B-Thinking-2507
|
| 11 |
+
pipeline_tag: text-generation
|
| 12 |
+
tags:
|
| 13 |
+
- trl
|
| 14 |
+
- text-generation-inference
|
| 15 |
+
- code
|
| 16 |
+
- math
|
| 17 |
+
- logics
|
| 18 |
+
library_name: transformers
|
| 19 |
---
|
| 20 |
|
| 21 |
+

|
| 22 |
+
|
| 23 |
+
# **Logics-Qwen3-Math-4B**
|
| 24 |
+
|
| 25 |
+
> **Logics-Qwen3-Math-4B** is a reasoning-focused model fine-tuned on **Qwen3-4B-Thinking-2507** for **mathematical reasoning** and **logical coding**, trained on **OpenMathReasoning**, **OpenCodeReasoning**, and **Helios-R-6M** datasets. It excels in structured **mathematical problem solving**, **algorithmic logic**, and **probabilistic reasoning**, making it ideal for educators, researchers, and developers focused on computational logic and math.
|
| 26 |
+
|
| 27 |
+
## **Key Features**
|
| 28 |
+
|
| 29 |
+
1. **Mathematical & Logical Reasoning**
|
| 30 |
+
Fine-tuned for high-precision math reasoning, algorithmic problem-solving, and logical coding tasks.
|
| 31 |
+
|
| 32 |
+
2. **Event-Driven & Probabilistic Modeling**
|
| 33 |
+
Performs probability-based simulations, structured decision-making, and multi-step logical reasoning with strong accuracy.
|
| 34 |
+
|
| 35 |
+
3. **Multilingual Problem Solving**
|
| 36 |
+
Supports math and logic tasks across multiple languages, suitable for global research and education workflows.
|
| 37 |
+
|
| 38 |
+
4. **Hybrid Symbolic-Algorithmic Thinking**
|
| 39 |
+
Combines structured logic, symbolic computation, and probabilistic inference to handle uncertainty-driven problems efficiently.
|
| 40 |
+
|
| 41 |
+
5. **Structured Output Mastery**
|
| 42 |
+
Generates outputs in **LaTeX**, **Markdown**, **JSON**, **CSV**, and **YAML**, enabling smooth integration into technical and research workflows.
|
| 43 |
+
|
| 44 |
+
6. **Optimized 4B Parameter Footprint**
|
| 45 |
+
Deployable on **mid-range GPUs**, **offline clusters**, and **edge devices**, maintaining high reasoning quality while being resource-efficient.
|
| 46 |
+
|
| 47 |
+
## **Quickstart with Transformers**
|
| 48 |
+
|
| 49 |
+
```python
|
| 50 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 51 |
+
|
| 52 |
+
model_name = "prithivMLmods/Logics-Qwen3-Math-4B"
|
| 53 |
+
|
| 54 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 55 |
+
model_name,
|
| 56 |
+
torch_dtype="auto",
|
| 57 |
+
device_map="auto"
|
| 58 |
+
)
|
| 59 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 60 |
+
|
| 61 |
+
prompt = "Solve the equation x^2 - 5x + 6 = 0 and show all reasoning steps."
|
| 62 |
+
|
| 63 |
+
messages = [
|
| 64 |
+
{"role": "system", "content": "You are a math and logic tutor skilled in algebra, probability, and structured programming reasoning."},
|
| 65 |
+
{"role": "user", "content": prompt}
|
| 66 |
+
]
|
| 67 |
+
|
| 68 |
+
text = tokenizer.apply_chat_template(
|
| 69 |
+
messages,
|
| 70 |
+
tokenize=False,
|
| 71 |
+
add_generation_prompt=True
|
| 72 |
+
)
|
| 73 |
+
|
| 74 |
+
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
|
| 75 |
+
|
| 76 |
+
generated_ids = model.generate(
|
| 77 |
+
**model_inputs,
|
| 78 |
+
max_new_tokens=512
|
| 79 |
+
)
|
| 80 |
+
generated_ids = [
|
| 81 |
+
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
|
| 82 |
+
]
|
| 83 |
+
|
| 84 |
+
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
| 85 |
+
print(response)
|
| 86 |
+
```
|
| 87 |
+
|
| 88 |
+
## **Intended Use**
|
| 89 |
+
|
| 90 |
+
* High-precision mathematical reasoning and problem-solving
|
| 91 |
+
* Algorithmic logic, structured coding tasks, and probability analysis
|
| 92 |
+
* Educational and research-focused workflows
|
| 93 |
+
* Deployment on mid-resource environments with efficient reasoning
|
| 94 |
+
* Structured data and technical content generation
|
| 95 |
+
|
| 96 |
+
## **Limitations**
|
| 97 |
+
|
| 98 |
+
* Focused on math and logic—less suited for creative writing or casual conversation
|
| 99 |
+
* Very complex multi-hop reasoning may challenge the 4B parameter capacity
|
| 100 |
+
* Prioritizes structured reasoning over conversational tone
|
| 101 |
+
* Outputs may be inconsistent for extremely long or cross-domain multi-document contexts
|