This is a Nanbeige4.2-3B fine-tune, produced through P-E-W's Heretic (v1.4.0) abliteration engine with Arbitrary-Rank Ablation and Row Normalisation enabled.
Note: The final trial selection was made based on PiQA scores.
Nanbeige4.2-3B is a compact agentic model built on Nanbeige4.2-3B-Base, designed to combine strong agentic behavior with broad reasoning and alignment capabilities. Its Looped Transformer architecture reuses the transformer layers to increase model capacity without adding parameters. With only 3B non-embedding parameters, the model delivers solid performance on general-agent and code-agent tasks.
During supervised fine-tuning (SFT), we expand the diversity of training environments through real-world environment integrations and large-scale environment synthesis. We further diversify task types, task assets, and the agentic scaffolds used for each task. To ensure training data quality, we apply filtering at both the trajectory and turn levels, combining test-case-based validation with rubric-based assessment. During reinforcement learning (RL), we combine outcome and process rewards to improve training stability for the compact model.
Key strengths include:
Solid Agentic Behavior at the 3B Scale: Across complex tool-use, office-agent, and code-agent benchmarks, Nanbeige4.2-3B outperforms larger models such as Qwen3.5-9B and Gemma4-12B.
Strong Reasoning Capabilities: Nanbeige4.2-3B leads open-source models of comparable size across mathematical, coding, and scientific reasoning tasks, continuing the strong reasoning performance of Nanbeige4.1-3B.
Local Personal Assistant: When integrated with an agentic scaffold designed for personal workflows (e.g., OpenClaw), Nanbeige4.2-3B can support extended tasks spanning daily assistance, office work, and deep research.
The accompanying modeling_nanbeige.py also includes our latest architectural improvements, including LoopSplit, mHC with depth attention, and concatenated n-gram embeddings. These features have been incorporated into Nanbeige4.5, whose training is underway for release later in 2026.
2. Model Performance
General and Agentic Capabilities
We compare Nanbeige4.2-3B with Qwen3.5 and Gemma4 models across a diverse benchmark suite covering general agents, code agents, reasoning, and alignment capabilities.
-
-
Nanbeige4.2-3B1
Qwen3.5-9B
Qwen3.5-4B
Gemma4-12B
Gemma4-E4B
Parameters
Total Params
4B
10B
5B
12B
8B
Non-embedding Params
3B
8B
4B
10B
4B
General Agent2
GDPval rubrics
74.3
61.9
46.7
68.5
31.5
Agent-IF-Oneday
67.5
60.4
56.9
—
—
Office-QA-Pro3
21.1
15.8
8.3
15.3
3.1
Pinch-Bench-V2
74.7
68.2
63.9
53.8
33.3
Claw-Gym
65.0
56.1
53.0
40.8
16.4
Claw-Evalpass^3
52.2
47.1
36.9
25.5
15.9
MCP-Atlas
57.8
47.4
40.8
30.5
15.0
Code Agent4
SWE-Bench Verified
63.6
53.1
38.8
44.2
14.0
SWE-Bench Pro
46.9
33.8
29.4
21.9
4.0
Terminal-Bench 2.0
44.1
29.2
25.8
21.1
12.4
Reasoning
HLE w/o Search
17.8
12.5
6.8
14.8
4.0
SciCode
35.6
32.7
22.7
38.2
24.9
GPQA-Diamond
87.4
81.7
78.2
78.8
60.6
HMMT-Feb-2026
82.8
69.6
60.6
51.5
24.2
IMO-Answer-Bench
67.3
56.3
46.8
54.5
24.0
LiveCodeBench-V6
72.5
65.6
55.8
72.0
55.3
Alignment
AA-LCR
58.7
58.0
52.0
55.3
30.7
IF-Bench
54.6
54.1
41.4
73.5
44.0
Recruit-Bench5
63.3
59.0
40.7
69.4
57.9
1 All evaluations are conducted in thinking mode with preserve_thinking=true in the chat template. 2 Office and co-work tasks such as GDPval, Office-QA-Pro, and Agent-IF-Oneday are evaluated with our in-house scaffold. 3 For OfficeQA-pro, we follow the most challenging evaluation setup: for each question, we provide all the original PDF materials without giving any hints about the relevant documents. 4 SWE-Bench Verified uses the OpenHands scaffold, SWE-Bench Pro uses the SWE-agent scaffold, and Terminal-Bench 2.0 uses the Terminus 2 scaffold. 5 Recruit-Bench is our in-house benchmark covering enterprise hiring scenarios (B2C) and job-seeking scenarios for candidates (C2B).
The results demonstrate that Nanbeige4.2-3B delivers strong performance well beyond its parameter scale. With only 3B non-embedding parameters, it consistently outperforms larger models, including Qwen3.5-9B and Gemma4-12B, across general-agent, code-agent, and reasoning benchmarks, while remaining competitive on alignment tasks.
Local Personal Assistant
With only 3B non-embedding parameters, Nanbeige4.2-3B is compact enough for local deployment while retaining the agentic capabilities needed for multi-step workflows, making it a natural fit for local personal-assistant applications. To assess this use case in a practical and consistent agent environment, we use OpenClaw, a general-purpose framework that supports daily assistance, office workflows, and deep research tasks. All compared models use the same framework and are evaluated on tasks requiring multi-step interaction with tools and external resources.
Capability
Benchmark
Nanbeige4.2-3B
Qwen3.5-9B
Qwen3.5-4B
Daily Tasks
Pinch-Bench-V2
74.7
68.2
63.9
Claw-Gym
65.0
56.1
53.0
Office Tasks
GDPval
68.8
38.0
37.0
Agent-IF-Oneday
58.9
32.1
27.0
Deep Research
DeepResearch Bench II
33.4
28.3
26.0
ResearchRubrics
44.8
37.2
35.1
Across all six benchmarks, Nanbeige4.2-3B outperforms both Qwen3.5-4B and the larger Qwen3.5-9B. These results support its use as a compact local personal assistant.
3. Quickstart
The tokenizer provides a configurable chat template for reasoning and tool-use scenarios:
enable_thinking controls whether the model generates reasoning for the current response. It is enabled by default; set it to False for non-thinking mode.
preserve_thinking controls whether reasoning from previous assistant turns is retained in a multi-turn conversation. We recommend False for general chat and question answering, and True for multi-turn tool use, office tasks, and code-agent workflows.
Passing tools enables the tool-use template. We recommend tool_call_format="xml" for the best tool-calling performance; json is also supported for compatibility.
The model supports a context length of up to 262,144 tokens (256K).
We recommend adjusting the inference settings according to the target scenario:
1# input: HuggingFace model directory2MODEL_PATH_HF=/path/to/your/Nanbeige4.2-3B
3# output: converted / quantized GGUF4MODEL_PATH_BF16_GGUF=/path/to/your/Nanbeige4.2-3B-BF16.gguf
5MODEL_PATH_GGUF_Q4_K_M=/path/to/your/Nanbeige4.2-3B-Q4_K_M.gguf
67# convert to gguf8python3 convert_hf_to_gguf.py ${MODEL_PATH_HF}\9 --outfile ${MODEL_PATH_BF16_GGUF}\10 --outtype bf16
1112# quantize to int413./build/bin/llama-quantize \14${MODEL_PATH_BF16_GGUF}\15${MODEL_PATH_GGUF_Q4_K_M}\16 Q4_K_M
1718# run inference19./build/bin/llama-cli \20 -m ${MODEL_PATH_GGUF_Q4_K_M}\21 -ngl 99
If you want to use LM Studio: the bundled llama-server does not support nanbeige yet, so do these two steps:
Put the GGUF under ~/.lmstudio/models/<org>/<name>/
Copy this llama.cpp build outputs into the LM Studio backend:
${LLAMA_CPP_PATH}/build/bin/* -> BACKEND (example: ~/.lmstudio/extensions/backends/llama.cpp-mac-arm64-apple-metal-advsimd-2.25.2)
1# Clone repository2# For llama-server (GGUF) backend only, the official ollama repo also works:3# git clone https://github.com/ollama/ollama.git4git clone -b nanbeige42 https://github.com/Nanbeige/ollama.git
5cd ollama
67# Full native build (MLX Metal on macOS arm64; llama-server payload included)8# Pick one:9cmake -B build .10cmake --build build --parallel $(sysctl -n hw.ncpu)# macOS11# cmake --build build --parallel $(nproc) # Linux1213# Copy the llama.cpp build output from the section above into Ollama's runtime payload dir14LLAMA_CPP_PATH=/path/to/your/llama.cpp
15cp -r ${LLAMA_CPP_PATH}/build/bin/* build/lib/ollama/
1617go build .
Ollama supports two local inference backends:
Path
Model format
Backend
Typical use
llama-server
GGUF
llama.cpp (Metal / CUDA / ...)
Traditional GGUF quantized deployment
MLX
HuggingFace safetensors
MLX (Apple Metal, etc.)
Run BF16 or quantized safetensors directly
Usage — llama-server (GGUF)
bash
1# Option 1: pull a published model (no Modelfile on the client)2./ollama serve
3./ollama run nanbeige/nanbeige4.2:3b-Q4_K_M
bash
1# Option 2: create from a local .gguf produced by llama.cpp2# (see convert_hf_to_gguf.py / llama-quantize above)3MODEL_PATH_GGUF_Q4_K_M=/path/to/your/Nanbeige4.2-3B-Q4_K_M.gguf
45# Modelfile6cat> Modelfile <<EOF
7FROM ${MODEL_PATH_GGUF_Q4_K_M}8PARAMETER temperature 0.6
9PARAMETER top_p 0.95
10PARAMETER top_k 20
11EOF1213./ollama serve
14./ollama create nanbeige42-local -f Modelfile
15./ollama run nanbeige42-local
Usage — MLX (safetensors)
bash
1# HuggingFace safetensors directory (config.json + *.safetensors), used directly.2# MLX Metal is for macOS arm64; Linux MLX needs a CUDA MLX backend build.3MODEL_PATH=/path/to/your/Nanbeige4.2-3B
45# Modelfile6cat> Modelfile <<EOF
7FROM ${MODEL_PATH}8RENDERER nanbeige
9PARSER nanbeige
10EOF1112# Start server (from repo root so it finds build/lib/ollama)13./ollama serve
1415# Import safetensors model (requires --experimental)16./ollama create nanbeige42-mlx -f Modelfile --experimental
1718# Optional: quantize on import (int4 / int8 / mxfp4 / mxfp8 / nvfp4)19./ollama create nanbeige42-mlx-q4 -f Modelfile --experimental --quantize int4
2021# Run22./ollama run nanbeige42-mlx-q4
4. Limitations
While we place great emphasis on model safety throughout the training process, the model may still generate unexpected or inappropriate outputs due to its probabilistic nature. Such outputs may include inaccurate information, bias, discrimination, or other harmful content. Please do not propagate such content. We do not assume responsibility for consequences of disseminating inappropriate information.
5. Citation
If you find our model useful or would like to use it in your own work, please cite as follows:
bibtex
1@article{lab2026nanbeige4,
2 title={Nanbeige4. 2-3B: Unlocking Agentic Capabilities in a Compact Mode},
3 author={Lab, Nanbeige and Yang, Chen and Huang, Chengrui and Lan, Fufeng and Chen, Hanhui and Zhou, Hao and Song, Huatong and Cao, Jiaqi and Zhu, Jiaying and Niu, Jinlin and others},
4 journal={arXiv preprint arXiv:2607.22083},
5 year={2026}
6}
6. Contact
If you have any questions, please open an issue in this repository or contact us at nanbeige@kanzhun.com.