Update README.md
Browse files
README.md
CHANGED
@@ -2,201 +2,138 @@
|
|
2 |
library_name: transformers
|
3 |
tags:
|
4 |
- mamba
|
5 |
-
-
|
6 |
- reasoning
|
7 |
base_model:
|
8 |
- tiiuae/Falcon3-Mamba-7B-Instruct
|
9 |
pipeline_tag: text-generation
|
10 |
---
|
11 |
|
12 |
-
# Model Card
|
13 |
-
|
14 |
-
<!-- Provide a quick summary of what the model is/does. -->
|
15 |
-
|
16 |
-
|
17 |
|
18 |
## Model Details
|
19 |
|
20 |
-
|
21 |
-
|
22 |
-
This model is a fine tuned version of Falcon3 Mamba 7 billion instruct.
|
23 |
|
24 |
-
|
25 |
|
26 |
-
|
27 |
|
28 |
-
-
|
29 |
-
- **Model type:** Mamba
|
30 |
|
31 |
-
|
|
|
|
|
|
|
32 |
|
33 |
-
|
34 |
|
35 |
-
|
36 |
-
- **Paper [optional]:** [More Information Needed]
|
37 |
-
- **Demo [optional]:** [More Information Needed]
|
38 |
|
39 |
-
|
40 |
|
41 |
-
|
|
|
|
|
42 |
|
43 |
-
|
44 |
|
45 |
-
|
|
|
|
|
46 |
|
47 |
-
|
48 |
|
49 |
-
|
|
|
|
|
50 |
|
51 |
-
|
52 |
|
53 |
-
|
54 |
|
55 |
-
|
|
|
56 |
|
57 |
-
|
58 |
|
59 |
-
|
60 |
|
61 |
-
## Bias, Risks, and Limitations
|
62 |
|
63 |
-
|
64 |
|
65 |
-
|
|
|
66 |
|
67 |
-
|
68 |
|
69 |
-
|
70 |
|
71 |
-
|
|
|
|
|
|
|
72 |
|
73 |
-
|
74 |
|
75 |
-
|
|
|
|
|
|
|
|
|
76 |
|
77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
|
79 |
## Training Details
|
80 |
|
81 |
-
### Training Data
|
82 |
-
|
83 |
-
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
84 |
-
|
85 |
-
[More Information Needed]
|
86 |
-
|
87 |
-
### Training Procedure
|
88 |
-
|
89 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
90 |
-
|
91 |
-
#### Preprocessing [optional]
|
92 |
-
|
93 |
-
[More Information Needed]
|
94 |
-
|
95 |
-
|
96 |
-
#### Training Hyperparameters
|
97 |
-
|
98 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
99 |
|
100 |
-
|
101 |
|
102 |
-
|
103 |
-
|
104 |
-
|
|
|
|
|
|
|
|
|
|
|
105 |
|
106 |
## Evaluation
|
107 |
|
108 |
-
|
109 |
-
|
110 |
-
### Testing Data, Factors & Metrics
|
111 |
-
|
112 |
-
#### Testing Data
|
113 |
-
|
114 |
-
<!-- This should link to a Dataset Card if possible. -->
|
115 |
-
|
116 |
-
[More Information Needed]
|
117 |
-
|
118 |
-
#### Factors
|
119 |
-
|
120 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
121 |
-
|
122 |
-
[More Information Needed]
|
123 |
-
|
124 |
-
#### Metrics
|
125 |
-
|
126 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
127 |
-
|
128 |
-
[More Information Needed]
|
129 |
-
|
130 |
-
### Results
|
131 |
-
|
132 |
-
[More Information Needed]
|
133 |
-
|
134 |
-
#### Summary
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
## Model Examination [optional]
|
139 |
-
|
140 |
-
<!-- Relevant interpretability work for the model goes here -->
|
141 |
-
|
142 |
-
[More Information Needed]
|
143 |
-
|
144 |
-
## Environmental Impact
|
145 |
-
|
146 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
147 |
-
|
148 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
149 |
-
|
150 |
-
- **Hardware Type:** [More Information Needed]
|
151 |
-
- **Hours used:** [More Information Needed]
|
152 |
-
- **Cloud Provider:** [More Information Needed]
|
153 |
-
- **Compute Region:** [More Information Needed]
|
154 |
-
- **Carbon Emitted:** [More Information Needed]
|
155 |
-
|
156 |
-
## Technical Specifications [optional]
|
157 |
-
|
158 |
-
### Model Architecture and Objective
|
159 |
-
|
160 |
-
[More Information Needed]
|
161 |
-
|
162 |
-
### Compute Infrastructure
|
163 |
-
|
164 |
-
[More Information Needed]
|
165 |
-
|
166 |
-
#### Hardware
|
167 |
-
|
168 |
-
[More Information Needed]
|
169 |
-
|
170 |
-
#### Software
|
171 |
-
|
172 |
-
[More Information Needed]
|
173 |
-
|
174 |
-
## Citation [optional]
|
175 |
-
|
176 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
177 |
-
|
178 |
-
**BibTeX:**
|
179 |
-
|
180 |
-
[More Information Needed]
|
181 |
-
|
182 |
-
**APA:**
|
183 |
-
|
184 |
-
[More Information Needed]
|
185 |
-
|
186 |
-
## Glossary [optional]
|
187 |
|
188 |
-
|
189 |
|
190 |
-
|
|
|
|
|
|
|
|
|
191 |
|
192 |
-
## More Information [optional]
|
193 |
|
194 |
-
|
195 |
|
196 |
-
|
197 |
|
198 |
-
|
|
|
199 |
|
200 |
-
|
201 |
|
202 |
-
|
|
|
|
|
|
|
|
|
|
2 |
library_name: transformers
|
3 |
tags:
|
4 |
- mamba
|
5 |
+
- deepseek
|
6 |
- reasoning
|
7 |
base_model:
|
8 |
- tiiuae/Falcon3-Mamba-7B-Instruct
|
9 |
pipeline_tag: text-generation
|
10 |
---
|
11 |
|
12 |
+
# Model Card: Falcon3-Mamba-R1-v0
|
|
|
|
|
|
|
|
|
13 |
|
14 |
## Model Details
|
15 |
|
16 |
+
**Model Description:**
|
|
|
|
|
17 |
|
18 |
+
This model is a fine-tuned version of Falcon3-Mamba-7B-Instruct, optimized for logical reasoning and structured problem-solving before generating responses.
|
19 |
|
20 |
+
It leverages the Mamba architecture, which scales linearly with an increased number of tokens, making it an efficient and fast reasoning model while maintaining high response quality.
|
21 |
|
22 |
+
This fine-tuned version comes from an earlier checkpoint of the fine tuning pipeline.
|
|
|
23 |
|
24 |
+
* **Developed by:** Hanzla Javaid
|
25 |
+
* **Base Model:** tiiuae/Falcon3-Mamba-7B-Instruct
|
26 |
+
* **Model Type:** Mamba-based causal decoder
|
27 |
+
* **Model Release Date:** March 2025
|
28 |
|
29 |
+
## Intended Uses
|
30 |
|
31 |
+
**Direct Use:**
|
|
|
|
|
32 |
|
33 |
+
This model is designed for:
|
34 |
|
35 |
+
* Reasoning-heavy tasks (math, logic, and structured problem-solving)
|
36 |
+
* STEM-based question-answering
|
37 |
+
* General-purpose text generation
|
38 |
|
39 |
+
**Downstream Use:**
|
40 |
|
41 |
+
* Fine-tuning for domain-specific applications such as finance, law, medicine, and research.
|
42 |
+
* Integration into chatbots and virtual assistants that require advanced reasoning skills.
|
43 |
+
* Enhancement of automated coding assistants with structured logic building.
|
44 |
|
45 |
+
**Out-of-Scope Use:**
|
46 |
|
47 |
+
* Misinformation or deceptive applications
|
48 |
+
* Automated decision-making in high-risk fields (e.g., medical diagnosis without human oversight)
|
49 |
+
* Bias-sensitive applications where fairness is critical but not explicitly controlled
|
50 |
|
51 |
+
## Bias and Limitations
|
52 |
|
53 |
+
**Known Biases:**
|
54 |
|
55 |
+
* The model prioritizes English language data, so performance on multilingual tasks may be weaker.
|
56 |
+
* Fine-tuning may introduce or amplify biases present in the training data, especially in areas like ethics, politics, and cultural perspectives.
|
57 |
|
58 |
+
**Technical Limitations:**
|
59 |
|
60 |
+
* Performance may degrade on long-form generation beyond 64K tokens.
|
61 |
|
|
|
62 |
|
63 |
+
**Recommendations:**
|
64 |
|
65 |
+
* Users should verify outputs for accuracy, especially in critical applications.
|
66 |
+
* Regular bias evaluation should be conducted when deploying in production environments.
|
67 |
|
68 |
+
## Getting Started
|
69 |
|
70 |
+
To use this model, you can load it with transformers:
|
71 |
|
72 |
+
```python
|
73 |
+
repo_name = "hanzla/Falcon3-Mamba-R1-v0"
|
74 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
75 |
+
import torch
|
76 |
|
77 |
+
tokenizer = AutoTokenizer.from_pretrained(repo_name)
|
78 |
|
79 |
+
model = AutoModelForCausalLM.from_pretrained(
|
80 |
+
repo_name,
|
81 |
+
device_map="auto",
|
82 |
+
torch_dtype=torch.float16,
|
83 |
+
)
|
84 |
|
85 |
+
def generate_text(prompt,generation_model,generation_tokenizer,max_tokens=1024):
|
86 |
+
messages = [
|
87 |
+
{"role": "system", "content": "You are a helpful assistant"},
|
88 |
+
{"role": "user", "content": prompt},
|
89 |
+
]
|
90 |
+
input_text = generation_tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
91 |
+
print(input_text)
|
92 |
+
input_ids = generation_tokenizer(input_text, return_tensors="pt").input_ids.to("auto")
|
93 |
+
outputs = generation_model.generate(input_ids, max_new_tokens=max_tokens)
|
94 |
+
generated_tokens = outputs[0][len(input_ids[0]):]
|
95 |
+
return tokenizer.decode(generated_tokens, skip_special_tokens=True)
|
96 |
+
|
97 |
+
```
|
98 |
|
99 |
## Training Details
|
100 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
|
102 |
+
**Training Procedure:**
|
103 |
|
104 |
+
* **Pretrained Base Model:** Falcon3-Mamba-7B-Instruct
|
105 |
+
* **Fine-tuning Data:** A subset of STEM problems from open-thoughts/OpenThoughts-114k
|
106 |
+
* **Training Strategy:** GRPO
|
107 |
+
* **Training Hyperparameters:**
|
108 |
+
* **Batch Size:** 4
|
109 |
+
* **Epochs:** 3
|
110 |
+
* **Precision:** Mixed (fp16 / bf16)
|
111 |
+
* **Hardware:** 2xH100 GPUs
|
112 |
|
113 |
## Evaluation
|
114 |
|
115 |
+
**Testing Data and Metrics:**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
|
117 |
+
The fine-tuned model's performance was evaluated on a variety of benchmarks to assess its reasoning abilities and overall capabilities. The table below presents a comparison between the fine-tuned model and the base model:
|
118 |
|
119 |
+
| Category | Benchmark | Falcon3-Mamba-R1-v0 | Base Falcon3-Mamba-7B-Instruct |
|
120 |
+
|---------------|--------------------------------|----------------------------------------|---------------------------------|
|
121 |
+
| General | MMLU (5-shot) | 72.1 | 65.3 |
|
122 |
+
| Math | GSM8K (5-shot) | 89.5 | 65.2 |
|
123 |
+
| Reasoning | Arc Challenge (25-shot) | 75.8 | 53.7 |
|
124 |
|
|
|
125 |
|
126 |
+
## Technical Specifications
|
127 |
|
128 |
+
**Model Architecture:**
|
129 |
|
130 |
+
* **Mamba Blocks:** 64
|
131 |
+
* **Hidden Size:** 4096
|
132 |
|
133 |
+
**Software Requirements:**
|
134 |
|
135 |
+
* `transformers >= 4.38`
|
136 |
+
* `torch >= 2.1`
|
137 |
+
* `accelerate >= 0.25`
|
138 |
+
* `mamba-ssm`
|
139 |
+
* `causal-conv1d>=1.4.0`
|