File size: 3,643 Bytes
4007d79
 
14bdd19
 
 
 
 
4007d79
 
 
e650894
8a18d84
 
 
 
 
 
c724eba
4547fe2
8a18d84
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
---
license: apache-2.0
tags:
- trl
- math
- text-generation-inference
- code
datasets:
- nvidia/OpenCodeReasoning
- nvidia/OpenMathReasoning
- prithivMLmods/Helios-R-6M
language:
- en
base_model:
- Qwen/Qwen3-4B-Thinking-2507
pipeline_tag: text-generation
library_name: transformers
---

![1](https://cdn-uploads.huggingface.co/production/uploads/65bb837dbfb878f46c77de4c/IObi572uIr3vg89VuZD5x.png)

# **Logics-Qwen3-Math-4B**

> **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.

## **Key Features**

1. **Mathematical & Logical Reasoning**
   Fine-tuned for high-precision math reasoning, algorithmic problem-solving, and logical coding tasks.

2. **Event-Driven & Probabilistic Modeling**
   Performs probability-based simulations, structured decision-making, and multi-step logical reasoning with strong accuracy.

3. **Multilingual Problem Solving**
   Supports math and logic tasks across multiple languages, suitable for global research and education workflows.

4. **Hybrid Symbolic-Algorithmic Thinking**
   Combines structured logic, symbolic computation, and probabilistic inference to handle uncertainty-driven problems efficiently.

5. **Structured Output Mastery**
   Generates outputs in **LaTeX**, **Markdown**, **JSON**, **CSV**, and **YAML**, enabling smooth integration into technical and research workflows.

6. **Optimized 4B Parameter Footprint**
   Deployable on **mid-range GPUs**, **offline clusters**, and **edge devices**, maintaining high reasoning quality while being resource-efficient.

## **Quickstart with Transformers**

```python
from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "prithivMLmods/Logics-Qwen3-Math-4B"

model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype="auto",
    device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(model_name)

prompt = "Solve the equation x^2 - 5x + 6 = 0 and show all reasoning steps."

messages = [
    {"role": "system", "content": "You are a math and logic tutor skilled in algebra, probability, and structured programming reasoning."},
    {"role": "user", "content": prompt}
]

text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True
)

model_inputs = tokenizer([text], return_tensors="pt").to(model.device)

generated_ids = model.generate(
    **model_inputs,
    max_new_tokens=512
)
generated_ids = [
    output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]

response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)
```

## **Intended Use**

* High-precision mathematical reasoning and problem-solving
* Algorithmic logic, structured coding tasks, and probability analysis
* Educational and research-focused workflows
* Deployment on mid-resource environments with efficient reasoning
* Structured data and technical content generation

## **Limitations**

* Focused on math and logic—less suited for creative writing or casual conversation
* Very complex multi-hop reasoning may challenge the 4B parameter capacity
* Prioritizes structured reasoning over conversational tone
* Outputs may be inconsistent for extremely long or cross-domain multi-document contexts