open-thoughts/OpenThoughts3-1.2M
Viewer • Updated • 1.2M • 19.2k • 256
How to use ahmetggg/Luck-Qwen3-4b-Code-FineTune with PEFT:
Task type is invalid.
A QLoRA fine-tune of unsloth/Qwen3-4B-Instruct-2507 specialized in agentic coding, multi-step reasoning, tool use, and calibrated uncertainty.
TL;DR: This model improves output formatting consistency, tool interaction, and knowledge boundary awareness ("I don't know" responses) without increasing the underlying capability ceiling of the base model.
Training loss convergence from ~1.7 to ~0.55 across 1,267 steps.
| Parameter / Metric | Value |
|---|---|
| Base Model | unsloth/Qwen3-4B-Instruct-2507 (4.05B params, dense) |
| Method | QLoRA (4-bit NF4) |
| LoRA Rank / Alpha | r=16, alpha=16, dropout=0 |
| Target Modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| Trainable Parameters | 33,030,144 / 4,055,498,240 (0.81%) |
| Context Length | 4,096 tokens |
| Dataset Size | 10,129 examples |
| Training Steps / Epochs | 1,267 steps / 1 epoch |
| Effective Batch Size | 8 (2 per-device × 4 gradient accumulation steps) |
| Optimizer / Schedule | adamw_8bit, learning rate 2e-4, cosine schedule |
| Hardware | Single T4 GPU (Google Colab / Kaggle) |
| Final Loss | ~0.55 (started at ~1.7) |
| Frameworks | Unsloth, TRL (SFTTrainer), PEFT, Transformers |
This repository contains:
Note: Quantized GGUF files are hosted separately at ahmetggg/Luck-Qwen3-4b-Code-FineTune-GGUF.
| Source | Focus Area | Details / Filtering |
|---|---|---|
nvidia/Open-SWE-Traces |
Agentic coding | Filtered exclusively to resolved == 1 trajectories |
open-thoughts/OpenThoughts3-1.2M |
Math & science reasoning | Code domain excluded (handled by Open-SWE-Traces) |
Agent-Ark/Toucan-1.5M |
Tool calling | Real multi-turn tool interaction trajectories |
| Custom R-Tuning Set | Calibration | ~150–300 MMLU items queried on base model; correct outputs retained as normal QA, incorrect outputs relabeled as "I don't know" |
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "ahmetggg/Luck-Qwen3-4b-Code-FineTune",
max_seq_length = 4096,
load_in_4bit = True,
)
FastLanguageModel.for_inference(model)
messages = [{"role": "user", "content": "Write a Python function to reverse a linked list."}]
inputs = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt").to("cuda")
outputs = model.generate(inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0][inputs.shape[1]:], skip_special_tokens=True))