221 3 days ago

Spark-X2.5 is a compact, general-purpose language model for conversation, writing, translation, reasoning, coding, tool use, and agentic workflows. It supports a native context length of up to 1M tokens, and covers more than 200 languages.

ollama run SparkLLM/Spark-X2.5-4B

Details

3 days ago

2d6194f978ca · 8.2GB ·

spark2_5
·
4.11B
·
BF16

Readme

Spark-X2.5

xhtoken.png

Introduction

We are introducing Spark-X2.5-4B and Spark-X2.5-1.7B, two compact, general-purpose language models designed to make capable AI more practical, efficient, and accessible. The models deliver strong performance across a broad range of everyday tasks—including conversation, writing, translation, reasoning, coding, tool use, and agentic workflows—achieving leading results among open-source models of comparable size. Spark-X2.5 combines an efficiency-oriented architecture with native context windows of up to 1M tokens, and support for more than 200 languages.

Technical Highlights

  • Efficient Architecture and Native 1M-token Context: The models use a hybrid attention architecture that combines one full-attention layer with three sliding-window attention layers. This design substantially reduces the computational overhead typically associated with long-context models while natively supporting a context window of up to 1M tokens.

  • Strong Coding and Agent Capabilities: The models are deeply integrated with popular agent harnesses, including Codex, Claude Code, OpenClaw, and Hermes. They deliver state-of-the-art performance among models of comparable size across everyday coding, agentic workflows, reasoning, and instruction-following tasks.

  • Broad Hardware and Software Compatibility: The models support a wide range of hardware platforms, including NVIDIA, Huawei, Hygon, and HOUMO.AI. They are compatible with leading inference frameworks such as vLLM, SGLang, llama.cpp, and MLX, and can be deployed through Ollama and LM Studio.

  • Advanced Training Algorithms: The models were trained on Huawei Ascend clusters. Large-scale reinforcement learning and post-training techniques such as MOPD significantly enhance their reasoning, coding, agentic, and instruction-following capabilities.

model-benchmark-comparison.svg

Model Overview

For agent tasks, balancing performance, inference speed, and cache usage has long been a key bottleneck limiting model performance. Spark-X2.5 systematically integrates and optimizes mature attention technologies, combining sliding-window attention (SWA) with a hybrid full-attention architecture. This approach leverages the strengths of both mechanisms while avoiding the limitations of relying on a single structure, achieving an effective balance among performance, inference efficiency, and KV-cache size—thereby improving its practicality and effectiveness across real-world deployment scenarios. 20260831-230730.jpeg

Training Methods

Spark-X2.5 is pretrained on approximately 20 trillion tokens from a diverse corpus spanning web pages, books, academic publications, code, and encyclopedic materials. Particular attention is paid to data quality, domain coverage, and the sampling weights assigned to different data categories. Extensive data-mixture studies are conducted to determine an effective balance among mathematics, logic, code, and other high-value domains. This enables the models to acquire broad general knowledge while developing stronger capabilities in complex reasoning and code generation. Long-context capability is developed through a dedicated training stage comprising hundreds of billions of tokens, with sequence lengths extending to 1M tokens.

Post-training begins with supervised fine-tuning on a carefully curated corpus. This stage establishes robust instruction following, structured generation, and task-completion, while providing a stable policy initialization for reinforcement learning. We subsequently apply large-scale reinforcement learning across several capability domains, including language understanding, reasoning, programming, tool-augmented agentic behavior, and instruction following. This process yields a set of domain-specialized teacher policies, whose complementary strengths are consolidated into a single deployable model through MOPD. post_training_pipeline.svg

Benchmarks

We evaluate our models and compare them with leading on-device models of similar size across a broad range of tasks, including agent, code, math, general and knowledge.

Benchmark Spark‑X2.5‑4B Spark‑X2.5‑1.7B Qwen3.5‑9B Qwen3.5‑4B Qwen3.5‑2B Gemma4‑12B Gemma4‑E4B Gemma4‑E2B
Agent
BFCL‑V465.146.966.1*50.3*43.6*37.436.930.2
τ²‑bench75.165.379.1*79.9*48.8*69.0*42.2*24.5*
τ³‑bench30.420.19.36.74.113.310.18.8
MCP‑Atlas54.623.447.4*40.8*14.830.5*15.0*12.6
MCP‑Mark14.22.313.412.5
Workspace Bench31.218.925.521.37.7
VitaBench2.025.28.315.618.25.212.44.84.4
BrowseComp40.929.78.314.33.110.08.33.7
Code
SWE‑Bench Pro44.410.433.8*29.4*1.921.9*4.0*
SWE‑Bench Verified41.628.353.1*38.8*6.844.2*14.0*
SWE‑Bench Multilingual53.323.343.327.75.032.5*
SciCode34.718.232.7*24.06.039.827.520.5
Math
Gaokao 2026133.4114.8135.5130.394.0130.6102.481.8
AIME 202690.769.488.283.030.882.1*42.5*37.5*
HMMT Feb 202681.248.470.869.721.565.634.220.5
IMO‑AnswerBench74.245.469.868.557.226.922.6
General & Knowledge
IFEval93.089.591.5*89.8*78.6*94.845.334.8
IFBench75.066.364.559.241.3*73.5*44.0*22.7
AA‑LCR56.324.363.0*57.0*25.6*55.3*34.718.3
HLE12.36.314.38.62.113.13.92.5
GPQA67.443.877.267.244.672.854.543.8
  • * denotes reported results from publicly‑released model cards / papers and - denotes scores not yet available.
  • All evaluations are conducted in thinking mode. The recommended sampling parameters for Spark-X2.5 are temperature=1.0, top_p=0.95, and top_k=-1.
  • Gaokao 2026 consists of the five 2026 Chinese GAOKAO examinations (National I,National II, Beijing, Shanghai, Tianjin), each graded out of 150 points.

Run with Ollama

Note

The official Ollama release does not yet support the spark2_5 architecture. Running ollama run SparkLLM/Spark-X2.5-4B with the official runtime downloads the model files, but cannot start inference. Build and use the compatible runtime below to run the model.

git clone https://github.com/XHToken/llama.cpp.git llama.cpp-spark
git clone https://github.com/ollama/ollama.git ollama-spark

cd ollama-spark
export OLLAMA_LLAMA_CPP_SOURCE="$(cd ../llama.cpp-spark && pwd)"

cmake -S . -B build
cmake --build build --parallel 8
./ollama serve

Open another terminal:

cd ollama-spark
./ollama run SparkLLM/Spark-X2.5-4B