PO

PowerInfer/SmallThinker-4BA0.6B-Instruct

Model

62

stars

27

commits

1

repos using this model

3

linked in READMEs

Jul 31, 2025

updated

conversational
custom_code
feature-extraction
safetensors
smallthinker
text-generation
transformers

README

SmallThinker: A Family of Efficient Large Language Models Natively Trained for Local Deployment

Paper: SmallThinker: A Family of Efficient Large Language Models Natively Trained for Local Deployment Code: https://github.com/SJTU-IPADS/SmallThinker Project Page: https://powerinfer.ai/

Abstract

While frontier large language models (LLMs) continue to push capability boundaries, their deployment remains confined to GPU-powered cloud infrastructure. We challenge this paradigm with SmallThinker, a family of LLMs natively designed - not adapted - for the unique constraints of local devices: weak computational power, limited memory, and slow storage. Unlike traditional approaches that mainly compress existing models built for clouds, we architect SmallThinker from the ground up to thrive within these limitations. Our innovation lies in a deployment-aware architecture that transforms constraints into design principles. First, We introduce a two-level sparse structure combining fine-grained Mixture-of-Experts (MoE) with sparse feed-forward networks, drastically reducing computational demands without sacrificing model capacity. Second, to conquer the I/O bottleneck of slow storage, we design a pre-attention router that enables our co-designed inference engine to prefetch expert parameters from storage while computing attention, effectively hiding storage latency that would otherwise cripple on-device inference. Third, for memory efficiency, we utilize NoPE-RoPE hybrid sparse attention mechanism to slash KV cache requirements. We release SmallThinker-4B-A0.6B and SmallThinker-21B-A3B, which achieve state-of-the-art performance scores and even outperform larger LLMs. Remarkably, our co-designed system mostly eliminates the need for expensive GPU hardware: with Q4_0 quantization, both models exceed 20 tokens/s on ordinary consumer CPUs, while consuming only 1GB and 8GB of memory respectively. SmallThinker is publicly available at this http URL and this http URL .

Introduction

  🤗 Hugging Face   |   🤖 ModelScope   |    📑 Technical Report   

SmallThinker is a family of on-device native Mixture-of-Experts (MoE) language models specially designed for local deployment, co-developed by the IPADS and School of AI at Shanghai Jiao Tong University and Zenergize AI. Designed from the ground up for resource-constrained environments, SmallThinker brings powerful, private, and low-latency AI directly to your personal devices, without relying on the cloud.

Performance

Note: The model is trained mainly on English.

ModelMMLUGPQA-diamondGSM8KMATH-500IFEVALLIVEBENCHHUMANEVALAverage
SmallThinker-4BA0.6B-Instruct66.1131.3180.0260.6069.6942.2082.3261.75
Qwen3-0.6B43.3126.7762.8545.658.4123.131.7141.67
Qwen3-1.7B64.1927.7881.8863.669.5035.6061.5957.73
Gemma3nE2b-it63.0420.282.3458.673.227.9064.6355.70
Llama-3.2-3B-Instruct64.1524.2475.514071.1615.3055.4949.41
Llama-3.2-1B-Instruct45.6622.731.6714.448.0613.5037.2026.17

For the MMLU evaluation, we use a 0-shot CoT setting.

All models are evaluated in non-thinking mode.

Speed

ModelMemory(GiB)i9 149001+13 8gen4rk3588 (16G)rk3576Raspberry PI 5RDK X5rk3566
SmallThinker 4B+sparse ffn +sparse lm_head2.24108.1778.9939.7615.1028.777.236.33
SmallThinker 4B+sparse ffn +sparse lm_head+limited memorylimit 1G29.9920.9115.042.600.750.670.74
Qwen3 0.6B0.6148.5694.9145.9315.2927.4413.329.76
Qwen3 1.7B1.362.2441.0020.296.0911.086.354.15
Qwen3 1.7B+limited memorylimit 1G2.661.091.000.47--0.11
Gemma3n E2B1G, theoretically36.8827.0612.503.806.663.802.45

Note: i9 14900, 1+13 8ge4 use 4 threads, others use the number of threads that can achieve the maximum speed. All models here have been quantized to q4_0.

You can deploy SmallThinker with offloading support using PowerInfer

Model Card

ArchitectureMixture-of-Experts (MoE)
Total Parameters4B
Activated Parameters0.6B
Number of Layers32
Attention Hidden Dimension1536
MoE Hidden Dimension (per Expert)768
Number of Attention Heads12
Number of Experts32
Selected Experts per Token4
Vocabulary Size151,936
Context Length32K
Attention MechanismGQA
Activation FunctionReGLU

How to Run

Transformers

transformers==4.53.3 is required, we are actively working to support the latest version. The following contains a code snippet illustrating how to use the model generate content based on given inputs.

from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

path = "PowerInfer/SmallThinker-4BA0.6B-Instruct"
device = "cuda"

tokenizer = AutoTokenizer.from_pretrained(path, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(path, torch_dtype=torch.bfloat16, device_map=device, trust_remote_code=True)

messages = [
    {"role": "user", "content": "Give me a short introduction to large language model."},
]
model_inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True).to(device)

model_outputs = model.generate(
    model_inputs,
    do_sample=True,
    max_new_tokens=1024
)

output_token_ids = [
    model_outputs[i][len(model_inputs[i]):] for i in range(len(model_inputs))
]

responses = tokenizer.batch_decode(output_token_ids, skip_special_tokens=True)[0]
print(responses)

ModelScope

ModelScope adopts Python API similar to (though not entirely identical to) Transformers. For basic usage, simply modify the first line of the above code as follows:

from modelscope import AutoModelForCausalLM, AutoTokenizer

Statement

  • Due to the constraints of its model size and the limitations of its training data, its responses may contain factual inaccuracies, biases, or outdated information.
  • Users bear full responsibility for independently evaluating and verifying the accuracy and appropriateness of all generated content.
  • SmallThinker does not possess genuine comprehension or consciousness and cannot express personal opinions or value judgments.

Contributors

YS
Yixin Song

15 commits

wdl339

3 commits

BLGS

2 commits

PO

PowerInfer/SmallThinker-4BA0.6B-Instruct

Model

62

stars

27

commits

1

repos using this model

3

linked in READMEs

Jul 31, 2025

updated

conversational
custom_code
feature-extraction
safetensors
smallthinker
text-generation
transformers

README

SmallThinker: A Family of Efficient Large Language Models Natively Trained for Local Deployment

Paper: SmallThinker: A Family of Efficient Large Language Models Natively Trained for Local Deployment Code: https://github.com/SJTU-IPADS/SmallThinker Project Page: https://powerinfer.ai/

Abstract

While frontier large language models (LLMs) continue to push capability boundaries, their deployment remains confined to GPU-powered cloud infrastructure. We challenge this paradigm with SmallThinker, a family of LLMs natively designed - not adapted - for the unique constraints of local devices: weak computational power, limited memory, and slow storage. Unlike traditional approaches that mainly compress existing models built for clouds, we architect SmallThinker from the ground up to thrive within these limitations. Our innovation lies in a deployment-aware architecture that transforms constraints into design principles. First, We introduce a two-level sparse structure combining fine-grained Mixture-of-Experts (MoE) with sparse feed-forward networks, drastically reducing computational demands without sacrificing model capacity. Second, to conquer the I/O bottleneck of slow storage, we design a pre-attention router that enables our co-designed inference engine to prefetch expert parameters from storage while computing attention, effectively hiding storage latency that would otherwise cripple on-device inference. Third, for memory efficiency, we utilize NoPE-RoPE hybrid sparse attention mechanism to slash KV cache requirements. We release SmallThinker-4B-A0.6B and SmallThinker-21B-A3B, which achieve state-of-the-art performance scores and even outperform larger LLMs. Remarkably, our co-designed system mostly eliminates the need for expensive GPU hardware: with Q4_0 quantization, both models exceed 20 tokens/s on ordinary consumer CPUs, while consuming only 1GB and 8GB of memory respectively. SmallThinker is publicly available at this http URL and this http URL .

Introduction

  🤗 Hugging Face   |   🤖 ModelScope   |    📑 Technical Report   

SmallThinker is a family of on-device native Mixture-of-Experts (MoE) language models specially designed for local deployment, co-developed by the IPADS and School of AI at Shanghai Jiao Tong University and Zenergize AI. Designed from the ground up for resource-constrained environments, SmallThinker brings powerful, private, and low-latency AI directly to your personal devices, without relying on the cloud.

Performance

Note: The model is trained mainly on English.

ModelMMLUGPQA-diamondGSM8KMATH-500IFEVALLIVEBENCHHUMANEVALAverage
SmallThinker-4BA0.6B-Instruct66.1131.3180.0260.6069.6942.2082.3261.75
Qwen3-0.6B43.3126.7762.8545.658.4123.131.7141.67
Qwen3-1.7B64.1927.7881.8863.669.5035.6061.5957.73
Gemma3nE2b-it63.0420.282.3458.673.227.9064.6355.70
Llama-3.2-3B-Instruct64.1524.2475.514071.1615.3055.4949.41
Llama-3.2-1B-Instruct45.6622.731.6714.448.0613.5037.2026.17

For the MMLU evaluation, we use a 0-shot CoT setting.

All models are evaluated in non-thinking mode.

Speed

ModelMemory(GiB)i9 149001+13 8gen4rk3588 (16G)rk3576Raspberry PI 5RDK X5rk3566
SmallThinker 4B+sparse ffn +sparse lm_head2.24108.1778.9939.7615.1028.777.236.33
SmallThinker 4B+sparse ffn +sparse lm_head+limited memorylimit 1G29.9920.9115.042.600.750.670.74
Qwen3 0.6B0.6148.5694.9145.9315.2927.4413.329.76
Qwen3 1.7B1.362.2441.0020.296.0911.086.354.15
Qwen3 1.7B+limited memorylimit 1G2.661.091.000.47--0.11
Gemma3n E2B1G, theoretically36.8827.0612.503.806.663.802.45

Note: i9 14900, 1+13 8ge4 use 4 threads, others use the number of threads that can achieve the maximum speed. All models here have been quantized to q4_0.

You can deploy SmallThinker with offloading support using PowerInfer

Model Card

ArchitectureMixture-of-Experts (MoE)
Total Parameters4B
Activated Parameters0.6B
Number of Layers32
Attention Hidden Dimension1536
MoE Hidden Dimension (per Expert)768
Number of Attention Heads12
Number of Experts32
Selected Experts per Token4
Vocabulary Size151,936
Context Length32K
Attention MechanismGQA
Activation FunctionReGLU

How to Run

Transformers

transformers==4.53.3 is required, we are actively working to support the latest version. The following contains a code snippet illustrating how to use the model generate content based on given inputs.

from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

path = "PowerInfer/SmallThinker-4BA0.6B-Instruct"
device = "cuda"

tokenizer = AutoTokenizer.from_pretrained(path, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(path, torch_dtype=torch.bfloat16, device_map=device, trust_remote_code=True)

messages = [
    {"role": "user", "content": "Give me a short introduction to large language model."},
]
model_inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True).to(device)

model_outputs = model.generate(
    model_inputs,
    do_sample=True,
    max_new_tokens=1024
)

output_token_ids = [
    model_outputs[i][len(model_inputs[i]):] for i in range(len(model_inputs))
]

responses = tokenizer.batch_decode(output_token_ids, skip_special_tokens=True)[0]
print(responses)

ModelScope

ModelScope adopts Python API similar to (though not entirely identical to) Transformers. For basic usage, simply modify the first line of the above code as follows:

from modelscope import AutoModelForCausalLM, AutoTokenizer

Statement

  • Due to the constraints of its model size and the limitations of its training data, its responses may contain factual inaccuracies, biases, or outdated information.
  • Users bear full responsibility for independently evaluating and verifying the accuracy and appropriateness of all generated content.
  • SmallThinker does not possess genuine comprehension or consciousness and cannot express personal opinions or value judgments.

Contributors

YS
Yixin Song

15 commits

wdl339

3 commits

BLGS

2 commits