CoolFace
Modelpublic

rico03/Qwen3.8-27B-Claude-Opus-Reasoning-Distilled

sourceHugging Faceapache-2.0updated 1mo agoView on Hugging Face
6likes108downloads
Model Card

Qwen3.8-27B-Claude-Opus-Reasoning-Distilled

License Base Model Method Teacher Params

A LoRA fine-tune of Qwen/Qwen3.8-27B distilled on reasoning traces from Claude Opus 4.6/4.7, targeting the deep, structured chain-of-thought style Opus is known for โ€” mapped onto an open-weight dense 27B you can run and fine-tune yourself.

Trained text-only (vision tower untouched, not targeted by LoRA) with Unsloth on a single H100.

๐Ÿ”— Quantized GGUF versions (Q8_0 โ†’ Q4_K_M) with verified MTP speculative decoding available at [rico03/Qwen3.8-27B-Claude-Opus-Reasoning-Distilled-GGUF](https://huggingface.co/rico03/Qwen3.8-27B-Claude-Opus-Reasoning-Distilled-GGUF).

๐Ÿง  What this is

Qwen3.8-27B is natively vision-language with a hybrid attention stack (16/64 full-attention layers, 48/64 Gated DeltaNet/linear-attention layers). This fine-tune targets only the text reasoning path โ€” both attention types via LoRA, MLP layers, vision tower left frozen and unused.

  • โ€”Base model: Qwen/Qwen3.8-27B (dense, 27B, hybrid linear+full attention, MTP head)
  • โ€”Method: LoRA (r=32, alpha=32) via Unsloth, 4-bit QLoRA base
  • โ€”Response-only masking: loss computed only on assistant turns (train_on_responses_only)
  • โ€”Hardware: 1ร— NVIDIA H100 NVL (95GB), Vast.ai
  • โ€”Training data: ~21.5K examples combining real Opus extended-thinking traces and reconstructed-reasoning traces over genuine Opus outputs (see Dataset Composition below)

๐Ÿ“Š Training Details

Steps trained150 (partial run โ€” pipeline validation, not full convergence)
Epochs0.126 (~12.6% of one epoch, ~2,700 of 21,490 examples)
Effective batch size18 (per-device 6 ร— grad accum 3)
Final train loss (avg)0.728
Final eval lossnot computed this run (eval_strategy="no" to save time)
Wall-clock time53 min on 1ร— H100 NVL
Sequence length8192 (99.7% of dataset uncut; 0.3% longest examples excluded rather than truncated)
Trainable params233,455,616 (0.85% of 27.6B)
Adapter size on disk954 MB
Status: pipeline-validation run, not a fully converged model. 150 steps at batch 18 covers ~12.6% of one epoch โ€” enough to confirm the training pipeline (LoRA on hybrid attention, masking, chat template, checkpointing) works end-to-end, not enough for the model to have generalized across the full dataset. A full run (1+ epoch, ~1,194+ steps) is needed before this should be treated as a finished distillation. Loss trended downward over the run (high ~0.95-1.1 early, several sub-0.6 readings by step 70-90) but with a cosine schedule calibrated for exactly 150 steps โ€” this checkpoint cannot simply be resumed for a longer run; a full run needs a fresh schedule sized to the full dataset.

๐Ÿ“š Dataset Composition

SourceExamplesWhat it is
lordx64/reasoning-distill-claude-opus-4-7-max8,124Genuine Claude Opus 4.7 extended-thinking traces (verified model/usage fields per row)
Jackrong/Claude-opus-4.7-TraceInversion-5000x4,800Real Opus 4.7 outputs (teacher_model field), reasoning trace reconstructed post-hoc by a smaller "trace inversion" model โ€” plausible CoT matching a genuine answer, not captured original thinking
Jackrong/Claude-opus-4.6-TraceInversion-9000x8,700Same trace-inversion method, Opus 4.6

Transparency note: ~62% of the dataset (the two TraceInversion sets) has a genuine final answer from Opus but a reconstructed reasoning trace, not Opus's actual internal thinking. This is disclosed so downstream users know the reasoning style is a plausible approximation for roughly two-thirds of the data, not a verbatim mirror throughout. The lordx64 subset (~38%) is the closest to authentic Opus thinking style.

We deliberately excluded several other "Claude-distilled" datasets found on Hugging Face after inspection โ€” some contained self-referential synthetic text describing itself as "exemplifying" a model's style rather than real model output, and others were low-effort duplicate repos farming downloads. Always verify teacher_model/usage provenance fields before trusting a distillation dataset.

๐Ÿ“ˆ Base Model Benchmarks (Qwen/Qwen3.8-27B, not this fine-tune)

These are official Qwen3.8-27B numbers for the base model, included for reference โ€” this fine-tune has not been independently re-benchmarked yet.

Text Performance

Qwen3.8-27BQwen3.6-27BQwen3.7-Plus
Terminal-Bench 2.1 (agentic coding)73.063.464.0
SWE-bench Pro61.753.557.6
QwenSWEBench79.049.359.2
CoWorkBench (long-horizon office work)70.761.065.1
IFBench (instruction following)79.569.179.1
GPQA Diamond (scientific reasoning)89.287.890.3
HLE (multidisciplinary reasoning)30.824.034.7
LiveCodeBench v690.383.989.6

VL Performance (base model only โ€” this fine-tune does not target vision)

Qwen3.8-27BQwen3.6-27BQwen3.7-Plus
OSWorld-Verified (computer use)84.363.973.3
AndroidWorld (mobile use)81.970.381.0
MathVision (with CI)94.685.190.3
OmniDocBench 1.591.189.491.4

Full base model benchmark tables: Qwen/Qwen3.8-27B model card.

๐Ÿš€ Usage

python
from unsloth import FastLanguageModel

model, tokenizer = FastLanguageModel.from_pretrained(
    model_name = "rico03/Qwen3.8-27B-Claude-Opus-Reasoning-Distilled",
    max_seq_length = 8192,
    dtype = None,
    load_in_4bit = True,
)
FastLanguageModel.for_inference(model)

messages = [{"role": "user", "content": "Explain the difference between TCP and UDP."}]
inputs = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt").to("cuda")
outputs = model.generate(inputs, max_new_tokens=1024, temperature=1.0, top_p=0.95, top_k=20)
print(tokenizer.decode(outputs[0]))

Thinking is on by default (<think>...</think> block before the final answer), matching the base Qwen3.8 chat template. Use reasoning_content as a separate message field if constructing multi-turn history manually โ€” do not pack the thinking block into content, the chat template expects it separate.

โš ๏ธ Known Limitations

  • โ€”This checkpoint is a pipeline-validation run (150 steps, ~12.6% of one epoch), not a fully converged fine-tune. Expect it to show the target <think> format and some stylistic shift, but not robust generalization across task domains. A full training run is needed for production use โ€” see status note above.
  • โ€”Dataset partially composed of reconstructed (not captured) reasoning traces โ€” see Dataset Composition above
  • โ€”Text-only fine-tune; vision tower is unmodified base weights, not evaluated

๐Ÿ™ Acknowledgments

Training methodology based on the Jackrong fine-tuning guide. Thanks to lordx64 and Jackrong for the source reasoning datasets.


Maintained by rico03