Simple LLM — Qwen3.5-4B SFT

This repository contains a LoRA adapter for Qwen/Qwen3.5-4B. It was trained to make technical answers simpler while preserving correctness.

The target style uses shorter sentences, common words, active voice, and one main idea per sentence. Necessary technical terms, code, commands, and factual detail should remain unchanged.

Intended use

Use this adapter to generate or rewrite technical explanations, documentation, procedures, runbooks, and similar material in clearer English.

This is an experimental style adapter. It does not make the base model more factually reliable. Check generated code, commands, security advice, and other high-impact content before use. The adapter was evaluated on English technical prompts and is not validated for other languages or domains.

Base model

Qwen/Qwen3.5-4B

Dataset

thisisandreeeee/simple-llm-sft

  • 901 training examples
  • 99 validation examples
  • 100 separate holdout prompts for the reported evaluation
  • Deterministic, subject-stratified split with seed 42

Each SFT example contains one user message and one assistant message. The user message is context, but loss is computed only on assistant tokens. Qwen3.5 thinking is disabled in the chat template.

The dataset construction is implemented in simple_llm/sft_dataset.py.

Training

We selected Qwen3.5-4B because it is small enough to fine-tune cheaply while remaining useful for technical questions. Training used Unsloth and TRL supervised fine-tuning with completion-only loss.

The base model was frozen. Only LoRA adapters on the attention and MLP projection layers were trained. The model fit on an NVIDIA L4 at bf16, so the run did not use QLoRA or 4-bit model quantization.

Setting Value
Method Supervised fine-tuning
PEFT method LoRA
LoRA rank 16
LoRA alpha 16
LoRA dropout 0
Target modules q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
Precision bf16
Epochs 2
Per-device batch size 2
Gradient accumulation 4
Effective batch size 8
Learning rate 1e-4
Warmup ratio 0.05
Optimizer 8-bit AdamW
LR schedule Linear
Weight decay 0.01
Maximum sequence length 2,048 tokens
Seed 42
Validation Every 25 steps; restore the checkpoint with the lowest validation loss

The complete training entry point and pinned runtime packages are in simple_llm/sft_training.py.

Hardware

Training ran on one NVIDIA L4 through Modal. Modal also hosted evaluation and inference.

Evaluation

We evaluated 100 held-out technical prompts across ten domains. The comparison covered the raw base model, the base model with a Simple English system prompt, and the SFT adapter. DeepSeek judged technical adequacy, task fulfillment, clarity, and semantic simplicity on a 0–1 scale. Separate deterministic rules measured style properties.

Condition Mean sentence length ↓ Long-sentence fraction ↓ Semantic simplicity ↑ Technical adequacy ↑
Qwen3.5-4B base 17.93 25.44% 0.658 0.683
Base + Simple English prompt 11.15 4.22% 0.748 0.592
Qwen3.5-4B SFT 15.37 15.76% 0.792 0.719

The SFT run improved semantic simplicity and technical adequacy over both comparators in this evaluation. The prompt-only condition produced the shortest sentences, but it also had the lowest technical adequacy score.

These results are directional, not a general benchmark. Conditions did not use identical decoding: the two baselines used greedy decoding, while SFT used sampling with temperature 0.7, top-p 0.8, and top-k 20. Two base outputs and two SFT outputs were truncated and excluded from applicable score means. Some judge requests also failed, so judge means can cover slightly different subsets.

For this benchmark, the adapter contribution was scaled to 0.25 and then merged into the base model. The published adapter stores its original weights, so loading it at the default scale will not exactly reproduce the table. See the inference implementation and the following experiment entry points:

Usage

Install compatible Transformers and PEFT versions, then load the adapter over the base model:

from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer

base_model_id = "Qwen/Qwen3.5-4B"
adapter_id = "thisisandreeeee/simple-llm-qwen3.5-4b-sft"

tokenizer = AutoTokenizer.from_pretrained(adapter_id)
base_model = AutoModelForCausalLM.from_pretrained(
    base_model_id,
    torch_dtype="auto",
    device_map="auto",
)
model = PeftModel.from_pretrained(base_model, adapter_id)

messages = [
    {
        "role": "user",
        "content": "Explain database indexes and their main trade-offs.",
    }
]
inputs = tokenizer.apply_chat_template(
    messages,
    tokenize=True,
    add_generation_prompt=True,
    enable_thinking=False,
    return_tensors="pt",
    return_dict=True,
).to(model.device)

outputs = model.generate(
    **inputs,
    max_new_tokens=512,
    temperature=0.7,
    top_p=0.8,
    top_k=20,
    do_sample=True,
)
response = tokenizer.decode(
    outputs[0, inputs["input_ids"].shape[1]:],
    skip_special_tokens=True,
)
print(response)

Replace adapter_id if this repository is published under a different Hugging Face model ID. You can also merge the loaded adapter with model.merge_and_unload() for inference.

Code and reproducibility

The training workflow saves the dataset hashes, package versions, base-model revision, GPU details, and full trainer configuration with each run.

Framework versions

  • Unsloth 2026.7.6
  • PyTorch 2.11.0
  • Transformers 5.5.0
  • TRL 0.24.0
  • Datasets 4.3.0
  • PEFT 0.20.0
Downloads last month
34
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for thisisandreeeee/simple-llm-lora

Finetuned
Qwen/Qwen3.5-4B
Adapter
(518)
this model

Dataset used to train thisisandreeeee/simple-llm-lora