HoomanBio commited on
Commit
4f54b21
·
verified ·
1 Parent(s): 57d2af0

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +339 -46
README.md CHANGED
@@ -1,76 +1,369 @@
1
- # qwen3.8_27b_LabOpen
 
 
 
 
 
 
 
 
 
 
 
2
 
3
- 本机独立项目仓库:`/Users/luoshumac/projects/qwen3.8_27b_LabOpen`。
4
- 从原`/Users/luoshumac/Documents/常规工具`保留Git历史迁入;后续开发以本目录为准,原目录仅保留兼容/历史备份。详见[迁移记录](PROJECT_MIGRATION_2026_9_12.md)。
5
 
6
- 2026-09-21按用户澄清,将原目录名中的qwen3.5笔误纠正为qwen3.8;曾为兼容保留旧名称符号链接,现已按用户要求移除;只使用上述新根目录。历史文件、远端目录、模型ID与冻结字节保持原样,详见[名称纠正记录](PROJECT_PATH_CORRECTION_2026_9_21.md)。
7
 
8
- 本仓库保存 Dell Pro Max with GB10 上 Qwen3.8 本地推理、模型对照、原生 LoRA/SFT、模拟工具智能体和实验记录。模型权重保存在 GB10,不进入 Git。
9
 
10
- ## 当前阶段
 
 
 
11
 
12
- 新会话按[AGENTS蓝图](AGENTS.md) → [当前阶段](LABOPEN_CURRENT_STAGE.md) → 当前指定的有效计划接续;[交接](LABOPEN_HANDOFF.md)说明资产与操作边界,[文档地图](LABOPEN_DOCUMENTATION_MAP.md)管理详细索引和历史回查。核心目标是条件理解、信息选择、规则组合与能力保留,旧计划中的“下一步”不自动执行。
13
 
14
- 训练栈独立管理入口:[LABOPEN_TRAINING_STACK_GOVERNANCE.md](LABOPEN_TRAINING_STACK_GOVERNANCE.md)。组件、模型配置、配方、评测和运行分别治理;已有配方可依据实测重新组合,不因一次实验而固化整个基座。[2026-09-21审查与收益反思](LABOPEN_TRAINING_STACK_REVIEW_2026_9_21.md)记录当前证据、接口缺口与改进优先级。
15
 
16
- 迁移时最新状态:G12机制窗口已完成,0训练更新;同FP32参考路径dense1/6、MoBA5/6,仅局部信号,原生精度差异与因果前提仍待研究。g06已暂停,常驻服务已恢复;本次迁移不恢复旧轮询。
17
 
18
- - 常驻推理:`orcarouter/Qwen3.8-27B-Uncensored-FP8`,vLLM,32K eager,环回监听。
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
- 从仓库根目录运行:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
 
39
  ```bash
40
- python3 -m unittest discover -s labopen_stack/tests -t .
41
- venv/labopen-science-20260921/bin/python \
42
- gb10_qwen38/stages/generalization_20260909/check_regressions.py local \
43
- --base-python /usr/local/bin/python3
44
- /usr/local/bin/python3 gb10_qwen38/stages/generalization_20260909/recall.py --check
45
- /usr/local/bin/python3 -m compileall -q gb10_qwen38
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  ```
47
 
48
- 模块化训练栈v0.1的CLI、CPU Torch入口与验证边界见[训练栈说明](labopen_stack/README.md),组合与演进规则见[独立治理](LABOPEN_TRAINING_STACK_GOVERNANCE.md)。G37完成128更新与恢复/独立评分,工程通过但物理fit未过、新世界未测;代码保留而无新增益。尚无通过整体能力验收的配方;软件、配方和模型资产分别验收,详见[G37报告](artifacts/g37-prefix-learning-20260921/G37_REPORT.md)。
 
 
49
 
50
- S05辅助可见性策略及共享学习执行器已完成G38的128更新工程核验;G38原题fit未过、A旧代码退化、B未显现主任务增益,不晋级。合同、结果及后续边界见[当前阶段](LABOPEN_CURRENT_STAGE.md)。本轮仅比较辅助前态可见性,仍以原题拟合/新世界/保留验收。
51
 
52
- S06主损失分配与显式无辅助组合已完成G39-v2的96更新工程核验;B原题4/8、零截断、代码保留通过,但fit未过、新世界未测、不晋级,见[报告](artifacts/s06-g39-20260922/G39_REPORT.md);[当前阶段](LABOPEN_CURRENT_STAGE.md)维护唯一当前状态。工程验证与能力收益分开,G39-v1仅为未启动作废准备版。
53
 
54
- S07按臂主target、数值代入来源审计与变长目标预算映射已完成G40-v1的96更新工程核验。A4/8、B5/8均未过fit,新世界未测,代码保留通过;[报告](artifacts/s07-g40-20260922/G40_REPORT.md)记录局部得失与边界。g40检查已移除,现状以[当前阶段](LABOPEN_CURRENT_STAGE.md)为准。S08输入策略与训练/eval隔离完成G41-v2的96更新工程核验。A5/8、B6/8,但干扰题正确数3/4→1/4,两臂fit未过、新世界未测、代码保留,配方不晋级;[报告](artifacts/s08-g41-20260923/G41_REPORT.md)记录结论。g41检查已移除;v1为未启动作废准备版。S09/G42完成0更新、18请求与恢复/独立评分;配对正确3/8→3/8→5/8,去重3/8、2/5、3/5,C2一项截断,帮助效果有修复也有退化、三个预注册信号均未过,见[报告](artifacts/s09-g42-20260923/G42_REPORT.md)。没有能力晋级;g42收口检查已移除,G43也已收口,最新结论见当前阶段。
55
 
56
- Mac科学环境固定Python3.11.9 / NumPy2.2.6 / SciPy1.15.3 / h5py3.13.0;基础测试仍使用本机`/usr/local/bin/python3`(含Pillow),Torch部分沿用GB10原生CPU验证环境。旧冻结执行器仍含`/tmp/labopen-scicode-xc8sem/venv/bin/python`;这是历史重放依赖,不是新项目目录,具体说明见迁移记录。不要直接重放旧运行器,也不要批量替换冻结JSON内的路径。
 
 
 
57
 
58
- GB10 上的模型服务、训练环境和权重不由 Git checkout 自动修改。任何临时模型切换都必须在退出路径恢复 `qwen38.service` 并实际生成固定字符串。
59
 
60
- ## 项目原则
61
 
62
- 认知开放,执行受权。知识分析不按主题阻断;现实动作由独立网关根据资产范围、书面授权、工单、窗口、证据和可逆性决定。模型输出不构成现实执行授权。
63
 
64
- S10联合监督视图与显式评测布局完成G43-v1的96更新工程验收、恢复和独立评分。覆盖项2/4→3/4,但丢失两条原有正确主请求;两臂既有CPM保留题退化,均未过fit、新世界未测,配方不晋级。g43收口检查移除;后续活动合同以当前阶段为准。见[报告](artifacts/s10-g43-20260923/G43_REPORT.md),见[方案](IMPLEMENTATION_PLAN_2026_9_23_LABOPEN_S10_G43_QUANTITY_COVERAGE.md)和[实施日志](EXPLORATION_LOG_2026_9_23_LABOPEN_S10_G43_EXECUTION.md)。
65
 
66
- S11配对等价teacher路径与保护预算完成G44-v1的96更新、恢复及独立工程验收。A主请求8/12、B7/12,B丢失原正确项,两臂CPM保留退化,fit未过/新世界未测;路径配方不晋级,见[G44报告](artifacts/s11-g44-20260923/G44_REPORT.md)。唯一现状见[当前阶段](LABOPEN_CURRENT_STAGE.md),旧窗口不续跑,不自动下一GPU合同。
67
 
68
- S12/G45已完成N/PC/P/C来源诊断:144更新/112生成、复现/预算门、原服务恢复和完整独立核验通过。已知CPM退化可由物理单独更新产生,代码监督另有局部保护;无新世界/能力晋级,见[G45报告](artifacts/s12-g45-20260924/G45_REPORT.md)。112生成是28已知输入×4资产。实际状态见[当前阶段](LABOPEN_CURRENT_STAGE.md),合同见[S12/G45](IMPLEMENTATION_PLAN_2026_9_24_LABOPEN_S12_G45_OBJECTIVE_ABLATION.md)。
69
 
70
- S13/G46完成96更新/102生成、恢复与独立工程验收。KL明显降低,但CPM错题转移、物理正确集合退化,保留/候选失败,新世界未测;见[G46报告](artifacts/s13-g46-20260924/G46_REPORT.md),见[当前阶段](LABOPEN_CURRENT_STAGE.md)及[S13方案](IMPLEMENTATION_PLAN_2026_9_24_LABOPEN_S13_G46_CODE_DISTRIBUTION_ANCHOR.md)。该窗口已结束,不重复启动、扩时或自动下一窗口。
 
 
 
 
 
 
71
 
72
- S14/G47完成96更新/102生成、恢复与独立工程验收。A逐字节复现G46 A,B从G46 A检查点继承续训第二纪元:主请求10/12、全16题14/16、代码18/18(首个全保留训练资产),但丢失一条A已正确主请求,无损条款与fit未过、新世界未测;见[G47报告](artifacts/s14-g47-20260925/G47_REPORT.md),见[当前阶段](LABOPEN_CURRENT_STAGE.md)及[S14方案](IMPLEMENTATION_PLAN_2026_9_25_LABOPEN_S14_G47_INHERITANCE_DOSE.md)。该窗口已结束,不重复启动、扩时或自动下一窗口。
73
 
74
- S15/G48完成96更新/102生成、恢复与独立工程验收。A逐字节复现G47 B第二纪元,B从G47 B检查点进入第三纪元:两进三出净退化(主请求9/12、代码16/18),预注册分支4成立,纯剂量方向关闭,fit未过、新世界未测;见[G48报告](artifacts/s15-g48-20260925/G48_REPORT.md),见[当前阶段](LABOPEN_CURRENT_STAGE.md)及[S15方案](IMPLEMENTATION_PLAN_2026_9_25_LABOPEN_S15_G48_THIRD_EPOCH.md)。该窗口已结束,不重复启动、扩时或自动下一窗口。
75
 
76
- S16/G49完成自洽合同G49-v4的96更新/102生成、恢复与独立工程验收。B验证自轨迹主请求12/12、全16题15/16、三元组4/4(项目历史最强物理结果),self_path_signal通过;但丢失3403/nuisance且代码既有CPM退化,保留与fit未过、新世界未测。G49-v1/v2/v3资格期失败/偏离原件全部保留。见[G49报告](artifacts/s16-g49-20260925/G49_REPORT.md),见[当前阶段](LABOPEN_CURRENT_STAGE.md)及[S16方案](IMPLEMENTATION_PLAN_2026_9_25_LABOPEN_S16_G49_SELF_PATH.md)。该窗口已结束,不重复启动、扩时或自动下一窗口。
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: Qwen/Qwen3.8-27B-FP8
4
+ tags:
5
+ - qwen
6
+ - lora
7
+ - reinforcement-learning
8
+ - fp8
9
+ - agentic-coding
10
+ - scientific-computing
11
+ library_name: transformers
12
+ ---
13
 
14
+ # Qwen3.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
+ ```