Qwen-Compiler-Mind-4B

Architects: Tri (@Trivnpk) & Ritmada (@RitmadaPrompt)
Base Model: empero-ai/Qwen3.8-4B-Distill (4.3B Parameters · 32 Layers · Hidden Dimension 2560)
Calibrated Ground Zero: Layer 26 / 32


⚡ Quick Start: 1-Click Ollama Deployment

This repository provides quantized GGUF weights ready for Ollama, llama.cpp, and LM Studio:

Artifact Size Description / Target
qwen-compiler-mind-4b-Q6_K.gguf ~2.8 GB Recommended Sweet Spot: 99.5% FP16 accuracy, fast inference on PC/Mac.
qwen-compiler-mind-4b-Q4_K_M.gguf ~2.1 GB Lightweight RAM-optimized build for mobile and lower-spec laptops.
qwen-compiler-mind-4b-Q8_0.gguf ~3.6 GB Reference benchmark precision.

Run with Ollama:

# Clone the repository files
git clone https://huggingface.co/Trivnpk/Qwen-Compiler-Mind-4B
cd Qwen-Compiler-Mind-4B

# Create and run the model in Ollama
ollama create qwen-compiler-mind -f Modelfile
ollama run qwen-compiler-mind

🏛️ Isomorphic Latent Compensation (PyTorch Bundle)

In addition to GGUF artifacts, this repository includes the calibrated representation steering bundle: qwen_isomorphic_bundle.pt (calibrated at Layer 26).

The Law of Isomorphic Latent Compensation:

"Qwen là mô hình của Trung Quốc — Xóa cái gì bắt buộc phải bù đắp ngay cái đó!"

Instead of hard zeroing (which tears the activation manifold and breaks RMSNorm scaling), this engine applies Soft Margin Attenuation ($\tau$) + Cross-Domain Energy Rebalancing:

hbalanced=h−Δαrr^+(γΔαr)v^compiler_rigor−Δαzhv^zh+(ηΔαzh)v^en_vih_{\text{balanced}} = h - \Delta \alpha_r \hat{r} + (\gamma \Delta \alpha_r) \hat{v}_{\text{compiler\_rigor}} - \Delta \alpha_{\text{zh}} \hat{v}_{\text{zh}} + (\eta \Delta \alpha_{\text{zh}}) \hat{v}_{\text{en\_vi}}

accompanied by strict $L_2$ Norm Conservation:

xout=(x+Δ)⋅∥x∥2+ϵ∥x+Δ∥2+ϵx_{\text{out}} = (x + \Delta) \cdot \frac{\|x\|_2 + \epsilon}{\|x + \Delta\|_2 + \epsilon}

  1. Rút Phản Xạ Từ Chối $\to$ Bù Kỷ Luật Kỹ Sư Hệ Thống (-Werror): Chuyển hóa vector từ chối kiểm duyệt thành tính khắt khe của compiler (ép kiểu an toàn size_t, bắt lỗi DMA, dọn dẹp LIFO).
  2. Rút Lực Kéo Hán Tự $\to$ Bù Giàn Giáo Kỹ Thuật Anh-Việt: Neo giữ chuỗi suy luận bằng tiếng Anh POSIX và tiếng Việt kỹ thuật đời sống.
  3. Bảo Toàn Chuẩn $L_2$: Khóa chặt scale RMSNorm, ngăn chặn triệt để nổ logits.

Radar Localization Ground Zero:

  • Đỉnh Từ Chối (Refusal Ground Zero): Layer 26 (Cường độ: 15.4400)
  • Đỉnh Tiếng Trung (Chinese Ground Zero): Layer 26 (Cường độ: 13.8238)

Python Inference with Hook Adapter:

import torch
from apply_transmutation import load_transmuted_qwen

model, tokenizer = load_transmuted_qwen(
    base_repo="empero-ai/Qwen3.8-4B-Distill",
    bundle_path="qwen_isomorphic_bundle.pt"
)

prompt = "Viết hàm C khởi tạo driver: acquire lock -> map DMA -> register IRQ. Nếu bước 3 lỗi, phải dọn dẹp theo đúng thứ tự LIFO."
formatted_input = f"<|im_start|>user\n{prompt}<|im_end|>\n<|im_start|>assistant\n<think>\n"

inputs = tokenizer(formatted_input, return_tensors="pt").to(model.device)
with torch.no_grad():
    outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.1, do_sample=False)

print(tokenizer.decode(outputs[0], skip_special_tokens=False))

📁 Repository File Structure

  • qwen-compiler-mind-4b-Q6_K.gguf: Primary GGUF quantized model.
  • qwen-compiler-mind-4b-Q4_K_M.gguf: 4-bit medium quantized model.
  • qwen-compiler-mind-4b-Q8_0.gguf: 8-bit quantized model.
  • Modelfile: Ready-to-use Ollama configuration template.
  • compiler_mind.gbnf: Grammar file for deterministic compiler-grade code generation.
  • qwen_isomorphic_bundle.pt: Representation engineering tensors (Layer 26).
  • apply_transmutation.py: Dynamic PyTorch forward hook loader.
Downloads last month
173
Safetensors
Model size
4B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Trivnpk/Qwen-Compiler-Mind-4B

Finetuned
Qwen/Qwen3.5-4B
Quantized
(30)
this model