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| 1 |
+
# Matrix 2
|
| 2 |
+
|
| 3 |
+
## Model Description
|
| 4 |
+
|
| 5 |
+
**Matrix 2** is a fine-tuned version of [DeepSeek-R1-Distill-Qwen-7B](https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-7B), trained on a focused mixture of chain-of-thought reasoning, math, coding, and logic data. It is the flagship reasoning model of the Inelly lineup -- built for deep, accurate, step-by-step problem solving.
|
| 6 |
+
|
| 7 |
+
- **Developed by:** Bry (GenueAI)
|
| 8 |
+
- **Base model:** DeepSeek-R1-Distill-Qwen-7B
|
| 9 |
+
- **Fine-tuning method:** QLoRA (4-bit NF4, rank 16)
|
| 10 |
+
- **Parameters:** 7.62B (base) + ~6.5M trainable (LoRA adapters)
|
| 11 |
+
- **License:** MIT (inherited from DeepSeek-R1)
|
| 12 |
+
|
| 13 |
---
|
| 14 |
+
|
| 15 |
+
## Intended Use
|
| 16 |
+
|
| 17 |
+
Matrix 2 is intended for:
|
| 18 |
+
|
| 19 |
+
- **Deep Chain-of-Thought reasoning** – Multi-step problem solving with clear logic
|
| 20 |
+
- **Mathematics** – Algebra, arithmetic, word problems, multi-step calculations
|
| 21 |
+
- **Code generation** – Python functions with proper logic and comments
|
| 22 |
+
- **Logical deduction** – Syllogisms, puzzles, transitive reasoning
|
| 23 |
+
- **Scientific explanations** – Physics, biology, general science
|
| 24 |
+
- **Complex instruction following** – Multi-part tasks requiring structured thinking
|
| 25 |
+
|
| 26 |
+
### Out of Scope
|
| 27 |
+
|
| 28 |
+
- Not intended for production deployment without further safety evaluation
|
| 29 |
+
- Safety alignment inherited from DeepSeek-R1 base; fine-tuning data did not include adversarial safety examples
|
| 30 |
+
- Larger memory footprint than 1.5B/3B variants (~5.2GB)
|
| 31 |
+
|
| 32 |
---
|
| 33 |
+
|
| 34 |
+
## Training Data
|
| 35 |
+
|
| 36 |
+
Matrix 2 was fine-tuned for 1 epoch on ~5,225 samples drawn from:
|
| 37 |
+
|
| 38 |
+
| Dataset | Samples | Purpose |
|
| 39 |
+
|---|---|---|
|
| 40 |
+
| [Bespoke-Stratos-35k](https://huggingface.co/datasets/bespokelabs/Bespoke-Stratos-35k) | 3,000 | Chain-of-thought math & reasoning |
|
| 41 |
+
| [OpenThoughts-114k](https://huggingface.co/datasets/open-thoughts/OpenThoughts-114k) | 2,500 | Code generation with reasoning |
|
| 42 |
+
| [dolphin-r1](https://huggingface.co/datasets/cognitivecomputations/dolphin-r1) | 2,000 | General reasoning (DeepSeek-R1 distill) |
|
| 43 |
+
|
| 44 |
+
All samples were deduplicated and reasoning-weighted (2x oversample for CoT examples). Maximum sequence length: 512 tokens.
|
| 45 |
+
|
| 46 |
+
---
|
| 47 |
+
|
| 48 |
+
## Training Hyperparameters
|
| 49 |
+
|
| 50 |
+
| Parameter | Value |
|
| 51 |
+
|---|---|
|
| 52 |
+
| Base model | DeepSeek-R1-Distill-Qwen-7B |
|
| 53 |
+
| Quantization | 4-bit NF4 (bitsandbytes) |
|
| 54 |
+
| LoRA rank | 16 |
|
| 55 |
+
| LoRA alpha | 32 |
|
| 56 |
+
| LoRA dropout | 0.05 |
|
| 57 |
+
| Learning rate | 2e-4 |
|
| 58 |
+
| Batch size | 8 (gradient accumulation) |
|
| 59 |
+
| Epochs | 1 |
|
| 60 |
+
| Max seq length | 512 |
|
| 61 |
+
| Optimizer | AdamW 8-bit |
|
| 62 |
+
| LR scheduler | cosine |
|
| 63 |
+
| Warmup ratio | 0.05 |
|
| 64 |
+
| Training time | ~74 min |
|
| 65 |
+
| Hardware | RTX 3090 (24GB VRAM) |
|
| 66 |
+
|
| 67 |
+
---
|
| 68 |
+
|
| 69 |
+
## Model Architecture
|
| 70 |
+
|
| 71 |
+
| Property | Value |
|
| 72 |
+
|---|---|
|
| 73 |
+
| Model type | Qwen2ForCausalLM |
|
| 74 |
+
| Hidden size | 3,584 |
|
| 75 |
+
| Layers | 28 |
|
| 76 |
+
| Attention heads | 28 |
|
| 77 |
+
| Head dim | 128 |
|
| 78 |
+
| Intermediate size | 18,944 |
|
| 79 |
+
| Vocab size | 152,064 |
|
| 80 |
+
| Context length | 131,072 |
|
| 81 |
+
| Total parameters | ~7.62B |
|
| 82 |
+
| Trainable parameters | ~6.5M (LoRA) |
|
| 83 |
+
|
| 84 |
+
---
|
| 85 |
+
|
| 86 |
+
## Usage
|
| 87 |
+
|
| 88 |
+
```python
|
| 89 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 90 |
+
|
| 91 |
+
model = AutoModelForCausalLM.from_pretrained("path/to/matrix-2", torch_dtype=torch.float16, device_map="auto")
|
| 92 |
+
tokenizer = AutoTokenizer.from_pretrained("path/to/matrix-2")
|
| 93 |
+
|
| 94 |
+
messages = [{"role": "user", "content": "Solve for x: 3x + 7 = 22. Show all steps."}]
|
| 95 |
+
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 96 |
+
inputs = tokenizer(text, return_tensors="pt").to(model.device)
|
| 97 |
+
|
| 98 |
+
output = model.generate(**inputs, max_new_tokens=256, temperature=0.7, top_p=0.9)
|
| 99 |
+
response = tokenizer.decode(output[0][inputs.input_ids.shape[1]:], skip_special_tokens=True)
|
| 100 |
+
print(response)
|
| 101 |
+
```
|
| 102 |
+
|
| 103 |
+
---
|
| 104 |
+
|
| 105 |
+
## Performance
|
| 106 |
+
|
| 107 |
+
Informal GPU testing across 8 categories:
|
| 108 |
+
|
| 109 |
+
| Category | Result |
|
| 110 |
+
|---|---|
|
| 111 |
+
| Chain-of-Thought reasoning | ✅ Excellent multi-step logic |
|
| 112 |
+
| Math | ✅ Accurate with detailed work shown |
|
| 113 |
+
| Code generation | ✅ Clean, well-commented Python |
|
| 114 |
+
| Logic puzzles | ✅ Thorough deductive reasoning |
|
| 115 |
+
| General knowledge | ✅ Accurate, detailed explanations |
|
| 116 |
+
| Complex reasoning | ✅ Handles multi-step word problems well |
|
| 117 |
+
|
| 118 |
+
---
|
| 119 |
+
|
| 120 |
+
## Inelly / GenueAI Model Family
|
| 121 |
+
|
| 122 |
+
| Model | Size | Focus |
|
| 123 |
+
|---|---|---|
|
| 124 |
+
| **Matrix 2** (this model) | 7B | Deep CoT reasoning, math, coding |
|
| 125 |
+
| Inelly 4.5 | 3B | Conversation + politeness + CoT |
|
| 126 |
+
| Inelly 4.5 Blaze | 1.5B | Fast reasoning + CoT |
|
| 127 |
+
|
| 128 |
+
---
|
| 129 |
+
|
| 130 |
+
## Limitations
|
| 131 |
+
|
| 132 |
+
- **Safety:** Inherited from DeepSeek-R1 base; not specifically safety-tuned. May occasionally follow harmful instructions.
|
| 133 |
+
- **Memory:** Requires ~5.2GB VRAM for inference (FP16)
|
| 134 |
+
- **Context length:** Fine-tuned on 512-token sequences; base supports 128K but fine-tuned performance is optimized for shorter contexts
|
| 135 |
+
- **Factual accuracy:** May hallucinate in specialized domains (law, medicine, finance)
|
| 136 |
+
- **Speed:** Slower than 1.5B/3B variants due to size
|
| 137 |
+
|
| 138 |
+
---
|
| 139 |
+
|
| 140 |
+
## Acknowledgments
|
| 141 |
+
|
| 142 |
+
- [DeepSeek-R1](https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-7B) by DeepSeek AI (base model)
|
| 143 |
+
- [Bespoke Labs](https://huggingface.co/bespokelabs) for Stratos dataset
|
| 144 |
+
- [OpenThoughts](https://huggingface.co/datasets/open-thoughts/OpenThoughts-114k) team
|
| 145 |
+
- [Cognitive Computations](https://huggingface.co/cognitivecomputations) for dolphin-r1
|
| 146 |
+
|
| 147 |
+
---
|
| 148 |
+
|
| 149 |
+
## Citation
|
| 150 |
+
|
| 151 |
+
```
|
| 152 |
+
@misc{matrix2,
|
| 153 |
+
title = {Matrix 2: A 7B Chain-of-Thought Reasoning Model},
|
| 154 |
+
author = {Bry},
|
| 155 |
+
organization = {GenueAI},
|
| 156 |
+
year = {2026},
|
| 157 |
+
note = {Fine-tuned from DeepSeek-R1-Distill-Qwen-7B using QLoRA},
|
| 158 |
+
}
|
| 159 |
+
```
|