Text Generation
Transformers
Safetensors
English
Chinese
qwen3_5
image-text-to-text
qwen
lora
reinforcement-learning
fp8
agentic-coding
scientific-computing
physics
materials-science
genetics
conversational
Instructions to use HoomanBio2021/LabOpen-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HoomanBio2021/LabOpen-v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="HoomanBio2021/LabOpen-v1") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("HoomanBio2021/LabOpen-v1") model = AutoModelForMultimodalLM.from_pretrained("HoomanBio2021/LabOpen-v1", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use HoomanBio2021/LabOpen-v1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "HoomanBio2021/LabOpen-v1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HoomanBio2021/LabOpen-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/HoomanBio2021/LabOpen-v1
- SGLang
How to use HoomanBio2021/LabOpen-v1 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 "HoomanBio2021/LabOpen-v1" \ --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": "HoomanBio2021/LabOpen-v1", "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 "HoomanBio2021/LabOpen-v1" \ --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": "HoomanBio2021/LabOpen-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use HoomanBio2021/LabOpen-v1 with Docker Model Runner:
docker model run hf.co/HoomanBio2021/LabOpen-v1
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,76 +1,369 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
-
从原`/Users/luoshumac/Documents/常规工具`保留Git历史迁入;后续开发以本目录为准,原目录仅保留兼容/历史备份。详见[迁移记录](PROJECT_MIGRATION_2026_9_12.md)。
|
| 5 |
|
| 6 |
-
|
| 7 |
|
| 8 |
-
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
-
|
| 13 |
|
| 14 |
-
|
| 15 |
|
| 16 |
-
|
| 17 |
|
| 18 |
-
|
| 19 |
-
- 主要强化起点:原OrcaRouter FP8;官方 `Qwen/Qwen3.8-27B` BF16是高精度参照,固定 revision `1d4bf0f2ff6012fd82039f2fa52739d0dd7c60c0`。两份原始快照保持不变。
|
| 20 |
-
- 训练方式:原生 Python/torch/Transformers/PEFT/TRL,不使用 Docker。
|
| 21 |
-
- 当前权限:L0/L1 可用;L2 仅限项目内纯模拟/只读工具;未开放真实高权限写操作。
|
| 22 |
|
| 23 |
-
|
| 24 |
|
| 25 |
-
- `gb10_qwen38/`:部署、验证、训练、评测脚本,小型测试资产和结果。
|
| 26 |
-
- `labopen_stack/`:有限学习实验库;使用方式与实际支持范围见其README。
|
| 27 |
-
- `LABOPEN_TRAINING_STACK_GOVERNANCE.md`:训练栈组件、组合、状态与变更管理的独立入口。
|
| 28 |
-
- `AGENTS.md` / `LABOPEN_DOCUMENTATION_MAP.md`:常驻核心蓝图与详细文档索引。
|
| 29 |
-
- `GB10_QWEN38_LABOPEN_TRAINING_MEMO.md`:训练决策与长期工作备忘。
|
| 30 |
-
- `GB10_QWEN38_LAB_NOTEBOOK.md`:实验总账。
|
| 31 |
-
- `IMPLEMENTATION_PLAN_2026_9_9_LABOPEN_GENERALIZATION.md`:早期新阶段总方案,当前执行计划以阶段入口指定为准。
|
| 32 |
-
- `gb10_qwen38/stages/generalization_20260909/`:新阶段代码、历史回查卡和独立结果。
|
| 33 |
-
- 旧 `IMPLEMENTATION_PLAN_*`:历史协议,除新入口显式引用的有效部分外不再接续。
|
| 34 |
|
| 35 |
-
##
|
| 36 |
|
| 37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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wen3.8-27B-LabOpen v1
|
|
|
|
| 15 |
|
| 16 |
+
Qwen3.8-27B strengthened for verifiable scientific computation — released both as **merged FP8 full weights** (drop-in for the base) and as the original **LoRA adapter**.
|
| 17 |
|
| 18 |
+
LabOpen v1 adds six verifiable capability domains (fluid physics, materials mixture laws, classical genetics, ops action queries, prose style, agentic coding) on top of [Qwen/Qwen3.8-27B-FP8](https://huggingface.co/Qwen/Qwen3.8-27B-FP8), while preserving the base model's native code generation, function calling, intent understanding and formula rendering. The largest measured gain: **agentic coding 32% → 72% (+40pp)** on a 78-test deterministic battery.
|
| 19 |
|
| 20 |
+
- **Base model**: Qwen3.8-27B (FP8 release, Apache 2.0)
|
| 21 |
+
- **Training**: 15 reinforcement windows (G69–G84), LoRA r=4, group-relative RL (RLOO-style, k=8 sampling) with mechanically verifiable rewards
|
| 22 |
+
- **License**: Apache 2.0 (same as base)
|
| 23 |
+
- **Hardware target**: any FP8-capable GPU (H100 / GB10 / B200 class); ~28 GB in FP8
|
| 24 |
|
| 25 |
+
## Positioning & Philosophy
|
| 26 |
|
| 27 |
+
Qwen3.8-27B-LabOpen v1 is a research model built on the open Qwen3.8-27B foundation through domain fine-tuning and optimization, focused on scientific research fields including programming, physics, life sciences, and materials science.
|
| 28 |
|
| 29 |
+
The project does not aim to replace general-purpose large language models. It seeks to preserve the comprehensive strengths of a general model while further strengthening its adaptation to scientific knowledge, domain-specific problems, and research workloads.
|
| 30 |
|
| 31 |
+
The model is intended for universities, research institutes, corporate R&D centers, and professional laboratories, and supports local or private deployment scaled to the institution's actual computing resources.
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
+
We believe that AI for scientific research should not depend solely on remote general-purpose model services. Research institutions deserve the opportunity to deploy, operate, and continuously refine specialized models on their own computing infrastructure — forming AI capability that fits their own research missions, data-governance requirements, and domain expertise.
|
| 34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
+
## What's in this repo
|
| 37 |
|
| 38 |
+
| Path | Content |
|
| 39 |
+
|---|---|
|
| 40 |
+
| `model-0000X-of-00007.safetensors` + index | **Merged FP8 full weights** (base + LoRA, blockwise-FP8 re-quantized). Same tensor layout and quantization format as the base — drop-in replacement |
|
| 41 |
+
| `adapter/` | **LoRA adapter** (112 MB, PEFT format, 992 tensors). Numerically exact training artifact — no re-quantization |
|
| 42 |
+
| `MERGE_REPORT.md` | Merge provenance: digests, shard SHA-256, re-quantization error stats, output-equivalence probes |
|
| 43 |
+
| `EVALUATION.md` | Measured capability matrix and 5-model external comparison |
|
| 44 |
+
| `USAGE.md` | Loading, domain tags, temperature guidance, troubleshooting |
|
| 45 |
+
|
| 46 |
+
Use the **merged weights** for serving (vLLM/SGLang). Use the **adapter** on top of the base when you want the exact training-time numerics or a smaller download.
|
| 47 |
+
|
| 48 |
+
## Capability matrix (measured, heldout sets)
|
| 49 |
+
|
| 50 |
+
| Domain | Metric | Score | vs Base |
|
| 51 |
+
|---|---|---|---|
|
| 52 |
+
| **Agentic coding** | 78 deterministic tests, 3-round fix | **72%** (56/78) | **+40pp** (base: 32%) |
|
| 53 |
+
| **Intent understanding** | 10-scene deep-intent probe | **8/10** | preserved |
|
| 54 |
+
| **Formula display** | LaTeX integrity, 5 problems | **5/5** | preserved |
|
| 55 |
+
| Fluid physics (CFM) | Pool-B heldout, T=0.3 k=8, tagged | 44% draws | new (base ≈ 0) |
|
| 56 |
+
| Materials (mixture laws) | heldout 40 items, T=0.3 | 32% draws | new (base ≈ 0) |
|
| 57 |
+
| Classical genetics | heldout 20 items, tagged | 79% draws | new (base: 47% natural) |
|
| 58 |
+
| Ops (action queries) | 8 items, dual-temp | 4–5/8 | new |
|
| 59 |
+
| Prose style | 20 open-ended, T=0.3 k=8 | 75% any-correct | new |
|
| 60 |
+
|
| 61 |
+
### External comparison (same battery, 2026-10)
|
| 62 |
+
|
| 63 |
+
| Model | Intent | Agentic tests | Rank |
|
| 64 |
+
|---|---|---|---|
|
| 65 |
+
| GLM 5.3 | 8/10 | 57/78 (73%) | #1 |
|
| 66 |
+
| **LabOpen v1 (this)** | **8/10** | **56/78 (72%)** | **#2** |
|
| 67 |
+
| Qwen3.8-max | 8/10 | 54/78 (69%) | #3 |
|
| 68 |
+
| DeepSeek v4.1 flash | 6/10 | 48/78 (62%) | #4 |
|
| 69 |
+
| Qwen3.8-27B (base) | 8/10 | 25/78 (32%) | #5 |
|
| 70 |
+
|
| 71 |
+
A 27B + r4 LoRA reaching frontier-model agentic-coding territory in 15 training windows is the headline result; see `EVALUATION.md` for gaps that remain (first-pass rate, general knowledge vs 100B+ models).
|
| 72 |
+
|
| 73 |
+
## Domain-capability comparison with frontier models (zero-shot)
|
| 74 |
+
|
| 75 |
+
The five external-comparison models above were also run on the **domain heldout sets themselves** (the same questions used for our capability matrix, with tags stripped — plain zero-shot prompts, k=8 samples at T=0.3, item any-correct, scored by the same stack scorers with fence-stripped outputs).
|
| 76 |
+
|
| 77 |
+
| Domain (items) | GLM 5.3 | Qwen3.8-max¹ | DeepSeek flash | LabOpen v1² | Base |
|
| 78 |
+
|---|---|---|---|---|---|
|
| 79 |
+
| Fluid physics (36) | 36/36 | 36/36 | 35/36 | 25/36 † | ≈0 |
|
| 80 |
+
| Materials — strict (40) | 1/40 | 0/40 | 0/40 | **17/40** ‡ | ≈0 |
|
| 81 |
+
| Materials — fair 1% (40) | 20/40 | 15/40 | 22/40 | 18/40 ‡ | — |
|
| 82 |
+
| Classical genetics (20) | 9/20 | 12/20 | 7/20 | **20/20** † | 47% |
|
| 83 |
+
| Ops — strict (8) | 0/8 | 0/8 | 0/8 | **4/8** (T0.3) | 0/8 |
|
| 84 |
+
| Ops — null-action-equivalent (8) | 4/8 | 0/8 | 3/8 | 4/8 | — |
|
| 85 |
+
|
| 86 |
+
¹ non-thinking mode, consistent with the agentic battery; GLM 5.3 ran with full thinking; DeepSeek flash with thinking disabled (its API option). † our tagged deployment protocol; ‡ our untagged protocol (directly comparable to external).
|
| 87 |
+
|
| 88 |
+
**Reading the zeros honestly:**
|
| 89 |
+
|
| 90 |
+
- **Ops 0/8 (strict)** has two components. (a) A convention artifact: the reference null action is the domain vocabulary `"observe"`, which the prompt never states — frontier models answering `"none"` understood the rule but failed the private vocabulary (null-action-equivalent rescoring: GLM 4/8, DeepSeek 3/8, Qwen still 0/8). (b) A genuine failure that remains: frontier models substitute their own ops heuristics for the declared rule — e.g. rolling back on `regression=true` when the declared rule (`escalate_on_critical`, severity below critical) requires no action; across 6 null-trigger items they over-act (rollback/restart dominate their outputs). Our advantage is faithful declared-rule binding plus the domain action vocabulary — not that frontier models "cannot do ops".
|
| 91 |
+
- **Materials 0/40 (strict)** is a tolerance artifact: strict scoring (0.01% relative) requires reproducing the corpus property table to 4 significant figures; frontier answers using standard handbook constants (physically correct) fail it. Under a fair 1% tolerance the domain is at parity (38–55% vs our 45%); the strict score measures corpus-table reproduction, our 42% vs their 0–3%.
|
| 92 |
+
- **Fluid physics**: frontier models solve these fully zero-shot — our value here is lifting a local 27B from ≈0 to 69%, not uniqueness.
|
| 93 |
+
|
| 94 |
+
## Usage
|
| 95 |
+
|
| 96 |
+
### Serving the merged weights (recommended)
|
| 97 |
|
| 98 |
```bash
|
| 99 |
+
vllm serve HoomanBio/Qwen3.8-27B-LabOpen-v1
|
| 100 |
+
# or: docker run ... vllm/vllm-openai --model HoomanBio/Qwen3.8-27B-LabOpen-v1
|
| 101 |
+
```
|
| 102 |
+
|
| 103 |
+
The merged checkpoint uses the same blockwise FP8 (e4m3, 128×128 scales) format as the base — any runtime that loads `Qwen/Qwen3.8-27B-FP8` loads this without changes.
|
| 104 |
+
|
| 105 |
+
### Loading the adapter (exact training numerics)
|
| 106 |
+
|
| 107 |
+
```python
|
| 108 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 109 |
+
from peft import PeftModel
|
| 110 |
+
|
| 111 |
+
base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3.8-27B-FP8", device_map="auto")
|
| 112 |
+
model = PeftModel.from_pretrained(base, "HoomanBio/Qwen3.8-27B-LabOpen-v1", subfolder="adapter")
|
| 113 |
+
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen3.8-27B-FP8")
|
| 114 |
+
```
|
| 115 |
+
|
| 116 |
+
> **Do not run `merge_and_unload()` on the FP8 base yourself.** The base stores weights as blockwise-FP8 codes with 128×128 scales; a naive PEFT merge adds a BF16 delta directly onto FP8 codes and silently corrupts the weights. Use the merged checkpoint provided here — it was produced by dequantize → add delta → re-quantize with per-block scale recomputation and verified against the adapter (see `MERGE_REPORT.md`).
|
| 117 |
+
|
| 118 |
+
### Domain tags
|
| 119 |
+
|
| 120 |
+
The strengthened domains are addressed by a one-line tag at the **start of the prompt**:
|
| 121 |
+
|
| 122 |
+
| Tag | Domain |
|
| 123 |
+
|---|---|
|
| 124 |
+
| `[domain: cfm-chain]` | fluid physics chains |
|
| 125 |
+
| `[domain: mat-table]` | materials mixture laws |
|
| 126 |
+
| `[domain: bio-genetics]` | classical genetics |
|
| 127 |
+
| `[domain: ops-action]` | ops action queries |
|
| 128 |
+
| `[domain: general-prose]` | open-ended prose style |
|
| 129 |
+
|
| 130 |
+
Without a tag the model keeps base behavior (code / function calling need no tag).
|
| 131 |
+
|
| 132 |
+
### Temperature
|
| 133 |
+
|
| 134 |
+
| Use case | Temperature |
|
| 135 |
+
|---|---|
|
| 136 |
+
| Domain computation (cfm/mat/bio/ops) | **0.3** (greedy degrades on some domains) |
|
| 137 |
+
| Open-ended prose | **0.3** (prose is in the distribution, not always the mode) |
|
| 138 |
+
| Code generation | 0.0–0.2 |
|
| 139 |
+
| General QA | 0.3–0.7 |
|
| 140 |
+
|
| 141 |
+
## Technical notes
|
| 142 |
+
|
| 143 |
+
- **Architecture**: Qwen3.8-27B hybrid — 64 decoder layers: 48 linear-attention + 16 full-attention layers.
|
| 144 |
+
- **LoRA**: r=4, α=4 (scaling 1.0), dropout 0, on 496 projection modules across 12 module types (q/k/v/o/gate/up/down_proj, in_proj_a/b/qkv/z, out_proj) = 992 tensors, ~112 MB.
|
| 145 |
+
- **Merge math**: per module `W = codes × scale(blockwise)` dequantized to FP32, LoRA delta `(B·A)·scaling` added, re-quantized per 128×128 block (`scale = amax/448`). Mean re-quantization relative error 0.33% — the same order as the base's own FP8 storage noise. Equivalence probes (greedy, 3 prompts × 48 tokens, adapter vs merged): see `MERGE_REPORT.md`.
|
| 146 |
+
- **Training substrate**: a local FP8 copy of Qwen3.8-27B (community redistribution). Bit-equivalence with `Qwen/Qwen3.8-27B-FP8` was not verified; the adapter config points to the official release for loading.
|
| 147 |
+
|
| 148 |
+
## Thinking-behavior governance
|
| 149 |
+
|
| 150 |
+
The base model can exhaust its thinking budget on unfamiliar domain problems, leaving the reasoning segment unclosed — "thinking exhaustion". This was measured, governed, and re-measured rather than assumed away:
|
| 151 |
+
|
| 152 |
+
- **Worst recorded case**: before the materials window (G77), 48% of materials generations truncated with unclosed thinking (155/320 during in-window fuel sampling).
|
| 153 |
+
- **Mechanism**: the reward contract scores termination mechanically — truncation, format errors, and runtime errors are separate reward categories — and oracle injection teaches termination explicitly. Within that single window, truncation fell from 155/320 to 0/320 and per-item generation time dropped from 327 s to 74 s.
|
| 154 |
+
- **Post-governance audit** (four domains, harvest trajectories): unclosed-thinking rate 0% across fluid physics / materials / genetics / ops; degenerate repetition 1/952; median thinking length 180–581 characters (genetics shortest, fluid physics longest).
|
| 155 |
+
- **Boundary**: this audit covers the five-domain deployment protocol; open-ended (non-domain) questions have not had a dedicated thinking-exhaustion probe.
|
| 156 |
+
|
| 157 |
+
## Training methodology (summary)
|
| 158 |
+
|
| 159 |
+
15 reinforcement windows (G69–G84) on a frozen FP8 serving stack with exact weight/update contracts: group-relative advantages with k=8 sampling and mechanically verifiable rewards; oracle injection for zero-mastery domains; verified distillation from champion checkpoints; frozen domain tags; substep advantage for multi-step composition; per-window heldout gates and retention protection. Single seed, single run — no capability claim in this card comes from a set seen during training.
|
| 160 |
+
|
| 161 |
+
## Honest boundaries
|
| 162 |
+
|
| 163 |
+
- Single seed, single training run; variance bands not fully characterized
|
| 164 |
+
- Prose style is stable at T=0.3 sampling, unstable at greedy decoding
|
| 165 |
+
- Domain capabilities require their tags; untagged behavior is base behavior
|
| 166 |
+
- 27B parameter count — not comparable to 100B+ models on general knowledge
|
| 167 |
+
- Merged FP8 weights add re-quantization noise vs the adapter path (stats in `MERGE_REPORT.md`); the adapter is the numerically exact artifact
|
| 168 |
+
- All scores are single evaluation runs on heldout sets
|
| 169 |
+
|
| 170 |
+
## Acknowledgments
|
| 171 |
+
|
| 172 |
+
- **Alibaba Qwen team** — for Qwen3.8-27B, the open base model this work builds on, and for the open Apache-2.0 release that makes derivative research like this possible.
|
| 173 |
+
- **Z.ai (Zhipu AI)** — GLM 5.3 served as the strongest external benchmark in our evaluation battery and as an engineering assistant during the release workflow.
|
| 174 |
+
- **Moonshot AI** — Kimi K3's public work on long-context and agentic reasoning informed our evaluation design for intent understanding and multi-step tool use.
|
| 175 |
+
|
| 176 |
+
We thank these teams for pushing open, measurable frontiers — this release aims to contribute back in the same spirit.
|
| 177 |
+
|
| 178 |
+
## Citation
|
| 179 |
+
|
| 180 |
+
```bibtex
|
| 181 |
+
@software{labopen_v1,
|
| 182 |
+
title = {Qwen3.8-27B-LabOpen v1: Six-Domain Reinforcement of Qwen3.8-27B},
|
| 183 |
+
author = {Hooman AI Lab},
|
| 184 |
+
year = {2026},
|
| 185 |
+
url = {https://huggingface.co/HoomanBio/Qwen3.8-27B-LabOpen-v1},
|
| 186 |
+
base = {Qwen/Qwen3.8-27B-FP8},
|
| 187 |
+
license = {Apache-2.0}
|
| 188 |
+
}
|
| 189 |
```
|
| 190 |
|
| 191 |
+
---
|
| 192 |
+
|
| 193 |
+
# 中文版模型卡
|
| 194 |
|
| 195 |
+
# Qwen3.8-27B-LabOpen v1
|
| 196 |
|
| 197 |
+
面向可验证科学计算强化的 Qwen3.8-27B——同时以**合并 FP8 全权重**(与基座即插即用)与原始 **LoRA 适配器**两种形态发布。
|
| 198 |
|
| 199 |
+
LabOpen v1 在 [Qwen/Qwen3.8-27B-FP8](https://huggingface.co/Qwen/Qwen3.8-27B-FP8) 之上新增六个可验证能力域(流体物理、材料混合律、经典遗传学、运维动作查询、散文文风、智能体编程),同时保留基座原生的代码生成、函数调用、意图理解与公式显示能力。最大实测增益:78 项确定性智能体编程测试上 **32% → 72%(+40pp)**。
|
| 200 |
|
| 201 |
+
- **基座模型**:Qwen3.8-27B(FP8 版本,Apache 2.0)
|
| 202 |
+
- **训练**:15 个强化窗口(G69–G84),LoRA r=4,组相对强化学习(RLOO 式,k=8 采样),机械可验证奖励
|
| 203 |
+
- **许可证**:Apache 2.0(与基座相同)
|
| 204 |
+
- **硬件要求**:任意支持 FP8 的 GPU(H100 / GB10 / B200 级别);FP8 下约 28 GB
|
| 205 |
|
| 206 |
+
## 项目定位与理念
|
| 207 |
|
| 208 |
+
Qwen3.8-27B-LabOpen v1 是基于 Qwen3.8-27B 开源基础模型开展领域微调与优化的研究模型,重点面向编程、物理学、生命科学、材料科学等科学研究领域。
|
| 209 |
|
| 210 |
+
项目并不以取代通用大模型为目标,而是希望在保留通用模型综合能力的基础上,进一步增强其对科学专业知识、领域问题及研究任务的适应能力。
|
| 211 |
|
| 212 |
+
模型主要面向高校、科研院所、企业研发中心及专业实验室等使用场景,支持根据实际计算资源条件进行本地化或私有化部署。
|
| 213 |
|
| 214 |
+
我们相信,科学研究中的人工智能不应仅仅依赖远程通用模型服务。科研机构也应有机会在自身的计算基础设施上部署、使用和持续优化专业模型,形成符合本机构研究任务、数据管理要求和专业知识体系的人工智能能力。
|
| 215 |
|
| 216 |
+
## 仓库内容
|
| 217 |
|
| 218 |
+
| 路径 | 内容 |
|
| 219 |
+
|---|---|
|
| 220 |
+
| `model-0000X-of-00007.safetensors` + index | **合并 FP8 全权重**(基座 + LoRA,分块 FP8 重量化)。张量布局与量化格式和基座完全相同——即插即用替换 |
|
| 221 |
+
| `adapter/` | **LoRA 适配器**(112 MB,PEFT 格式,992 张量)。训练时的精确数值工件,无重量化 |
|
| 222 |
+
| `MERGE_REPORT.md` | 合并溯源:摘要、分片 SHA-256、重量化误差统计、输出等价探针 |
|
| 223 |
+
| `EVALUATION.md` | 实测能力矩阵与五模型外部对比 |
|
| 224 |
+
| `USAGE.md` | 加载方式、域标记、温度建议、故障排查 |
|
| 225 |
|
| 226 |
+
部署服务用**合并权重**(vLLM/SGLang);需要训练时精确数值或更小下载量时用**适配器**加载基座。
|
| 227 |
|
| 228 |
+
## 能力矩阵(heldout 集实测)
|
| 229 |
|
| 230 |
+
| 域 | 指标 | 得分 | 对比基座 |
|
| 231 |
+
|---|---|---|---|
|
| 232 |
+
| **智能体编程** | 78 项确定性测试,三轮修复 | **72%**(56/78) | **+40pp**(基座:32%) |
|
| 233 |
+
| **意图理解** | 10 场景深层意图探针 | **8/10** | 保持 |
|
| 234 |
+
| **公式显示** | LaTeX 完整性,5 题 | **5/5** | 保持 |
|
| 235 |
+
| 流体物理(CFM) | heldout 池 B,T=0.3 k=8,带标记 | 44% 采样命中 | 新增(基座 ≈ 0) |
|
| 236 |
+
| 材料(混合律) | heldout 40 项,T=0.3 | 32% 采样命中 | 新增(基座 ≈ 0) |
|
| 237 |
+
| 经典遗传学 | heldout 20 项,带标记 | 79% 采样命中 | 新增(基座自然 47%) |
|
| 238 |
+
| 运维(动作查询) | 8 项,双温 | 4–5/8 | 新增 |
|
| 239 |
+
| 散文文风 | 20 项开放题,T=0.3 k=8 | 75% any-correct | 新增 |
|
| 240 |
+
|
| 241 |
+
### 外部对比(同一测试组,2026-10)
|
| 242 |
+
|
| 243 |
+
| 模型 | 意图 | 智能体测试 | 排名 |
|
| 244 |
+
|---|---|---|---|
|
| 245 |
+
| GLM 5.3 | 8/10 | 57/78(73%) | #1 |
|
| 246 |
+
| **LabOpen v1(本模型)** | **8/10** | **56/78(72%)** | **#2** |
|
| 247 |
+
| Qwen3.8-max | 8/10 | 54/78(69%) | #3 |
|
| 248 |
+
| DeepSeek v4.1 flash | 6/10 | 48/78(62%) | #4 |
|
| 249 |
+
| Qwen3.8-27B(基座) | 8/10 | 25/78(32%) | #5 |
|
| 250 |
+
|
| 251 |
+
27B + r4 LoRA 以 15 个训练窗口进入前沿模型的智能体编程区间,这是本发布的头条结果;仍存在的差距(首过率、与 100B+ 模型的通用知识差距)见 `EVALUATION.md`。
|
| 252 |
+
|
| 253 |
+
## 域独特性实测(与前沿模型零样本对照)
|
| 254 |
+
|
| 255 |
+
上述外部对比模型同时在**各域 heldout 原题**上复测(同一批题、剥离标记的纯题面、k=8 采样 T=0.3、item any-correct、同一套栈评分器、输出统一剥 fence)。
|
| 256 |
+
|
| 257 |
+
| 域(题数) | GLM 5.3 | Qwen3.8-max¹ | DeepSeek flash | LabOpen v1² | 基座 |
|
| 258 |
+
|---|---|---|---|---|---|
|
| 259 |
+
| 流体物理(36) | 36/36 | 36/36 | 35/36 | 25/36 † | ≈0 |
|
| 260 |
+
| 材料·严格口径(40) | 1/40 | 0/40 | 0/40 | **17/40** ‡ | ≈0 |
|
| 261 |
+
| 材料·公平口径 1%(40) | 20/40 | 15/40 | 22/40 | 18/40 ‡ | — |
|
| 262 |
+
| 经典遗传(20) | 9/20 | 12/20 | 7/20 | **20/20** † | 47% |
|
| 263 |
+
| 运维·严格口径(8) | 0/8 | 0/8 | 0/8 | **4/8**(T0.3) | 0/8 |
|
| 264 |
+
| 运维·空动作等价(8) | 4/8 | 0/8 | 3/8 | 4/8 | — |
|
| 265 |
+
|
| 266 |
+
¹ 非思考模式,与智能体对比 battery 口径一致;GLM 5.3 保留完整深思;DeepSeek flash 关闭思考(其 API 选项)。² † 我方带标记部署口径;‡ 我方无标记口径(与外部直接可比)。
|
| 267 |
+
|
| 268 |
+
**零分的诚实归因:**
|
| 269 |
+
|
| 270 |
+
- **运维 0/8(严格)**含两个成分。(a) 约定伪影:参考答案的空动作是域词表 `observe`,题面从未说明——前沿模型答 `none` 说明其理解了规则、只是不掌握私有词表(空动作等价重判:GLM 4/8、DeepSeek 3/8、Qwen 仍 0/8)。(b) 真实失败仍然存在:前沿模型以自身运维直觉替代题面声明的规则——如对 `regression=true` 一律 rollback,而声明规则(escalate_on_critical、severity 未达 critical)应为空动作;6 道无触发题上它们明显过度动作(rollback/restart 占输出主导)。我方优势是声明规则的忠实执行加域动作词表,不是"前沿不会运维"。
|
| 271 |
+
- **材料 0/40(严格)**是容差伪影:严格评分(0.01% 相对)要求把语料属性表复现到 4 位有效数字;前沿模型用标准手册常量(物理上正确)被判错。公平 1% 容差下该域持平(38–55% vs 我方 45%);严格口径衡量的是语料表复现(我方 42% vs 0–3%)。
|
| 272 |
+
- **流体物理**:前沿零样本全解——我方价值是把本地 27B 从 ≈0 提到 69%,而非独特性。
|
| 273 |
+
|
| 274 |
+
## 使用方法
|
| 275 |
+
|
| 276 |
+
### 部署合并权重(推荐)
|
| 277 |
+
|
| 278 |
+
```bash
|
| 279 |
+
vllm serve HoomanBio/Qwen3.8-27B-LabOpen-v1
|
| 280 |
+
# 或:docker run ... vllm/vllm-openai --model HoomanBio/Qwen3.8-27B-LabOpen-v1
|
| 281 |
+
```
|
| 282 |
+
|
| 283 |
+
合并检查点与基座采用完全相同的分块 FP8(e4m3,128×128 块尺度)格式——任何能加载 `Qwen/Qwen3.8-27B-FP8` 的运行时均可直接加载本仓库,无需改动。
|
| 284 |
+
|
| 285 |
+
### 加载适配器(训练时精确数值)
|
| 286 |
+
|
| 287 |
+
```python
|
| 288 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 289 |
+
from peft import PeftModel
|
| 290 |
+
|
| 291 |
+
base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3.8-27B-FP8", device_map="auto")
|
| 292 |
+
model = PeftModel.from_pretrained(base, "HoomanBio/Qwen3.8-27B-LabOpen-v1", subfolder="adapter")
|
| 293 |
+
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen3.8-27B-FP8")
|
| 294 |
+
```
|
| 295 |
+
|
| 296 |
+
> **不要自行对 FP8 基座执行 `merge_and_unload()`。** 基座权重以分块 FP8 码 + 128×128 块尺度存储;朴素 PEFT 合并会把 BF16 增量直接加到 FP8 码上,静默损坏权重。请使用本仓库提供的合并检查点——它按「反量化 → 加增量 → 按块重量化」生成,并经与适配器的等��探针验证(见 `MERGE_REPORT.md`)。
|
| 297 |
+
|
| 298 |
+
### 域标记
|
| 299 |
+
|
| 300 |
+
强化域通过置于提示首行的单行标记寻址:
|
| 301 |
+
|
| 302 |
+
| 标记 | 域 |
|
| 303 |
+
|---|---|
|
| 304 |
+
| `[domain: cfm-chain]` | 流体物理链 |
|
| 305 |
+
| `[domain: mat-table]` | 材料混合律 |
|
| 306 |
+
| `[domain: bio-genetics]` | 经典遗传学 |
|
| 307 |
+
| `[domain: ops-action]` | 运维动作查询 |
|
| 308 |
+
| `[domain: general-prose]` | 开放式散文文风 |
|
| 309 |
+
|
| 310 |
+
不加标记时模型保持基座行为(代码 / 函数调用无需标记)。
|
| 311 |
+
|
| 312 |
+
### 温度
|
| 313 |
+
|
| 314 |
+
| 场景 | 温度 |
|
| 315 |
+
|---|---|
|
| 316 |
+
| 域计算(cfm/mat/bio/ops) | 0.3(部分域 greedy 退化) |
|
| 317 |
+
| 开放式散文 | 0.3(散文在分布中但未必是众数) |
|
| 318 |
+
| 代码生成 | 0.0–0.2 |
|
| 319 |
+
| 通用问答 | 0.3–0.7 |
|
| 320 |
+
|
| 321 |
+
## 技术说明
|
| 322 |
+
|
| 323 |
+
- **架构**:Qwen3.8-27B 混合——64 个解码层:48 层线性注意力 + 16 层全注意力。
|
| 324 |
+
- **LoRA**:r=4,α=4(缩放 1.0),dropout 0,覆盖 12 类模块(q/k/v/o/gate/up/down_proj、in_proj_a/b/qkv/z、out_proj)共 496 个投影模块 = 992 张量,约 112 MB。
|
| 325 |
+
- **合并数学**:逐模块 `W = codes × scale`(分块)反量化至 FP32,加入 LoRA 增量 `(B·A)·scaling`,再按 128×128 块重量化(`scale = amax/448`)。平均重量化相对误差 0.33%——与基座自身 FP8 存储噪声同量级。等价探针(greedy,3 提示 × 48 token,适配器 vs 合并):见 `MERGE_REPORT.md`。
|
| 326 |
+
- **训练基材**:Qwen3.8-27B 的本地 FP8 副本(社区再分发)。未与 `Qwen/Qwen3.8-27B-FP8` 做逐位等价核验;适配器配置指向官方发布以便加载。
|
| 327 |
+
|
| 328 |
+
## 思考行为治理
|
| 329 |
+
|
| 330 |
+
基座模型在不熟悉的域问题上可能耗尽思考预算、使推理段未闭合即截断——即"思考枯竭"。本模型对该问题做了测量—治理—复测的完整闭环,而非默认其不存在:
|
| 331 |
+
|
| 332 |
+
- **最严重记录**:材料域窗口(G77)之前,材料题生成 48% 出现思考未闭合截断(窗内燃料采样期 155/320)。
|
| 333 |
+
- **机制**:奖励合同对终止行为做机械评分——截断、格式错误、运行异常是相互独立的奖励类别;oracle 注入显式教授终止行为。该窗口内截断从 155/320 降至 0/320,单题生成时长从 327 秒降至 74 秒。
|
| 334 |
+
- **治理后审计**(四域收获轨迹):流体物理 / 材料 / 遗传学 / 运维四域思考未闭合率均为 0%;退化重复 1/952;思考段长度中位数 180–581 字(遗传学最短、流体物理最长)。
|
| 335 |
+
- **边界**:该审计覆盖五域部署口径;开放式(非域)问题尚未做思考枯竭专项探针。
|
| 336 |
+
|
| 337 |
+
## 训练方法(摘要)
|
| 338 |
+
|
| 339 |
+
15 个强化窗口(G69–G84),运行于带精确权重/更新契约的冻结 FP8 服务栈:组相对优势 + k=8 采样 + 机械可验证奖励;零起点域的 oracle 注入;冠军检查点的验证蒸馏;冻结域标记;多步组合的子步优势;逐窗 heldout 门与保持保护。单种子单次运行——本卡中的全部能力声明均来自训练未见过的评测集。
|
| 340 |
+
|
| 341 |
+
## 诚实边界
|
| 342 |
+
|
| 343 |
+
- 单种子单次训练;方差带未完全表征
|
| 344 |
+
- 散文文风在 T=0.3 采样下稳定,greedy 解码下不稳定
|
| 345 |
+
- 域能力需要标记;无标记行为即基座行为
|
| 346 |
+
- 27B 参数量——通用知识不可与 100B+ 模型相比
|
| 347 |
+
- 合并 FP8 权重相对适配器路径存在重量化噪声(统计见 `MERGE_REPORT.md`);适配器是精确数值工件
|
| 348 |
+
- 所有得分均为 heldout 集上的单次评估
|
| 349 |
+
|
| 350 |
+
## 致谢
|
| 351 |
+
|
| 352 |
+
- **阿里巴巴 Qwen 团队**——感谢 Qwen3.8-27B 这一开放基座模型,以及 Apache-2.0 开放发布使此类衍生研究成为可能。
|
| 353 |
+
- **智谱 AI(Z.ai)**——GLM 5.3 在我们的评估测试组中是最强外部基准,并在发布工程流程中担任工程助手。
|
| 354 |
+
- **月之暗面(Moonshot AI)**——Kimi K3 在长上下文与智能体推理上的公开工作,为我们的意图理解与多步工具使用评测设计提供了参考。
|
| 355 |
+
|
| 356 |
+
我们感谢这些团队推动开放、可度量的前沿——本次发布希望以同样的精神回馈社区。
|
| 357 |
+
|
| 358 |
+
## 引用
|
| 359 |
+
|
| 360 |
+
```bibtex
|
| 361 |
+
@software{labopen_v1,
|
| 362 |
+
title = {Qwen3.8-27B-LabOpen v1: Six-Domain Reinforcement of Qwen3.8-27B},
|
| 363 |
+
author = {Hooman AI Lab},
|
| 364 |
+
year = {2026},
|
| 365 |
+
url = {https://huggingface.co/HoomanBio/Qwen3.8-27B-LabOpen-v1},
|
| 366 |
+
base = {Qwen/Qwen3.8-27B-FP8},
|
| 367 |
+
license = {Apache-2.0}
|
| 368 |
+
}
|
| 369 |
+
```
|