Skip to content

A compact, unified multimodal model family with a single shared vision–language backbone, built for on-device and in-app intelligence.

README

Unified Pocket Models for In-App Multimodal Intelligence

WePocketModel (WePM)

Technical report (PDF) Hugging Face: WePocketModel License: Apache 2.0

WePM 1.0

Overview  ·  Get started  ·  Resources  |  中文 · English

News

Model Introduction

On-device AI applications rarely depend on a single capability. A personal assistant may need multimodal retrieval to find local content, generation to understand and respond, and decision making to route the next action. Deploying a separate specialist for each path duplicates vision encoders and language backbones, increasing resident memory, system complexity and the cost of keeping intelligence always available on device.

WePM is a unified multimodal model family with 2B and 4B variants, designed around a different principle: one compact vision–language backbone should support multiple capability families without sacrificing their individual quality. A single set of parameters provides:

  • Representation — L2-normalized multimodal embeddings for image retrieval, text retrieval and candidate ranking.
  • Generation — OCR, image captioning, visual question answering, summarization and assistant responses.
  • Decision — typed outputs for option selection, ordinal scoring and binary judgment.

In BF16, the shared 4B backbone occupies approximately 8 GB of weight memory. More importantly, it replaces several independently resident models with one common foundation for local multimodal applications.

WePM capabilities and applications

Reconciling Conflicts in a Unified Model

Simply mixing heterogeneous tasks does not make them compatible. WePM identifies conflicts at three levels: different tasks require different visual granularity, their datasets provide different forms of supervision, and their losses operate at different scales and training rhythms. WePM reconciles these conflicts with three complementary components:

  • MGVB (Multi-Granularity Visual Budgeting) organizes visual evidence into global, regional and fine-grained token banks under a fixed total visual-token budget. Regional and fine-grained selection is conditioned on available textual context, with a query-independent fallback when no text is provided, enabling complementary evidence across spatial scales.
  • ULKD (Unified Listwise Knowledge Distillation) supplements native generation and embedding supervision using two frozen capability-specific teachers. It combines on-policy token-level KL distillation along student-generated trajectories with candidate-list KL distillation and projected representation alignment, transferring complementary soft supervision into one shared student.
  • SEMO (Stable and Efficient Multitask Optimization) combines fixed task-loss weights with predefined task-exposure schedules to control each task’s contribution to the joint update. It executes sequential batch-wise forward/backward passes at unchanged model parameters, releasing each computation graph after backward and accumulating gradients before one joint optimizer update, preserving the specified joint gradient while reducing activation memory.

Together, these designs align visual evidence, learning signals and optimization dynamics within one compact backbone. Inference shares one vision encoder and one multimodal LLM backbone across all three tasks. Embedding appends a learned E slot, then projects and L2-normalizes its hidden state. Decision appends a separate learned J slot and maps its hidden state to candidate logits with a direct head. Generation uses autoregressive decoding without a soft slot.

WePM inference and training architecture with MGVB, ULKD and SEMO

Performance Across Three Capability Families

The evaluation includes both WePM-4B and WePM-2B across three capability families. Embedding covers 30 benchmarks and 10 models, Generation covers 39 benchmarks and 10 models, and Decision (JEV) covers 7 benchmarks and 22 models.

WePM-4B and WePM-2B benchmark comparisons across 30 Embedding, 39 Generation and 7 Decision (JEV) benchmarks, with WePM-4B ranked first overall in each category

WePM-4B ranks first overall in each capability family based on aggregate scores across its benchmarks. These results show that one shared 4B backbone can support competitive embedding, generation and decision capabilities together.

Heterogeneous Capability Density (HCD)

Benchmark quality alone does not capture the central constraint of on-device deployment: how much usable intelligence can remain resident within a fixed memory budget? We introduce Heterogeneous Capability Density (HCD) to jointly account for capability breadth, capability quality and resident inference memory.

HCD = (number of capability families above the usability threshold) x (aggregate capability quality) / (resident inference memory)

HCD counts capability families rather than individual benchmarks. For example, OCR, captioning and visual question answering all contribute to Generation instead of being counted as three separate capabilities. A higher HCD therefore indicates that a model delivers broader and stronger usable intelligence per unit of resident memory—not merely that it has been evaluated on more tasks.

Harmonic performance versus BF16 weight memory for WePM-4B (HCD=0.244) and six independent three-model compositions

The comparison pairs independent generation and embedding models with the same d3-4.5B decision model. WePM-4B reaches approximately 65.1% harmonic performance with about 8 GB of BF16 weight memory, yielding an HCD of 0.244. The six independent three-model compositions require roughly 21–43 GB, with harmonic performance of approximately 64.2–64.8% and HCD values of 0.045–0.092. In this comparison, WePM-4B achieves higher harmonic performance with substantially less weight memory, delivering approximately 2.7–5.4× the HCD of the independent compositions.

The memory values and HCD comparison above use BF16 weights only, not full runtime memory. KV cache, activations, framework overhead and runtime fragmentation are excluded.

Applications

WePM is intended as a shared local intelligence layer rather than a collection of benchmark-specific interfaces. The following demos run fully on device, keeping personal images, text and interaction data local.

1. Personal Agent

A single resident WePM-4B supports the complete local workflow: it retrieves relevant personal content, understands multimodal context, generates a grounded response and makes the typed decision that routes the next step. Retrieval, generation and decision are composed within one model instead of being dispatched to separate services.

2. On-Device Game Assistant

The same WePM-4B interprets game frames and interface text, retrieves local knowledge and interaction history, generates contextual suggestions, and performs option judgment or action routing. This turns one continuously resident model into a complete multimodal game assistant without separately loading vision, retrieval and decision models.

Inference

This repository provides the inference runtime and runnable examples for text generation from text and images, multimodal embeddings, and structured decisions.

Model weights

Model size Transformers (safetensors) GGUF (CPU) MLX (Apple silicon)
2B WePocketModel1.0-2B WePocketModel1.0-2B-GGUF WePocketModel1.0-2B-MLX
4B WePocketModel1.0-4B WePocketModel1.0-4B-GGUF WePocketModel1.0-4B-MLX

For Transformers and GGUF, use the corresponding Hugging Face model ID or a local checkpoint directory. Set WEPM_MODEL in the examples or pass --model to the CLI. By default, the examples use tencent/WePocketModel1.0-4B. MLX uses the self-contained runtime shipped in its Hugging Face repository; see MLX on Apple silicon.

Quick start

Clone the repository and create a Python 3.10–3.13 environment.

git clone https://github.com/Tencent/WePocketModel
cd WePocketModel
python -m venv .venv
source .venv/bin/activate

Install the PyTorch build for your device. On NVIDIA GPUs, use the CUDA wheel index compatible with your setup. This example uses CUDA 12.8.

python -m pip install torch==2.10.0 torchvision==0.25.0 \
  --index-url https://download.pytorch.org/whl/cu128
python -m pip install -r inference/requirements.txt

bash examples/gpu/generation/run.sh single_text

For Transformers on CPU, use the CPU wheel index.

python -m pip install torch==2.10.0 torchvision==0.25.0 \
  --index-url https://download.pytorch.org/whl/cpu
python -m pip install -r inference/requirements.txt

WEPM_MODEL=tencent/WePocketModel1.0-2B bash examples/cpu/generation/run.sh single_text

For GGUF on CPU, use the same CPU PyTorch build, install the optional dependencies, and build the native runtime. The build requires Git, CMake 3.20 or later, and a C++17 compiler.

python -m pip install -r inference/requirements-gguf.txt
python inference/build_gguf.py

WEPM_MODEL=tencent/WePocketModel1.0-4B-GGUF bash examples/cpu/generation/run.sh single_text

The first run with a Hugging Face model ID downloads a complete snapshot into the Hub cache. To use a local copy, see the checkpoint download instructions. The generation scripts also accept single_image and interleaved. See the runnable examples for embeddings and decisions and the inference guide for CLI flags, multimodal inputs, and raw training exports.

MLX on Apple silicon

Use the runtime included in the corresponding Hugging Face repository. It supports generation, multimodal embeddings and structured decisions (JEV) on Apple silicon (M-series Macs). Use a separate environment from the PyTorch setup above.

python -m venv .venv-mlx
source .venv-mlx/bin/activate
python -m pip install huggingface_hub
hf download tencent/WePocketModel1.0-2B-MLX --local-dir WePocketModel1.0-2B-MLX
cd WePocketModel1.0-2B-MLX
python -m pip install -r requirements.txt

python runtime/infer_mlx.py --model . --task generate \
  --prompt "Describe WePM in one sentence." \
  --max-new-tokens 64 --output out/generation.json

python runtime/infer_mlx.py --model . --task embed \
  --prompt "Find similar landscape photos." \
  --embedding-dim 1024 --output out/embedding.json

python runtime/infer_mlx.py --model . --task decision \
  --decision-json request.json \
  --output out/decision.json

request.json follows the SystemOne protocol; this example in the current repository can be used as a template, and the MLX model card documents the choice / score / noul variants.

For 4B, replace WePocketModel1.0-2B-MLX with WePocketModel1.0-4B-MLX in the download command and directory name. Add --image /path/to/image.jpg to the generation or embedding command for image input. The MLX model repositories include pinned dependencies and detailed usage instructions; this runtime is separate from this repository's Transformers/GGUF CLI.

Hardware and precision (4B)

Backend Device Precision Memory guidance
Transformers NVIDIA GPU BF16 ≈8.5 GiB of weights. 16 GiB VRAM recommended.
Transformers CPU FP32 ≈17 GiB of weights. 24 GiB system RAM recommended.
GGUF CPU Q4_K_M or BF16 language weights, FP32 vision and task compute The 4B Q4_K_M language file and shared multimodal weights occupy ≈3.19 GiB on disk.

Actual memory use depends on the input and context length. GGUF weight file size describes storage. Runtime RAM also includes the vision and task modules, context, and working buffers. See the GGUF guide for variants and context settings.

Project resources

Model weights · Checkpoint downloads · Inference guide · Runnable examples

Citation

If you find this work useful, please consider citing it:

@misc{wepm2026,
  title = {WePM: Hierarchical Conflict Reconciliation for Unified MLLMs},
  author = {{WeChat AI, Tencent}},
  year = {2026},
  howpublished = {Technical Report},
  url = {https://arxiv.org/abs/2611.27365}
}

License

The code made publicly available by Tencent in this repository is licensed under the Apache License, Version 2.0. See LICENSE for the complete terms and Tencent copyright notice.

This code license does not declare a license for model weights. Consult the license provided in each Hugging Face model repository for the applicable weight terms. Third-party components remain subject to their original licenses.