Update README.md
Browse files
README.md
CHANGED
@@ -1,54 +1,147 @@
|
|
1 |
---
|
2 |
-
base_model: nvidia/Nemotron-Research-Reasoning-Qwen-1.5B
|
3 |
-
language:
|
4 |
-
- en
|
5 |
license: cc-by-nc-4.0
|
6 |
-
|
7 |
-
library_name: transformers
|
8 |
tags:
|
9 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
---
|
12 |
|
13 |
-
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
-
|
17 |
-
Install llama.cpp through brew (works on Mac and Linux)
|
18 |
|
19 |
-
|
20 |
-
brew install llama.cpp
|
21 |
|
22 |
-
|
23 |
-
Invoke the llama.cpp server or the CLI.
|
24 |
|
25 |
-
|
26 |
-
```bash
|
27 |
-
llama-cli --hf-repo AdvRahul/Axion-Flash-Reasoning-2B-Q8_0-GGUF --hf-file axion-flash-reasoning-2B-Q8_0.gguf -p "The meaning to life and the universe is"
|
28 |
-
```
|
29 |
|
30 |
-
|
31 |
-
|
32 |
-
llama-server --hf-repo AdvRahul/Axion-Flash-Reasoning-2B-Q8_0-GGUF --hf-file axion-flash-reasoning-2B-Q8_0.gguf -c 2048
|
33 |
-
```
|
34 |
|
35 |
-
|
36 |
|
37 |
-
|
38 |
-
|
39 |
-
git clone https://github.com/ggerganov/llama.cpp
|
40 |
-
```
|
41 |
|
42 |
-
|
43 |
-
```
|
44 |
-
cd llama.cpp && LLAMA_CURL=1 make
|
45 |
-
```
|
46 |
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
|
|
|
1 |
---
|
|
|
|
|
|
|
2 |
license: cc-by-nc-4.0
|
3 |
+
base_model: nvidia/Nemotron-Research-Reasoning-Qwen-1.5B
|
|
|
4 |
tags:
|
5 |
+
- qwen
|
6 |
+
- reasoning
|
7 |
+
- fine-tuned
|
8 |
+
- instruction-tuned
|
9 |
+
- axion
|
10 |
+
- logic
|
11 |
+
- math
|
12 |
+
- code
|
13 |
+
---
|
14 |
+
|
15 |
+
# AdvRahul/Axion-Flash-Reasoning-2B
|
16 |
+
|
17 |
+
**An optimized and instruction-tuned model for high-speed, complex reasoning tasks.** 🚀
|
18 |
+
|
19 |
+
`Axion-Flash-Reasoning-2B` is a fine-tuned version of NVIDIA's state-of-the-art `Nemotron-Research-Reasoning-Qwen-1.5B` model. This version is specifically adapted to be more instruction-friendly and computationally efficient, making it ideal for integration into applications requiring powerful reasoning capabilities without the overhead of larger models.
|
20 |
+
|
21 |
+
## 🚀 Model Details
|
22 |
+
|
23 |
+
* **Model Creator:** AdvRahul
|
24 |
+
* **Base Model:** [nvidia/Nemotron-Research-Reasoning-Qwen-1.5B](https://huggingface.co/nvidia/Nemotron-Research-Reasoning-Qwen-1.5B) (v2 checkpoint)
|
25 |
+
* **Fine-tuning Focus:** Enhanced Instruction Following & Practical Usability
|
26 |
+
* **Architecture:** Qwen 1.5
|
27 |
+
* **License:** Creative Commons Attribution-NonCommercial 4.0 International (`cc-by-nc-4.0`)
|
28 |
|
29 |
---
|
30 |
|
31 |
+
## 💻 How to Use
|
32 |
+
|
33 |
+
This model can be used with the `transformers` library.
|
34 |
+
|
35 |
+
### Basic Inference with `pipeline`
|
36 |
+
|
37 |
+
The easiest way to get started is with the `text-generation` pipeline.
|
38 |
+
|
39 |
+
```python
|
40 |
+
from transformers import pipeline
|
41 |
+
import torch
|
42 |
+
|
43 |
+
# For optimal performance, use a GPU
|
44 |
+
pipe = pipeline(
|
45 |
+
"text-generation",
|
46 |
+
model="AdvRahul/Axion-Flash-Reasoning-2B",
|
47 |
+
torch_dtype=torch.bfloat16,
|
48 |
+
device_map="auto"
|
49 |
+
)
|
50 |
+
|
51 |
+
# Qwen models use a specific chat template. The pipeline handles this automatically.
|
52 |
+
messages = [
|
53 |
+
{"role": "system", "content": "You are a helpful assistant that excels at logical reasoning."},
|
54 |
+
{"role": "user", "content": "I have 3 apples and I buy 5 more. I then give 2 apples to my friend. How many apples do I have left?"}
|
55 |
+
]
|
56 |
+
|
57 |
+
prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
58 |
+
outputs = pipe(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
|
59 |
+
|
60 |
+
print(outputs[0]["generated_text"])
|
61 |
+
|
62 |
+
Optimized Inference (4-bit Quantization)
|
63 |
+
To achieve "flash" speed and reduce memory usage, you can load the model in 4-bit using bitsandbytes.
|
64 |
+
|
65 |
+
Bash
|
66 |
+
|
67 |
+
pip install transformers torch accelerate bitsandbytes
|
68 |
+
Python
|
69 |
+
|
70 |
+
import torch
|
71 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
72 |
+
|
73 |
+
model_id = "AdvRahul/Axion-Flash-Reasoning-2B"
|
74 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
75 |
+
model = AutoModelForCausalLM.from_pretrained(
|
76 |
+
model_id,
|
77 |
+
torch_dtype=torch.bfloat16,
|
78 |
+
device_map="auto",
|
79 |
+
# This enables 4-bit quantization
|
80 |
+
load_in_4bit=True
|
81 |
+
)
|
82 |
+
|
83 |
+
messages = [
|
84 |
+
{"role": "system", "content": "You are an expert code assistant."},
|
85 |
+
{"role": "user", "content": "Write a Python function to calculate the factorial of a number using recursion."}
|
86 |
+
]
|
87 |
+
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
88 |
+
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
89 |
+
|
90 |
+
outputs = model.generate(**inputs, max_new_tokens=150)
|
91 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
92 |
+
📝 Model Description
|
93 |
+
Fine-Tuning Philosophy
|
94 |
+
While the base Nemotron-Research-Reasoning model demonstrates world-class capabilities in formal reasoning (math, code, logic), Axion-Flash has been further instruction-tuned to make these powerful abilities more accessible and practical for real-world applications. The goal is to bridge the gap between a pure research model and a deployable, instruction-following assistant that developers can easily integrate into their products.
|
95 |
+
|
96 |
+
This fine-tuning enhances the model's ability to understand and follow user instructions in a conversational format, unlocking its reasoning power for a broader range of tasks.
|
97 |
+
|
98 |
+
Key Capabilities
|
99 |
+
Complex Reasoning: Inherits the base model's strength in solving logic puzzles, scientific questions, and multi-step problems.
|
100 |
+
|
101 |
+
Code Generation: Proficient in generating code for various programming challenges and tasks.
|
102 |
+
|
103 |
+
Mathematical Prowess: Excels at solving mathematical problems, from basic arithmetic to more complex Olympiad-level questions.
|
104 |
+
|
105 |
+
Enhanced Instruction Following: Fine-tuned to better adhere to user instructions and constraints in a chat-like setting.
|
106 |
+
|
107 |
+
ℹ️ Base Model Information (Nemotron-Research-Reasoning-Qwen-1.5B)
|
108 |
+
<details>
|
109 |
+
<summary>Click to expand details on the powerful base model</summary>
|
110 |
+
|
111 |
+
Nemotron-Research-Reasoning-Qwen-1.5B is a leading open-weight model for complex reasoning, trained by NVIDIA using the ProRL (Prolonged Reinforcement Learning) algorithm. This advanced training method enables the model to explore reasoning strategies more deeply, leading to significant performance gains.
|
112 |
+
|
113 |
+
The base model was trained on a diverse set of datasets, including:
|
114 |
+
|
115 |
+
DeepScaleR-Preview-Dataset
|
116 |
+
|
117 |
+
Eurus-2-RL-Data
|
118 |
+
|
119 |
+
Reasoning-gym
|
120 |
|
121 |
+
IFEval
|
|
|
122 |
|
123 |
+
SCP-116K
|
|
|
124 |
|
125 |
+
It sets a new state-of-the-art standard for models in its size class, outperforming competitors by a large margin on benchmarks for math, coding, logic puzzles, and STEM reasoning. For detailed performance metrics, please refer to the original model card.
|
|
|
126 |
|
127 |
+
</details>
|
|
|
|
|
|
|
128 |
|
129 |
+
⚖️ License and Terms of Use
|
130 |
+
This model is released under the cc-by-nc-4.0 license, inheriting the license of its base model.
|
|
|
|
|
131 |
|
132 |
+
This means it is available for research and non-commercial use only. Please review the license terms before using this model in your projects.
|
133 |
|
134 |
+
Citing the Base Model's Research
|
135 |
+
If you find the underlying methods of this model useful in your research, please cite the ProRL paper:
|
|
|
|
|
136 |
|
137 |
+
Code snippet
|
|
|
|
|
|
|
138 |
|
139 |
+
@article{liu2025prorl,
|
140 |
+
author = {Mingjie Liu, Shizhe Diao, Ximing Lu, Jian Hu, Xin Dong, Yejin Choi, Jan Kautz, Yi Dong},
|
141 |
+
title={ProRL: Prolonged Reinforcement Learning Expands Reasoning Boundaries in Large Language Models},
|
142 |
+
journal = {arXiv preprint},
|
143 |
+
year = {2025},
|
144 |
+
archivePrefix = {arXiv},
|
145 |
+
primaryClass = {cs.CL},
|
146 |
+
url={[https://arxiv.org/abs/2505.24864](https://arxiv.org/abs/2505.24864)},
|
147 |
+
}
|