Text Generation
Transformers
Safetensors
qwen3_5_text
qwen
qwen3.5
reasoning
distillation
claude-opus
darwin-v8
sft
lora
merged
conversational
Instructions to use FINAL-Bench/lastbrain with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FINAL-Bench/lastbrain with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="FINAL-Bench/lastbrain") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("FINAL-Bench/lastbrain") model = AutoModelForCausalLM.from_pretrained("FINAL-Bench/lastbrain") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use FINAL-Bench/lastbrain with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "FINAL-Bench/lastbrain" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FINAL-Bench/lastbrain", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/FINAL-Bench/lastbrain
- SGLang
How to use FINAL-Bench/lastbrain with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "FINAL-Bench/lastbrain" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FINAL-Bench/lastbrain", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "FINAL-Bench/lastbrain" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FINAL-Bench/lastbrain", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use FINAL-Bench/lastbrain with Docker Model Runner:
docker model run hf.co/FINAL-Bench/lastbrain
Add README: Darwin V8 lastbrain (Qwen3.5-2B father + Opus-Distill LoRA mother merged)
Browse files
README.md
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: Qwen/Qwen3.5-2B
|
| 4 |
+
tags:
|
| 5 |
+
- qwen
|
| 6 |
+
- qwen3.5
|
| 7 |
+
- reasoning
|
| 8 |
+
- distillation
|
| 9 |
+
- claude-opus
|
| 10 |
+
- darwin-v8
|
| 11 |
+
- sft
|
| 12 |
+
- lora
|
| 13 |
+
- merged
|
| 14 |
+
language:
|
| 15 |
+
- en
|
| 16 |
+
- ko
|
| 17 |
+
- zh
|
| 18 |
+
- ja
|
| 19 |
+
pipeline_tag: text-generation
|
| 20 |
+
library_name: transformers
|
| 21 |
+
---
|
| 22 |
+
|
| 23 |
+
# ๐ง lastbrain โ Darwin V8
|
| 24 |
+
|
| 25 |
+
**Darwin V8 ๊ธฐ๋ฐ Claude Opus ์ฆ๋ฅ ๋ชจ๋ธ (2B ํ๋ผ๋ฏธํฐ)**
|
| 26 |
+
|
| 27 |
+
- ๐จ **Father (Base)**: [`Qwen/Qwen3.5-2B`](https://huggingface.co/Qwen/Qwen3.5-2B)
|
| 28 |
+
- ๐ฉ **Mother (LoRA Adapter)**: [`FINAL-Bench/Qwen3.5-2B-Opus-Distill-v1`](https://huggingface.co/FINAL-Bench/Qwen3.5-2B-Opus-Distill-v1)
|
| 29 |
+
- ๐ถ **Child (This model)**: `FINAL-Bench/lastbrain` โ merged full-weight standalone
|
| 30 |
+
|
| 31 |
+
---
|
| 32 |
+
|
| 33 |
+
## ๐ฆ ํน์ง
|
| 34 |
+
|
| 35 |
+
- **Base**: Qwen3.5-2B (2.3B ํ๋ผ๋ฏธํฐ, ํ์ด๋ธ๋ฆฌ๋ ์ดํ
์
)
|
| 36 |
+
- **Training**: SFT + LoRA (`all-linear`, rank=16, ฮฑ=32)
|
| 37 |
+
- **Teachers**: Claude Opus 4.5 / 4.6, Claude Sonnet 4.6 (pre-generated reasoning traces)
|
| 38 |
+
- **Data**: 4,451 ๊ณ ํ์ง ์ถ๋ก ๊ถค์ (4๊ฐ ๊ณต๊ฐ ๋ฐ์ดํฐ์
)
|
| 39 |
+
- **Merged**: LoRA ์ด๋ํฐ๊ฐ base ๊ฐ์ค์น์ ์์ ํตํฉ๋์ด **๋
๋ฆฝ ์คํ ๊ฐ๋ฅ**
|
| 40 |
+
|
| 41 |
+
---
|
| 42 |
+
|
| 43 |
+
## ๐ ๋น ๋ฅธ ์ฌ์ฉ๋ฒ
|
| 44 |
+
|
| 45 |
+
```python
|
| 46 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 47 |
+
import torch
|
| 48 |
+
|
| 49 |
+
model_id = "FINAL-Bench/lastbrain"
|
| 50 |
+
tok = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
|
| 51 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 52 |
+
model_id, torch_dtype=torch.bfloat16, device_map="auto", trust_remote_code=True
|
| 53 |
+
)
|
| 54 |
+
|
| 55 |
+
messages = [
|
| 56 |
+
{"role": "user", "content": "If a train travels 60 km in 45 minutes, what is its speed in km/h?"}
|
| 57 |
+
]
|
| 58 |
+
prompt = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 59 |
+
inputs = tok(prompt, return_tensors="pt").to(model.device)
|
| 60 |
+
|
| 61 |
+
with torch.no_grad():
|
| 62 |
+
outputs = model.generate(
|
| 63 |
+
**inputs,
|
| 64 |
+
max_new_tokens=800,
|
| 65 |
+
do_sample=False,
|
| 66 |
+
pad_token_id=tok.eos_token_id,
|
| 67 |
+
)
|
| 68 |
+
print(tok.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))
|
| 69 |
+
```
|
| 70 |
+
|
| 71 |
+
**์์ ์ถ๋ ฅ**:
|
| 72 |
+
```
|
| 73 |
+
To find the speed of the train in km/h, we need to convert the given time from minutes to hours.
|
| 74 |
+
|
| 75 |
+
**Given:**
|
| 76 |
+
- Distance = 60 km
|
| 77 |
+
- Time = 45 minutes
|
| 78 |
+
|
| 79 |
+
**Step 1: Convert time to hours**
|
| 80 |
+
Since there are 60 minutes in 1 hour:
|
| 81 |
+
$$\text{Time in hours} = \frac{45}{60} = 0.75 \text{ hours}$$
|
| 82 |
+
|
| 83 |
+
**Step 2: Calculate speed**
|
| 84 |
+
$$\text{Speed} = \frac{60}{0.75} = 80 \text{ km/h}$$
|
| 85 |
+
|
| 86 |
+
**Final Answer:** The speed of the train is **80 km/h**.
|
| 87 |
+
```
|
| 88 |
+
|
| 89 |
+
---
|
| 90 |
+
|
| 91 |
+
## ๐งฌ Darwin V8 ํ์ต ํ์ดํ๋ผ์ธ
|
| 92 |
+
|
| 93 |
+
```
|
| 94 |
+
[Qwen/Qwen3.5-2B] โโโโ Base ๋ชจ๋ธ (๋๊ฒฐ)
|
| 95 |
+
+
|
| 96 |
+
[4,451 Claude Opus/Sonnet reasoning traces]
|
| 97 |
+
โ
|
| 98 |
+
[SFT Training]
|
| 99 |
+
- LoRA (all-linear, r=16, ฮฑ=32)
|
| 100 |
+
- Learning rate: 2e-4 (V8 rule: ร10 FullFT)
|
| 101 |
+
- 2 epochs, bf16, 8รB200 DDP
|
| 102 |
+
- Loss: 1.33 โ 1.10 (-17%)
|
| 103 |
+
- Token accuracy: 68% โ 72% (+4%p)
|
| 104 |
+
โ
|
| 105 |
+
[LoRA merge into base weights]
|
| 106 |
+
โ
|
| 107 |
+
[lastbrain] โ ์ด ๋ชจ๋ธ
|
| 108 |
+
```
|
| 109 |
+
|
| 110 |
+
---
|
| 111 |
+
|
| 112 |
+
## ๐ ํ์ต ๋ฐ์ดํฐ ๊ตฌ์ฑ
|
| 113 |
+
|
| 114 |
+
| ๋ฐ์ดํฐ์
| ์ํ ์ | ์ถ์ฒ Teacher |
|
| 115 |
+
|---------|--------|------|
|
| 116 |
+
| [nohurry/Opus-4.6-Reasoning-3000x-filtered](https://huggingface.co/datasets/nohurry/Opus-4.6-Reasoning-3000x-filtered) | 2,326 | Claude Opus 4.6 |
|
| 117 |
+
| [TeichAI/Claude-Opus-4.6-Reasoning-887x](https://huggingface.co/datasets/TeichAI/Claude-Opus-4.6-Reasoning-887x) | 887 | Claude Opus 4.6 |
|
| 118 |
+
| [TeichAI/claude-4.5-opus-high-reasoning-250x](https://huggingface.co/datasets/TeichAI/claude-4.5-opus-high-reasoning-250x) | 250 | Claude Opus 4.5 |
|
| 119 |
+
| [TeichAI/Claude-Sonnet-4.6-Reasoning-1100x](https://huggingface.co/datasets/TeichAI/Claude-Sonnet-4.6-Reasoning-1100x) | 1,100 | Claude Sonnet 4.6 |
|
| 120 |
+
| **ํฉ๊ณ (ํํฐ ํ)** | **4,451** | - |
|
| 121 |
+
|
| 122 |
+
---
|
| 123 |
+
|
| 124 |
+
## ๐ฏ ์ค๊ณ ์ฒ ํ (Darwin V8)
|
| 125 |
+
|
| 126 |
+
1. **LoRA Without Regret** โ `all-linear` target, high LR, ์์ rank๋ OK
|
| 127 |
+
2. **Response Distillation** โ pre-generated Opus traces๋ก ๋น์ฉ ํจ์จ์ ์ฆ๋ฅ
|
| 128 |
+
3. **Merge-and-Deploy** โ LoRA ์ด๋ํฐ ํตํฉ ํ ์ถ๊ฐ ์์กด์ฑ ์์ด ๋ฐฐํฌ
|
| 129 |
+
|
| 130 |
+
---
|
| 131 |
+
|
| 132 |
+
## ๐ ์ฌํ ๋ฐฉ๋ฒ
|
| 133 |
+
|
| 134 |
+
์ด ๋ชจ๋ธ์ ๋ค์ ๋ ์ปดํฌ๋ํธ๋ฅผ mergeํ์ฌ ๋ง๋ค์ด์ก์ต๋๋ค:
|
| 135 |
+
|
| 136 |
+
```python
|
| 137 |
+
from transformers import AutoModelForCausalLM
|
| 138 |
+
from peft import PeftModel
|
| 139 |
+
import torch
|
| 140 |
+
|
| 141 |
+
base = AutoModelForCausalLM.from_pretrained(
|
| 142 |
+
"Qwen/Qwen3.5-2B", torch_dtype=torch.bfloat16
|
| 143 |
+
)
|
| 144 |
+
model = PeftModel.from_pretrained(
|
| 145 |
+
base, "FINAL-Bench/Qwen3.5-2B-Opus-Distill-v1"
|
| 146 |
+
)
|
| 147 |
+
merged = model.merge_and_unload()
|
| 148 |
+
merged.save_pretrained("./lastbrain")
|
| 149 |
+
```
|
| 150 |
+
|
| 151 |
+
---
|
| 152 |
+
|
| 153 |
+
## ๐ ์ํ ํ
์คํธ ๊ฒฐ๊ณผ (4๋ฌธ์ )
|
| 154 |
+
|
| 155 |
+
| ์ ํ | ์ ๋ต ์ฌ๋ถ | ์๋ต ๊ธธ์ด |
|
| 156 |
+
|-----|---------|---------|
|
| 157 |
+
| Math (๊ธฐ์ฐจ ์๋) | โ
80 km/h | 771์ |
|
| 158 |
+
| Logic (ํค ๋น๊ต) | โ
Carol | 354์ |
|
| 159 |
+
| Code (์์ ํ๋ณ) | โ
Python ํจ์ | 1,712์ |
|
| 160 |
+
| Korean (์ต์ ์๊ธ) | โ
1,577,600์ | 142์ |
|
| 161 |
+
|
| 162 |
+
**Markdown/LaTeX/Step-by-Step ๊ตฌ์กฐํ๋ ๋ต๋ณ ์์ฐ์ค๋ฝ๊ฒ ์์ฑ**
|
| 163 |
+
|
| 164 |
+
---
|
| 165 |
+
|
| 166 |
+
## โ ๏ธ ์ ํ ์ฌํญ
|
| 167 |
+
|
| 168 |
+
- **๊ท๋ชจ**: 2.3B ํ๋ผ๋ฏธํฐ (์ํ ๋ชจ๋ธ)
|
| 169 |
+
- **ํ๊ตญ์ด ๊ณ์ฐ ์ ํ์ฑ**: ๋๋ก ์ซ์ ์ค๋ฅ ๋ฐ์ ๊ฐ๋ฅ (์ํ ๋ชจ๋ธ ํ๊ณ)
|
| 170 |
+
- **๊ธด ์ปจํ
์ค๏ฟฝ๏ฟฝ๏ฟฝ**: ํ์ต ์ max_length=4,096์ผ๋ก ํ์ต๋จ
|
| 171 |
+
- **`<think>` ํ๊ทธ**: ๋ช
์์ ์ฌ์ฉ ๋ฎ์ (reasoning์ ๋ณธ๋ฌธ์ ํตํฉ)
|
| 172 |
+
|
| 173 |
+
---
|
| 174 |
+
|
| 175 |
+
## ๐ชช ๋ผ์ด์ ์ค
|
| 176 |
+
|
| 177 |
+
- Base model: Apache 2.0 (Qwen)
|
| 178 |
+
- ํ์ต ๋ฐ์ดํฐ: ๊ฐ ๋ฐ์ดํฐ์
๊ฐ๋ณ ๋ผ์ด์ ์ค ์ฐธ์กฐ
|
| 179 |
+
- ์ด ๋ชจ๋ธ: Apache 2.0
|
| 180 |
+
|
| 181 |
+
---
|
| 182 |
+
|
| 183 |
+
## ๐ ํฌ๋ ๋ง
|
| 184 |
+
|
| 185 |
+
- **Base**: Qwen team (Alibaba)
|
| 186 |
+
- **Teacher**: Anthropic (Claude Opus 4.5/4.6, Sonnet 4.6)
|
| 187 |
+
- **๋ฐ์ดํฐ ๊ณต๊ฐ**: nohurry, TeichAI
|
| 188 |
+
- **Training & Release**: FINAL-Bench / VIDRAFT_LAB
|
| 189 |
+
|
| 190 |
+
---
|
| 191 |
+
|
| 192 |
+
## ๐ ๊ด๋ จ ๋ชจ๋ธ
|
| 193 |
+
|
| 194 |
+
- ๐ง [`FINAL-Bench/Qwen3.5-2B-Opus-Distill-v1`](https://huggingface.co/FINAL-Bench/Qwen3.5-2B-Opus-Distill-v1) โ ์ด ๋ชจ๋ธ์ **LoRA ์ด๋ํฐ ๋จ๋
๋ฒ์ **
|
| 195 |
+
- โก [`FINAL-Bench/Qwen3.5-2B-Opus-SDPO-v1`](https://huggingface.co/FINAL-Bench/Qwen3.5-2B-Opus-SDPO-v1) โ Phase 4 SDPO ์๊ธฐ์ฆ๋ฅ ๊ฐํ๋ณธ
|
| 196 |
+
|
| 197 |
+
---
|
| 198 |
+
|
| 199 |
+
*Darwin V8 ยท Part of the evolutionary model merging series by VIDRAFT_LAB*
|