Qim-5B
Qim-5B is a 4.83B (44-layer) bilingual (English & Russian) coding, reasoning, and UI architecture model scaled from Antinimus/Qim-4B / Qwen/Qwen3-4B-Instruct-2507 with a focus on C++20, Dear ImGui (1.93.1, IMGUI_DISABLE_OBSOLETE_FUNCTIONS), C++ UI design & architecture, mathematics & step-by-step logic, and on-demand <think>...</think> reasoning.
Created by Antinimus.
- Architecture & Scaling: Expanded from
36to44transformer layers (4.83Bparameters, GQA32Q / 8KV, hidden size2560) via identity-preserving block expansion (8zero-initialized residual layers) followed by multi-stage SFT and preference alignment. - Weights Format: Standalone merged BF16 weights (
model.safetensors, with the LoRA adapters and calibrated<think>/</think>embedding & LM-head rows already merged — no separate LoRA loading required). All GGUF files are quantized directly from these merged BF16 weights. - Context Length:
262,144tokens (256K) native context window (max_position_embeddings: 262144,rope_theta: 5,000,000inconfig.json; SFT training sequence cutoff:1,536tokens; benchmark evaluation generation limit:1,024tokens).
Highlights
- New Best Score in the Qim Series on Europa ImPlus BenchMark (EIPB): Achieves
8 / 100solved (8.0% pass@1),5.18%Strict EIPB Score, and7.94%Partial EIPB Score, surpassingAntinimus/Qim-4B(7 / 100solved,4.66%Strict,7.69%Partial) andQwen/Qwen3-4B-Instruct-2507(4 / 100solved,2.59%Strict,5.79%Partial). - 3× Improvement in
Architecture C++& 2× inDebugging: Solved[073] RAII wrappers with correct Begin/End semantics(2/2) and improvedArchitecture C++partial score from2.3%to6.9%,Debuggingfrom3.1%to6.2%, andInput & Popupsfrom7.5%to10.8%. - Balanced 30/30/30/10 Capability Mix: Trained on a curated 20,000-sample mix (
30%Dear ImGui1.93.1UI & custom styles,30%math & step-by-step logic,30%C++20 & architecture/bug-fix,10%bilingual RU/EN chat) plus compiler-verified preference alignment, preserving Russian & English fluency without catastrophic forgetting. - Verified GGUF Quantizations: Standalone merged
Q4_K_M,Q5_K_M, andQ8_0GGUF builds tested end-to-end withllama.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 formedium, 3 forhard), 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/Qim models were evaluated with greedy decoding (temperature=0.0).
Overall Comparison (Local WinLibs GCC 16.2.0 Harness)
| 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% |
Antinimus/Qim-4B | Local BF16 (temp=0.0, WinLibs GCC 16.2.0) | 42 / 100 | 7 / 100 (7.0%) | 4.66% | 7.69% |
Qim-5B (Ours) | Local BF16 (temp=0.0, WinLibs GCC 16.2.0) | 30 / 100 | 8 / 100 (8.0%) | 5.18% | 7.94% |
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.5reference 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 sameClaude Opus 5.5answers scored100/100compiled,97/100solved,97.41%strict,98.88%partial).
Per-Category Breakdown (Partial% (Strict%, Solved))
Category (Tasks / Max Pts) | Qim-1.5B | Qwen3-4B-Instruct-2507 (Base) | Qim-4B | Qim-5B (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) | 36.8% (26.3%, 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) | 10.8% (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) | 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) | 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) | 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) | 6.9% (6.9%, 1/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) | 6.2% (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) | 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:
| File | Quant | Size | Verified Speed (RX 9060 XT Vulkan) | Notes |
|---|---|---|---|---|
gguf/Qim-5B-Q4_K_M.gguf | Q4_K_M | 2.78 GiB (2,980,006,816 B) | ~78.5 t/s | Compact 4-bit build for fast local inference |
gguf/Qim-5B-Q5_K_M.gguf | Q5_K_M | 3.22 GiB (3,459,402,656 B) | ~73.8 t/s | Recommended balance of speed and coding/reasoning quality |
gguf/Qim-5B-Q8_0.gguf | Q8_0 | 4.79 GiB (5,138,447,776 B) | ~53.3 t/s | Near-lossless 8-bit quantization |
Quickstart
transformers (Standalone Merged BF16)
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "Antinimus/Qim-5B"
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": "Implement a clean Dear ImGui 1.93.1 settings panel with RAII style guards."},
]
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 ggml-org/llama.cpp (Releases).
CLI single-turn inference:
llama-cli -m Qim-5B-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:
llama-server -hf Antinimus/Qim-5B: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-5B --port 9931
Docker Model Runner (GGUF)
docker model run hf.co/Antinimus/Qim-5B:Q5_K_M
Training Details
- Architecture Scaling: Expanded from
36layers (4.06B) to44layers (4.83B) via identity-preserving block expansion (zero-initializedo_proj/down_projon8inserted blocks). - Method & Merging: Multi-stage LoRA (
r=32,alpha=64,rslora,80,740,352trainable params /1.6442%) with focal token weighting, anti-forgetting replay, and compiler-verified preference alignment, merged directly intobfloat16(model.safetensors). - Data Curation:
- AST-parsed & MinHash-deduplicated Dear ImGui UI/styling components upgraded to
1.93.1+ compiler-error self-correction trajectories,ocornut/imguibug-fix commits, andinterface.h→impl.cpparchitectural tasks. - Balanced
30/30/30/10mix across Dear ImGui1.93.1, math/logic (gsm8k-ru,gsm8k, structured<think>levels), C++20/architecture, and bilingual RU/EN chat (GrandMaster-PRO-MAX,ultrachat_200k).
- AST-parsed & MinHash-deduplicated Dear ImGui UI/styling components upgraded to
- Hardware & Runtime: AMD Radeon RX 9060 XT (16 GiB VRAM), Windows 11, PyTorch
2.9.1+rocm7.13with layer streaming and AOTriton efficient SDPA attention.
Limitations
- Complex
ImDrawListcustom rendering, dynamic font-atlas textures, and large multi-component projects remain challenging at 5B scale. - Target Dear ImGui API knowledge is aligned with
1.93.1(IMGUI_DISABLE_OBSOLETE_FUNCTIONS).
Acknowledgments
Built on top of Antinimus/Qim-4B, Qwen/Qwen3-4B-Instruct-2507, and the Europa ImPlus BenchMark (EIPB) / Dear ImGui (1.93.1) ecosystem.
Support
If you find Qim-5B useful and want to support future releases and benchmarks:
| Network | Address |
|---|---|
| ETH | 0x9e708ebD5A80867002Bb2e8d5901d50B192E5cc3 |
| BTC | bc1q5762nneqpkjza5v37lwgjmfm3y3m4gu6td6kpc |
| SOL | Ez2VDw5cAz3HGNvhVifRisJ39doebUWELBwm6Hc7rThJ |
| TRON (TRC20) | TEPG7QPjZF2vjAdNn6DN9wUcpSBn2UiSS2 |
| POLYGON | 0x9e708ebD5A80867002Bb2e8d5901d50B192E5cc3 |