Highlights
- +50% More Compiling C++20 / Dear ImGui 1.93.1 Solutions: On Europa ImPlus BenchMark (EIPB), improved compilation rate from 28 / 100 (
Qwen3-4B-Instruct-2507 Base) to 42 / 100 (+14 tasks), and +75% Solved Tasks (7 / 100 vs 4 / 100), lifting Strict EIPB Score from 2.59% to 4.66% and Partial EIPB Score from 5.79% to 7.69%.
- On-Demand
<think>...</think> Reasoning Restored: Qwen3-4B-Instruct-2507 is originally a non-thinking checkpoint where <think> and </think> embeddings are collapsed near <tool_call> (cos = 0.9901). Targeted embedding + LoRA calibration separated <think>/</think> cleanly (cos = 0.4454), enabling <think>...</think> reasoning when requested while staying concise and direct on normal coding/chat requests.
- Compiler & Headless-Verified Dear ImGui 1.93.1 Data: Curated with zero mid-response truncation (
missing_eos = 0) and verified using g++ 16.2.0 -std=c++20 -DIMGUI_DISABLE_OBSOLETE_FUNCTIONS plus 3-frame headless ImGui::NewFrame()/Render() execution (57/57 Dear ImGui 1.93.1 modules passed).
- Verified GGUF Quantizations: Standalone merged
Q4_K_M, Q5_K_M, and Q8_0 GGUF builds tested end-to-end with llama.cpp b12843 (llama-cli -ngl 99 -st).
Benchmark & Evaluation — Europa ImPlus BenchMark (EIPB)
Evaluated on Europa ImPlus BenchMark (EIPB): 100 executable C++20 / Dear ImGui 1.93.1 (docking, IMGUI_DISABLE_OBSOLETE_FUNCTIONS) tasks across 8 categories (31 easy, 45 medium, 24 hard).

How EIPB Scoring Works
- Difficulty Weights: Each task is weighted by difficulty (1 for
easy, 2 for medium, 3 for hard), summing to 193 max points.
- Strict Score (
EIPB Score): Percentage of the 193 points awarded only for tasks where 100% of hidden headless UI unit tests pass.
- Partial Score (
EIPB Partial): Percentage of the 193 points giving fractional credit (passed_tests / total_tests) * task_points, reflecting compiling solutions and partial test passes.
- Local Testbed: Windows 11, MinGW-W64 WinLibs
g++ 16.2.0 (UCRT, -std=c++20). Local Qwen models were evaluated with greedy decoding (temperature=0.0, max_new_tokens=2048).
Overall Comparison (Local WinLibs GCC 16.2.0 Harness)
Table with columns: Model, Protocol / Notes, Compiled, Solved (pass@1), Strict (EIPB Score), Partial (EIPB Partial)| Model | Protocol / Notes | Compiled | Solved (pass@1) | Strict (EIPB Score) | Partial (EIPB Partial) |
|---|
Antinimus/Qim-1.5B | Local BF16 (temp=0.0, WinLibs GCC 16.2.0) | 25 / 100 | 1 / 100 (1.0%) | 0.52% | 1.99% |
Qwen/Qwen3-4B-Instruct-2507 (Base) | Local BF16 (temp=0.0, WinLibs GCC 16.2.0) | 28 / 100 | 4 / 100 (4.0%) | 2.59% | 5.79% |
Qim-4B (Ours) | Local BF16 (temp=0.0, WinLibs GCC 16.2.0) | 42 / 100 | 7 / 100 (7.0%) | 4.66% | 7.69% |
Claude Opus 5.5 (Reference) | Web Chat (effort: High, 2026-11-29, WinLibs GCC 16.2.0) | 94 / 100 | 89 / 100 (89.0%) | 88.08% | 90.07% |
Reproducibility note: All local models and the Claude Opus 5.5 reference were graded on the exact same Windows 11 / WinLibs GCC 16.2.0 harness shown above (on its separate Linux GCC + ASan/TSan run, those same Claude Opus 5.5 answers scored 100/100 compiled, 97/100 solved, 97.41% strict, 98.88% partial).
Per-Category Breakdown (Partial% (Strict%, Solved))
Table with columns: Category (Tasks / Max Pts), Qim-1.5B, Qwen3-4B-Instruct-2507 (Base), Qim-4B (Ours), Claude Opus 5.5 (High, WinLibs)Category (Tasks / Max Pts) | Qim-1.5B | Qwen3-4B-Instruct-2507 (Base) | Qim-4B (Ours) | Claude Opus 5.5 (High, WinLibs) |
|---|
Core Widgets (15 / 19) | 11.4% (5.3%, 1/15) | 27.2% (21.1%, 3/15) | 49.1% (31.6%, 5/15) | 100.0% (100.0%, 15/15) |
Input & Popups (15 / 31) | 2.2% (0.0%, 0/15) | 12.4% (3.2%, 1/15) | 7.5% (3.2%, 1/15) | 100.0% (100.0%, 15/15) |
Layout & Tables (15 / 30) | 1.7% (0.0%, 0/15) | 1.7% (0.0%, 0/15) | 6.7% (6.7%, 1/15) | 100.0% (100.0%, 15/15) |
Custom Rendering (15 / 30) | 0.0% (0.0%, 0/15) | 0.0% (0.0%, 0/15) | 0.0% (0.0%, 0/15) | 100.0% (100.0%, 15/15) |
Fonts, Style & IO (12 / 24) | 0.0% (0.0%, 0/12) | 0.0% (0.0%, 0/12) | 0.0% (0.0%, 0/12) | 70.8% (66.7%, 9/12) |
Architecture C++ (13 / 29) | 0.0% (0.0%, 0/13) | 2.3% (0.0%, 0/13) | 2.3% (0.0%, 0/13) | 77.0% (69.0%, 9/13) |
Debugging (10 / 16) | 3.1% (0.0%, 0/10) | 6.2% (0.0%, 0/10) | 3.1% (0.0%, 0/10) | 65.6% (62.5%, 6/10) |
Projects (5 / 14) | 0.0% (0.0%, 0/5) | 0.0% (0.0%, 0/5) | 0.0% (0.0%, 0/5) | 100.0% (100.0%, 5/5) |
GGUF Quantizations
All GGUF builds were exported from the standalone merged BF16 weights (llama.cpp b12843) — no separate LoRA adapter is required — and verified on AMD Vulkan (RX 9060 XT) using llama-cli -ngl 99 -st for Qwen chat formatting, <think> tag generation, and clean EOS stopping:
Table with columns: File, Quant, Size, Verified Speed (RX 9060 XT Vulkan), Notes| File | Quant | Size | Verified Speed (RX 9060 XT Vulkan) | Notes |
|---|
gguf/Qim-4B-Q4_K_M.gguf | Q4_K_M | 2.33 GiB (2,497,278,912 B) | ~104.8 t/s | Compact 4-bit build for fast local inference |
gguf/Qim-4B-Q5_K_M.gguf | Q5_K_M | 2.69 GiB (2,889,511,872 B) | ~93.1–93.7 t/s | Recommended balance of speed and coding/reasoning quality |
gguf/Qim-4B-Q8_0.gguf | Q8_0 | 3.99 GiB (4,280,403,392 B) | ~67.9 t/s | Near-lossless 8-bit quantization |
Quickstart
import torchfrom transformers import AutoModelForCausalLM, AutoTokenizer model_id = "Antinimus/Qim-4B"tokenizer = AutoTokenizer.from_pretrained(model_id)model = AutoModelForCausalLM.from_pretrained( model_id, dtype="auto", device_map="auto",) messages = [ {"role": "system", "content": "You are Qim. Think concisely inside <think>...</think> when helpful."}, {"role": "user", "content": "Think inside <think>...</think> before answering: If 3x + 7 = 22, what is x^2 + 1?"},]text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)inputs = tokenizer([text], return_tensors="pt").to(model.device) with torch.no_grad(): out = model.generate( **inputs, max_new_tokens=512, temperature=0.7, top_p=0.8, top_k=20, do_sample=True, ) response = tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=False)print(response)
llama.cpp (GGUF — llama-cli & llama-server)
Install prebuilt binaries or build from source via the official ggml-org/llama.cpp repository (Releases).
CLI single-turn inference:
llama-cli -m Qim-4B-Q5_K_M.gguf -ngl 99 --temp 0.7 --top-p 0.8 --top-k 20 -st -p "Напиши короткий виджет Dear ImGui 1.93.1 с чекбоксом VSync и слайдером Scale."
OpenAI-compatible API server (port 9931 for Pi, Hermes, OpenClaw, or local IDE clients at http://localhost:9931/v1):
llama-server -hf Antinimus/Qim-4B:Q5_K_M --port 9931 -ngl 99 --temp 0.7 --top-p 0.8 --top-k 20
vLLM (BF16 OpenAI-Compatible Server)
vllm serve Antinimus/Qim-4B --port 9931
Docker Model Runner (GGUF)
docker model run hf.co/Antinimus/Qim-4B:Q5_K_M
Training Details
- Base Model:
Qwen/Qwen3-4B-Instruct-2507 (4.06B parameters, 36 layers, 262,144-token context)
- Method & Weight Merging:
- LoRA SFT (
r=16, lora_alpha=32, lora_dropout=0.05, all linear projections: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj; 33,030,144 trainable params / 0.8145%)
- At the end of Stage 2, the LoRA adapter and the calibrated
<think> / </think> embedding & LM-head rows were merged directly into the bfloat16 checkpoint (model.safetensors), and all GGUF quantizations were exported from that merged BF16 model.
- Stage 1 — Domain, Coding & Bilingual Mix (
367 optimizer steps, val_loss = 0.5508):
imgui_v4_clean: 280 rows at Stage 1 (47 headless-verified Dear ImGui 1.93.1 modules × 2 EN/RU = 94 + 179 C++20 algorithms + 7 compact UI examples), repeated ×2 = 560 raw rows
- C++ instructions (
1,600) + Python code instructions (1,200) + Bilingual chat (900 RU + 600 EN = 1,500) + Bespoke-Stratos-17k reasoning traces (1,200)
- Exact Stage 1 Sample Count:
560 + 1,600 + 1,200 + 1,500 + 1,200 = 6,060 raw rows -> 97% / 3% train/val split (5,878 / 182) -> strict len(input_ids) <= 1,536 filter removed 8 train + 1 val overlength rows -> 5,870 train / 181 val (missing_eos = 0, zero mid-response truncation)
bs=1, grad_accum=16, cosine lr=2.5e-5
- Stage 2 — Targeted
<think> Token & C++20 Calibration (100 optimizer steps, val_loss = 0.5852):
imgui_v4_clean expanded by +10 headless Dear ImGui 1.93.1 modules (57 × 2 = 114 EN/RU + 179 C++20 algorithms + 7 compact UI = 300 rows, weighted ×1) + C++ (350) + Python (250) + EN/RU chat (300) + concise <think> set (450 = 40 curated EN/RU pairs + 410 <= 1,150-token traces from Bespoke-Stratos-17k)
- Exact Stage 2 Sample Count:
300 + 350 + 250 + 300 + 450 = 1,650 raw rows -> 97% / 3% split -> 1,600 train / 50 val (0 filtered out, missing_eos = 0)
- Gentle LoRA (
lr=8e-6) + dedicated FP32 2-row embedding/LM-head optimization (--train-think-tokens, lr=2e-3 on <think> / </think>)
- Hardware & Runtime: AMD Radeon RX 9060 XT (16 GiB VRAM), Windows 11, PyTorch
2.9.1+rocm7.13 with Chunked Cross-Entropy Loss and AOTriton efficient SDPA attention
Training Data & Upstream Licenses
Limitations
- Complex multi-file architecture, custom draw-list rendering, dynamic font-atlas textures, and multi-component project tasks remain challenging for 4B-parameter models (see EIPB category table above).
- Under pure greedy decoding (
temperature=0.0, no repetition penalty), 12/100 long UI prompts still hit the 2,048-token cap before closing their code block (88/100 extracted vs 96/100 for Base); use the recommended Qwen3 sampling (temperature=0.7, top_p=0.8, top_k=20) in interactive use.
- Target Dear ImGui API knowledge is aligned with
1.93.1 (IMGUI_DISABLE_OBSOLETE_FUNCTIONS).
- While merged model weights are released under
Apache-2.0 matching Qwen/Qwen3-4B-Instruct-2507, one subset component (iamtarun/python_code_instructions_18k_alpaca) does not specify a license field in its Hugging Face card metadata.
Acknowledgments
Built on top of Qwen/Qwen3-4B-Instruct-2507, bespokelabs/Bespoke-Stratos-17k, and the Europa ImPlus BenchMark (EIPB) / Dear ImGui (1.93.1) ecosystem.
Support
If you find Qim-4B useful and want to support future releases and benchmarks:
Table with columns: Network, Address| Network | Address |
|---|
| ETH | 0x9e708ebD5A80867002Bb2e8d5901d50B192E5cc3 |
| BTC | bc1q5762nneqpkjza5v37lwgjmfm3y3m4gu6td6kpc |
| SOL | Ez2VDw5cAz3HGNvhVifRisJ39doebUWELBwm6Hc7rThJ |
| TRON (TRC20) | TEPG7QPjZF2vjAdNn6DN9wUcpSBn2UiSS2 |
| POLYGON | 0x9e708ebD5A80867002Bb2e8d5901d50B192E5cc3 |