A note on an earlier version of this documentation
An earlier draft of this project's README included a "Parity Level" table claiming the fine-tuned model reaches ~85-90% of Claude's reasoning style, ~85% of its technical tone, and so on. Those numbers were hardcoded literal text in src/build_100_comparison_md.py, written directly into the report regardless of what the actual 100-prompt evaluation shows. They were not computed from anything. This version removes them and describes only what's directly checkable in 100_PROMPTS_BASE_VS_FINE_TUNED_CLAUDE_DISTILL_COMPARISON.md. Full account, including a second corrected claim about a specific example: docs/LIMITATIONS_AND_HONESTY.md on the GitHub repo.
What the evaluation actually shows
Reading the 100 real base/fine-tuned/gold response triplets in 100_PROMPTS_BASE_VS_FINE_TUNED_CLAUDE_DISTILL_COMPARISON.md:
- The fine-tuned model opens with a
<think> reasoning block before answering on every prompt checked; the base model does not.
- On the Marx-vs-Weber prompt (#1), the base model gives a generic "Marx focused on economics, Weber on religion" contrast. The fine-tuned model instead engages with the prompt's own framing (that this contrast is oversimplified) and works through Weber's actual caveat against a purely cultural explanation.
- On the Burnside's Lemma prompt (#4, counting distinct 6-bead, 3-color necklaces), the base model conflates the cyclic group C6 with the dihedral group D6 partway through its derivation, which changes the answer. The fine-tuned model correctly identifies C6 and sets up the right cycle-counting approach. Neither response reaches a final number within the 400-token generation cap used for this eval; for the record, the correct answer is 130 (verify: (3^6 + 3^1 + 3^2 + 3^3 + 3^2 + 3^1) / 6 = 780 / 6 = 130), and the fine-tuned model was on the right track toward it, not confirmed to have stated it.
These are real, spot-checked differences between two actual model outputs, not a claim about overall parity with Claude on any dimension.
Training
- Base model:
Qwen/Qwen2.5-7B-Instruct (7.61B parameters).
- Method: QLoRA, rank 16, alpha 32, targeting all linear projections (
q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj), via TRL's SFTTrainer.
- Data: 15,000 dialogs sampled from
qsardor/Claude-Sonnet-Opus, split 90/10 into 13,500 training and 1,500 validation records. The 100 evaluation prompts are drawn separately from the tail of the same source dataset as a holdout.
- Hardware: 2x NVIDIA H200 SXM NVL GPUs (288 GB combined VRAM), PyTorch DDP via
torchrun --nproc_per_node=2.
- Reported training loss (1.438 to 0.9244 over 3 epochs) and validation accuracy (73.48%) are the kind of metrics
SFTTrainer logs automatically, but no training_metrics.json or training log is included in this repository to verify the specific final values. Treat them as reported, not independently confirmed here.
Data provenance and terms
The training data is a third-party Hugging Face dataset (qsardor/Claude-Sonnet-Opus) that labels its contents as Claude 3.5 Sonnet and Claude 3 Opus outputs. This repository does not independently verify that provenance. If you plan to redistribute or commercialize a model trained this way, note that using another provider's model outputs to train or improve a competing model is restricted under most AI providers' usage policies, including Anthropic's. Review the source dataset's own documentation and the relevant usage policy before doing so.
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
base_id = "Qwen/Qwen2.5-7B-Instruct"
adapter_id = "namanadep/Qwen2.5-7B-Claude-Sonnet-Opus-Distill"
tok = AutoTokenizer.from_pretrained(base_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
base_id, torch_dtype=torch.bfloat16, device_map="auto", trust_remote_code=True
)
model = PeftModel.from_pretrained(model, adapter_id)
Repository contents
adapter_model.safetensors, adapter_config.json, chat_template.jinja, tokenizer.json, tokenizer_config.json: LoRA adapter and tokenizer files.
qwen2.5-7b-claude-distill.gguf: F16 GGUF export for Ollama and llama.cpp (15.2 GB).
100_PROMPTS_BASE_VS_FINE_TUNED_CLAUDE_DISTILL_COMPARISON.md: the real 100-prompt base/fine-tuned/gold comparison.
src/: training, evaluation, and export scripts, mirrored and kept current on GitHub.
License
Apache 2.0 for the code and documentation in this repository. The base Qwen2.5 model and the upstream dataset keep their own terms; see the data provenance note above.