What is Nanbeige4.2-3B
Nanbeige4.2-3B is a general-purpose Agent small model released by BOSS Zhipin's Nanbeige Lab. With only 3B parameters, it surpasses larger models such as Qwen3.5-9B and Gemma4-12B on Agent tasks including code agents, office workflows, and complex tool calling. The model adopts a Looped Transformer architecture to improve effective capacity, builds a closed-loop synthesis pipeline for three types of Agent data: code, tools, and office. Through three-stage curriculum SFT and multi-stage RL training, it maintains strong Agent capabilities while reducing inference costs. It has been open-sourced and adapted to multiple inference engines.
Main Features of Nanbeige4.2-3B
-
Code Agent: Supports browsing real code repositories, locating issues, completing modifications, and running verification, covering the entire software engineering workflow.
-
Office Agent: The model can handle cross-format files such as documents, spreadsheets, slides, and PDFs, and supports multi-file dependencies and long-process office workflows.
-
Complex Tool Calling: Supports chained calls and parameter inference for MCP online services, local Python tools, and virtual tools.
-
General Reasoning: Covers mathematics, code, and scientific reasoning, achieving best-in-class results at the same scale on evaluations such as GPQA Diamond and HMMT.
-
Local Personal Assistant: Possesses multi-turn planning, file processing, and error recovery capabilities, and can be deployed as a local Agent assistant with a low barrier to entry.
Technical Principles of Nanbeige4.2-3B
-
Looped Transformer Architecture: The model's hidden state, after passing through all Transformer layers, is sent back to the same set of layers for a second round of computation, improving effective computational depth without increasing the number of parameters. It has been verified that looping twice is optimal between effectiveness and stability, and KV Cache is not shared to prioritize effectiveness.
-
Pre-training Data Upsampling: The corpus was expanded from 23T to 28T tokens, with aggressive upsampling of mathematics, code, and synthetic QA data, enabling the small model to comprehensively lead same-scale base models on reasoning and knowledge evaluations.
-
Agent Data Closed-Loop Synthesis: For the code agent, a "training—failure analysis—data supplementation" flywheel is built; for tool calling, three types of environments are designed: real MCP, local Python, and virtual tools, with difficulty evolving alongside model capabilities; for the office agent, a closed-loop feedback of material clustering, task generation, and output collection is established.
-
Three-Stage Curriculum SFT: The proportion of Agent data is gradually increased from 64K to 128K to 256K. Loss Mask is set for error rounds to retain error context without learning erroneous actions, enabling the model to learn to correct tasks on real error histories.
-
Multi-Stage RL Recipe: First, two-stage RLHF of Think/Non-Think stabilizes generation quality; then Reasoning RL with length control reduces invalid tokens on simple questions; finally, Outcome Reward and Action-Centric Rubric are combined for Agentic RL, selecting tasks with shorter trajectories and existing success rates for training to improve stability.
Follow WeChat and reply "Open Source" to join theAI Open Source Project Exchange Group
How to Use Nanbeige4.2-3B
- Obtain Model Weights: Download the weight files of the Agent model (Nanbeige4.2-3B) or the Base model (Nanbeige4.2-3B-Base) from Hugging Face.
- Choose an Inference Engine: Load the model with adapted engines such as Transformers, SGLang, vLLM, llama.cpp, or Ollama. The 3B parameter count has low hardware requirements, making it suitable for deployment on local PCs or edge devices.
- Switch inference modes: Choose Think mode for deep reasoning based on task complexity, or Non-Think mode for fast responses. The two modes can be switched flexibly.
- Integrate with Agent frameworks: Connect the model to Agent frameworks such as OpenClaw, configure external tools and Scaffold, and execute multi-step coding, office, or research tasks.
Core advantages of Nanbeige4.2-3B
-
Small parameters, large capability: With 3B parameters, it steadily surpasses 9B/12B-level models on Agent tasks, greatly reducing inference costs in high-frequency call scenarios.
-
Architectural innovation: It adopts a Looped Transformer to squeeze effective capacity under fixed parameters, achieving about 75% token efficiency gains compared with a standard Transformer.
-
Data flywheel: All three types of Agent data build closed-loop feedback and difficulty evolution mechanisms, so training data improves in sync with model capability rather than stagnating.
-
Fine-grained training: SFT error masking preserves erroneous context but does not learn erroneous actions, while the multi-stage RL recipe balances accuracy improvement and output length reduction.
-
Low-barrier deployment: It has been adapted to mainstream inference engines and supports Think/Non-Think dual modes, making it suitable for local deployment and cost-sensitive scenarios.
Project addresses of Nanbeige4.2-3B
- HuggingFace model library:
- https://huggingface.co/Nanbeige/Nanbeige4.2-3B
- https://huggingface.co/Nanbeige/Nanbeige4.2-3B-Base
- Technical paper:https://huggingface.co/Nanbeige/Nanbeige4.2-3B/blob/main/Nanbeige42_report.pdf
Comparison of Nanbeige4.2-3B with similar competing products
| Comparison dimension | Nanbeige4.2-3B | Qwen3.5-4B |
|---|---|---|
| Non-Embedding parameter count | 3B | 4B |
| General Agent(PinchBench-V2) | 74.7 | 63.9 |
| Code Agent(SWE-Bench Verified) | 63.6 | 38.8 |
| Office tasks (GDPval) | 68.8 | 37.0 |
| Reasoning capability (GPQA) | 53.3 | 43.1 |
| Architectural features | Looped Transformer | Standard Transformer |
| Deployment threshold | Lower, adapts to multiple engines | Standard deployment |
Application scenarios of Nanbeige4.2-3B
-
Local code development: Execute software engineering tasks such as code repository browsing, bug fixing, and patch verification in the developer's local environment.
-
Office workflow automation: Automatically process documents, spreadsheets, and slides across formats, completing data organization, report generation, and format conversion.
-
Intelligent tool orchestration service: Call online services and local tools through the MCP protocol to implement information retrieval, data analysis, and multi-step task orchestration.
-
Personal assistant on edge devices: Deploy on local devices such as PCs or NAS as a low-latency, privacy-controllable general-purpose Agent assistant.
-
Core engine for high-frequency Agent systems: Replace large models in complex Agent systems that require dozens to hundreds of model calls, significantly reducing operating costs.