Source-linked AI summary
Pangu Embedded: An Efficient Dual-system LLM Reasoner with Metacognition
Hanting Chen, Yasheng Wang, Kai Han, Dong Li, Lin Li, Zhenni Bi, Jinpeng Li, Haoyu Wang, Fei Mi, Mingjian Zhu, Bin Wang, Kaikai Song, Yifei Fu, Xu He, Yu Luo, Chong Zhu, Quan He, Xueyu Wu, Wei He, Hailin Hu, Yehui Tang, Dacheng Tao, Xinghao Chen, Yunhe Wang
TL;DR
Reasoning LLMs can be costly to deploy because of large model sizes and long thinking sequences. Pangu Embedded uses two-stage training and fast/slow thinking modes; the authors report state-of-the-art reasoning accuracy among similarly sized models.
Problem
Reasoning LLMs can be deployment-inefficient because large model sizes and lengthy thinking processes raise computational costs and latency, particularly on resource-constrained devices.
Source: §1 · pp. 1–2Method
Pangu Embedded uses a two-stage training framework to build a reasoner, then adds fast and slow modes with manual switching and adaptive mode selection.
Source: §1 · p. 2, §6 · p. 26Results
Pangu Embedded achieves state-of-the-art reasoning accuracy among similarly sized models.
Source: §6 · p. 26Takeaways & Limitations
The authors frame Pangu Embedded as a foundational approach toward more computationally sustainable and powerful reasoning models.
Source: §6 · p. 27The advantage over Qwen3-8B may partly reflect differences in the models’ general pretraining or initial fine-tuning data mixtures.
Source: §4.8.2 · p. 25
Abstract
from arXiv · showhide
This work presents Pangu Embedded, an efficient Large Language Model (LLM) reasoner developed on Ascend Neural Processing Units (NPUs), featuring flexible fast and slow thinking capabilities. Pangu Embedded addresses the significant computational costs and inference latency challenges prevalent in existing reasoning-optimized LLMs. We propose a two-stage training framework for its construction. In Stage 1, the model is finetuned via an iterative distillation process, incorporating inter-iteration model merging to effectively aggregate complementary knowledge. This is followed by reinforcement learning on Ascend clusters, optimized by a latency-tolerant scheduler that combines stale synchronous parallelism with prioritized data queues. The RL process is guided by a Multi-source Adaptive Reward System (MARS), which generates dynamic, task-specific reward signals using deterministic metrics and lightweight LLM evaluators for mathematics, coding, and general problem-solving tasks. Stage 2 introduces a dual-system framework, endowing Pangu Embedded with a "fast" mode for routine queries and a deeper "slow" mode for complex inference. This framework offers both manual mode switching for user control and an automatic, complexity-aware mode selection mechanism that dynamically allocates computational resources to balance latency and reasoning depth. Experimental results on benchmarks including AIME 2024, GPQA, and LiveCodeBench demonstrate that Pangu Embedded with 7B parameters, outperforms similar-size models like Qwen3-8B and GLM4-9B. It delivers rapid responses and state-of-the-art reasoning quality within a single, unified model architecture, highlighting a promising direction for developing powerful yet practically deployable LLM reasoners.
1 Introduction
Pangu Embedded targets the cost and latency of reasoning-optimized LLMs with a two-stage training framework and a single model that supports fast and slow thinking. The paper reports that its 7B model outperforms Qwen3-8B while delivering rapid responses and reasoning quality.
Introduction
- Reasoning-optimized LLMs face deployment inefficiency from excessive model size, such as DeepSeek-R1’s 671B parameters, and long thinking processes that increase latency.The passage notes that a complex problem can generate over 32,000 thinking tokens, each requiring full-model inference, making such models impractical for time-sensitive, resource-constrained settings.Source: §1 · pp. 1–2
- Pangu Embedded’s 7B model outperforms similarly sized Qwen3-8B, delivering rapid responses and state-of-the-art reasoning quality in one unified model.The introduction reports results on various datasets but provides no metric values here.Source: §1 · p. 2
- Its two-stage framework builds a base reasoner through iterative distillation and model merging, then adds fast and slow modes with manual or complexity-aware automatic selection.Stage 1 also uses large-scale reinforcement learning on Ascend NPU clusters, supported by a latency-tolerant scheduler and MARS.Source: §1 · p. 2, Figure 1 · p. 2
2 Basic Reasoner Construction
Stage 1 builds Pangu Embedded’s foundational reasoner through data preparation, iterative distillation, and scaled reinforcement learning tailored for Ascend NPUs.
- Stage 1 combines data preparation, iterative distillation, and Ascend NPU-tailored scaled reinforcement learning to build a robust foundational reasoner.Source: §2 · p. 2
2.1 Preliminaries of Base Model
Pangu Embedded is a 7-billion-parameter language model optimized for edge computing, with pretraining data and a tokenizer consistent with Pangu Ultra [55].
2.1 Preliminaries of Base Model
- Pangu Embedded is a 7-billion-parameter language model optimized for edge computing, using Pangu Ultra’s [55] pretraining data and tokenizer, a 153,376-token vocabulary, and a three-phase corpus.The corpus is processed through general, reasoning, and annealing phases.Source: §2.1 · p. 2
2.2 Post-training Data
Pangu Embedded’s post-training pool combines diverse reasoning and non-reasoning data from multiple sources, then filters and selects samples to improve quality and diversity. The resulting pool supports both reinforcement learning and distillation.
2.2 Post-training Data
- The pool spans reasoning and non-reasoning tasks across QA, AIGC, text analysis, coding, mathematics, logic, and tool use, from open instructions, industrial queries, and synthesized pretraining-corpus problems.Its domains include finance, healthcare, and government affairs.Source: §2.2 · p. 3
- LLM annotations of category, question type, verifiability, and difficulty guide prompt filtering, while heuristic filters remove low-quality and cross-source duplicate samples.The filtering aims to mitigate reward hacking and reduce sampling costs.Source: §2.2 · p. 3
- MinHash-LSH removes near-duplicates, then ZIP selects instruction samples by compression-ratio entropy and similarity to promote diversity and long-CoT learning [54].ZIP iteratively adds samples with low individual compression ratios and low similarity to those already selected.Source: §2.2 · p. 3
- The resulting initial high-quality, diverse data pool D supplies both reinforcement learning and distillation.Source: §2.2 · p. 3
2.3 SFT Strategy: Model-aware Iterative Distillation
Pangu Embedded’s SFT strategy iteratively aligns training-data difficulty with the student model’s evolving capabilities and merges updates across iterations. The approach combines curated distillation data, adaptive sample selection, and successive model merging to support learning while consolidating prior knowledge.
2.3.1 Motivation
- 50.42% on AIME 2024 was achieved with balanced-difficulty data, versus 45.42% with mostly easy data and 48.75% with mostly hard data.Using the full dataset without selection produced the lowest performance, indicating that indiscriminate data use can hinder learning reasoning patterns.Source: Table 1 · p. 4, §2.3.1 · p. 4
2.3.2 Model-aware Iterative Distillation Pipeline
- Distillation data is generated from prompts, filtered for diversity and quality using rule-based and model-based checks, then refined through rejection sampling and preference-based post-selection.For long chain-of-thought data, rejection sampling favors the shortest correct reasoning path to improve token efficiency.Source: §2.3.2 · pp. 4–5
- The pipeline scores sample complexity using the previous-iteration student’s responses, treating lower scores as samples it handles well and higher scores as samples it still struggles with.For samples with ground-truth answers, the score uses agreement between generated final answers; for non-reasoning data, complexity can be estimated from loss.Source: §2.3.2 · p. 5
- Each iteration selects distilled samples by complexity, favoring medium difficulty slightly toward simplicity, keeps µ constant as the model improves, and stops when validation gains become marginal.Few-shot examples are added only for the first iteration so the pretrained model can be scored before instruction tuning.Source: §2.3.2 · p. 6
2.3.3 Inter-iteration Model Merging
- Dynamic data selection can reduce domain coverage or cause catastrophic forgetting, so inter-iteration merging is used to smooth distribution shifts and stabilize learning.The merging strategy anchors each iteration to knowledge accumulated in earlier iterations.Source: §2.3.3 · pp. 6–7
- The merge applies the current iteration’s average checkpoint delta to the previous merged model, accumulating improvements while mitigating catastrophic forgetting.The reference is the previous iteration’s merged model, and the average delta is calculated from the current iteration’s SFT checkpoints.Source: §2.3.3 · pp. 6–7
2.4 Enhancing Generation Quality: Repetition Self-repair
Pangu Embedded adds Repetition Self-repair to the SFT-refined reasoner to improve long-text generation quality, combining local n-gram repetition detection with prompt-controlled suppression.
2.4 Enhancing Generation Quality: Repetition Self-repair
- Repetition Self-repair targets repetitive patterns in long generations through local n-gram detection and prompt-controlled suppression.It is applied to the SFT-refined model as a usability improvement before subsequent reinforcement learning.Source: §2.4 · p. 7
Local n-gram repetition detection method
- Local n-gram detection checks a recent window periodically, reducing comparison cost from O(N^2) toward O(N · W) or O(N) with efficient implementation.Repetition is flagged when Jaccard similarity between recently generated n-gram sets exceeds a predefined threshold.Source: §2.4 · p. 7
Prompt-control repetition suppression strategy
- When repetition is detected, a control prompt steers generation out of the loop, and the detection window resets after the prompt.The self-repair mechanism is intended to produce more coherent and diverse outputs.Source: §2.4 · p. 7
2.5 Scaling Reinforcement Learning on Ascend Clusters
The RL phase refines and aligns the reasoner using GRPO, adaptive rewards, curriculum-based data mixing, and an SFT cold start.
2.5.1 Reinforcement Learning Algorithm
- Zero-Advantage-Mask skips samples with zero advantage, preventing them from contributing to either the PPO-clip or KL-divergence loss.GRPO can otherwise lose its primary optimization signal when all responses to a prompt receive the same reward, reducing the loss to behavior cloning and hampering exploration.Source: §2.5.1 · p. 8
2.5.2 Multi-Source Adaptive Reward System (MARS)
- MARS routes tasks to adaptive reward channels: hybrid math verification, executable coding checks, normalized preference scores, and format and repetition controls.The math LLM verifier achieves approximately 95% precision; coding rewards use a four-stage pipeline with stage-based or continuous scoring, while format validation and Rabin-Karp repetition penalties support structural integrity.Source: §2.5.2 · pp. 8–9
2.5.3 Curriculum Data Mixing
- A model-aware curriculum estimates sample complexity from the current policy’s performance, then progressively mixes difficulty levels to sustain informative rewards and stable updates.For verifiable tasks, complexity uses the pass rate across k diverse responses; open-ended tasks may use historical reward variance or other heuristics.Source: §2.5.3 · pp. 9–10
2.5.4 Cold Start
- The cold-start SFT model is trained on tens of thousands of quality-assessed long-CoT samples and establishes capabilities intended to stabilize and accelerate subsequent RL.The seed data is generated with prompt engineering and multi-agent collaboration, then assessed with human-in-the-loop refinement; the resulting model supports complex instruction following, self-evaluation, error detection, and multi-turn reflection and correction.Source: §2.5.4 · p. 10
2.6 RL Infrastructure on Ascend Clusters
Pangu Embedded’s Ascend RL infrastructure co-schedules training and inference, and combines latency-tolerant scheduling with Ascend-specific inference optimizations to improve hardware utilization and reduce delays.
Latency-tolerant scheduling framework
- On a 128-node Ascend cluster, SSP reduces device idle time by approximately 30% versus fully synchronous baselines while maintaining training stability with less than 1% reward drift.SSP permits pipeline stages to advance independently within a typical staleness threshold of s = 4; parameter updates wait for reference assessment, reward scoring, and log-probability extraction.Source: §2.6 · p. 11, Figure 7 · p. 12
Training-inference co-scheduling
- Up to 2x throughput improvement over isolated training and inference deployments comes from co-scheduling, enabled by adaptive host-device weight reshuffling and zero-copy transfers where feasible.Inference can access the latest training weights without redundant memory replication or serialization.Source: §2.6 · p. 11
vLLM inference optimization for Ascend NPUs
- An approximate 2x reduction in straggler-induced delays versus static partitioning comes from global-queue scheduling, Ascend-aware chunking, and proactive prefetching during batched decoding.The optimizations target heterogeneous decoding lengths of 10K to over 32K tokens while maintaining high throughput.Source: §2.6 · pp. 11–12
3 Fast and Slow Thinking: A Dual System Cognitive Architecture for LLMs
Pangu Embedded combines direct, efficient System 1 responses with deliberative, step-by-step System 2 reasoning in one model, supporting both user-directed mode switching and automatic selection based on query complexity.
3.1 Training for Manual Mode Switching
- Stage 1 first establishes slow reasoning; fusion training then replays System 2 examples while adding System 1 examples to preserve slow-thinking ability as fast responses are learned.Each mode is paired with a directive, and an independent meta prompt specifies the requested mode without interfering with conventional system prompts.Source: §3.1 · pp. 13–14
3.2 Training for Adaptive Mode Selection
- For adaptive selection, Pangu Embedded assesses query complexity and chooses a fast System 1 or slow System 2 response to balance computational efficiency with performance.The adaptive capability is trained through data curation and targeted fine-tuning.Source: §3.2 · p. 14
3.2.1 Data Curation for Adaptive Learning
- The math-focused Dfusion dataset labels queries easy when LLM-assessed computation and thinking complexity scores are both ≤2, then balances approximately 300K fast-mode and 300K slow-mode samples.Scores range from 1 to 5; remaining queries are labeled hard, with concise responses for easy queries and detailed reasoning responses for hard ones.Source: §3.2.1 · p. 14
3.2.2 Fine-tuning for Adaptive Behavior
- Fine-tuning the Stage 1 reasoner on Dfusion teaches it to omit <think> blocks for easy queries and generate them for hard queries, making their presence its implicit mode-selection signal.The SFT stage uses standard next-token prediction loss over Dfusion sequences.Source: §3.2.2 · pp. 14–15
3.3 User Controllability and Interaction
- By default, the model selects reasoning depth adaptively, while natural-language instructions let users override or guide its choice without explicit parameters or complex prompt engineering.The interaction example shows a user asking for a simpler answer and the model switching from a detailed System 2 solution to a concise System 1 response.Source: §3.3 · p. 15
4 Experiments
Experiments assess Pangu Embedded’s benchmark performance, training, dual-mode behavior, and efficiency, and examine its adaptation to legal reasoning through LawBench evaluation and qualitative analysis.
4.1.1 Iterative Distillation (SFT) Training Setup
- SFT iterations train for six epochs from merged prior checkpoints, with cosine-decayed learning rates, smaller rates in later iterations, and 32,768-token packed sequences.The first iteration starts at 5 × 10−6; training uses AdamW, weight decay 0.1, and gradient clipping at 1.0.Source: §4.1.1 · p. 16
4.1.2 RL Training Setup
- RL tuning found that excessive updates, extreme sampling temperatures, and either excessive or absent KL regularization impair stability, diversity, or accuracy.The selected setup uses 512 prompts per step, eight responses per prompt, a 0.9 sampling temperature, and a 1 × 10−2 KL coefficient.Source: §4.1.2 · pp. 16–17
4.2 Main Results
- Pangu Embedded’s 7B unified model shows strong, often superior performance across multiple benchmarks: Thinking (system2) leads on several reasoning-intensive benchmarks, while Nothinking (system1) remains highly competitive and often leads similarly sized models.Source: §4.2 · p. 17, Table 2 · p. 18
4.3 Ablation Studies on Manual Switching
- Manual switching lets the unified model approach specialists: System 2 is competitive, System 1 beats the fast specialist on GPQA and AIME24, and fusion training outperforms naive co-training.System 2 produces longer responses than System 1, while each unified mode’s output lengths generally mirror those of its corresponding specialist.Source: §4.3 · pp. 18–19
4.4 Ablation Studies on Adaptive Fast and Slow Thinking
- Adaptive mode preserves nearly unchanged accuracy while cutting average token use about 11% on MATH500 and 88% on GSM8K, activating slow thinking more as difficulty rises.Slow thinking is used on 14.56% of GSM8K problems, and its use increases monotonically with MATH500 problem difficulty.Source: Table 4 · p. 20, §4.4 · pp. 20–21, Figure 11 · p. 20
4.5 Ablation Studies on SFT Strategy
- Medium-leaning-easy data (EXP1) outperforms other complexity mixes; performance improves across SFT iterations but gains beyond iteration three are marginal, and merging consistently boosts three benchmarks.Excluding either extreme of the complexity spectrum degrades performance; the merging gains are reported on AIME 2024, LiveCodeBench, and GPQA Diamond.Source: §4.5 · pp. 21–22, Table 5 · p. 21, Table 6 · p. 22
4.6 Ablation Studies on Repetition Self-repair
- On MATH500, self-repair reduces repetitive outputs from 12.25 to 2.25 and truncations from 12.63 to 2.38, with an approximately 0.5-percentage-point accuracy improvement.When repetition is detected, the mechanism prompts the model to reflect on the repeated output before continuing.Source: §4.6 · p. 22, Table 7 · p. 22
4.7 Ablation Studies on Reinforcement Learning Strategy
- Early Ascend RL validation showed stable math-learning gains and a 6% absolute LiveCodeBench improvement after 300 steps, supporting subsequent final-model training with MARS.The math run used approximately 30,000 ORZ Math samples; the code run used 16,384 prompts selected for partial baseline pass@1 success.Source: §4.7 · pp. 23–24, Figure 13 · p. 23, Figure 14 · p. 23
4.8 Extension to Domain-specific Tasks
- The legal domain was selected as a proof of concept for extending Pangu Embedded’s general-domain reasoning to specialized industry-level reasoning.Source: §4.8 · p. 24
4.8.1 Domain-specific Data Preparation
- The adaptation set combined general-industry and legal reasoning data, with legal examples covering laws, case files, and contracts and an approximate 1:2 general-to-legal ratio.Sources included Chinese and English open-source and in-house collections; duplicates were removed using exact and fuzzy matching, and variable-quality chain-of-thoughts were distilled or filtered for over-thinking and repetition before mixing with general post-training data.Source: §4.8.1 · p. 24
4.8.2 Results in the Legal Domain
- LawBench evaluates legal intelligence through 20 subtasks spanning legal knowledge memorization, legal understanding, and legal application.Source: §4.8.2 · p. 24
- 54.59% average accuracy on LawBench followed legal adaptation, up 4.62 percentage points from the general-domain model’s 49.97%; performance improved on 17 of 20 tasks.The general-domain model also exceeded Qwen3-8B (Thinking mode), scoring 49.97% versus 46.88%; this advantage may partly reflect differences in pre-training or initial fine-tuning data mixtures.Source: §4.8.2 · pp. 24–25, Figure 15 · p. 25
- Manual inspection found that domain-adapted Pangu Embedded applied legal principles more accurately and reasoned more precisely on challenging case-analysis tasks.The example concerned correct application of burden-of-proof principles under the Civil Code of the People’s Republic of China, even when multiple models reached the correct final answer.Source: §4.8.2 · p. 25
5 Related Work
The related work positions Pangu Embedded within research on reasoning models, RL infrastructure, distillation, model-aware training, and adaptive fast/slow thinking. It identifies Ascend-specific RL optimization and model-aware iterative distillation as areas its approach addresses.
Reasoning Models
- Reasoning models such as OpenAI’s o1, DeepSeek-R1 [12], and QwQ demonstrate the potential of extended chains of thought, while training-data recipes remain underemphasized and small SFT datasets may not transfer across models.The passage attributes this transfer concern to differences in foundation-model architectures and capabilities.Source: §5 · p. 25
RL Infrastructure for LLMs
- Existing RL training frameworks and algorithms, including RLHF [33], Constitutional AI [4], PPO [37], and Ray RLlib [24], are largely GPU-oriented, motivating optimization for Ascend clusters.Source: §5 · pp. 25–26
Knowledge Distillation
- Distillation transfers capabilities from teacher to student models, but output-distribution alignment requires shared vocabularies; recent work distills reasoning traces [15] [56], sometimes refined with MCTS [53].This work focuses on straightforward distillation and data strategies suited to the student model’s capabilities.Source: §5 · p. 26
Model-aware Training
- Prior model-specific data-selection work [7] [21] has not extensively studied distillation, which this work addresses with iterative distillation and a model-aware complexity score.The section also notes that data distributions far from a base model’s learned representations can be difficult to assimilate and may degrade performance [35].Source: §5 · p. 26
Fast and Slow Thinking
- Adaptive fast/slow reasoning methods include difficulty-aware depth selection [48] [44] [59] and manually switchable modes [5] [50], balancing rapid responses against deliberation.The cited approaches use question assessment and adaptive rewards [48], stochastic mode switching [44], or constrained optimization and importance sampling [59].Source: §5 · p. 26
6 Conclusion and Discussion
Pangu Embedded combines a two-stage training framework with dual-system fast-slow thinking to deliver accurate, efficient reasoning in a compact, deployable model. The study also highlights matching data complexity to the training paradigm as a useful strategy for reasoning-model development.
6 Conclusion and Discussion
- Pangu Embedded combines iterative distillation and reinforcement learning with manual or adaptive fast-slow mode selection, offering a practical path to compact, powerful, deployable reasoners.The framework also incorporates checkpoint merging, a latency-tolerant scheduler, MARS, and repetition self-repair.Source: §6 · p. 26
- Medium, simpler data suits SFT-based distillation, while broader, higher-complexity data supports RL-based refinement.The authors identify this alignment between data complexity and training paradigm as an insight for training reasoning LLMs.Source: §6 · pp. 26–27
- The authors propose hybrid SFT-RL frameworks with model-aware complexity scheduling as a future direction for more dynamic knowledge transfer and policy refinement.They frame this approach as a step toward computationally sustainable and powerful reasoning models.Source: §6 · p. 27
B Response Examples
The response examples illustrate Pangu Embedded’s Repetition Self-repair on a MATH task and show model reasoning outputs on a China-law question, with incorrect and correct reasoning visually distinguished.
B Response Examples
- Figure 16 demonstrates Repetition Self-repair detecting repetitive sentences, inserting a guiding prompt, and producing a corrected, non-repetitive reasoning path on a MATH task.The figure contrasts this with a model without self-repair that can get stuck in repetitive paragraphs.Source: Figure 16 · p. 32
- Figure 17 shows reasoning outputs from different models under China’s law, marking incorrect reasoning in red and correct reasoning in green.Source: Figure 17 · p. 33
Related papers
This paper cites
- Training language models to follow instructions with human feedback2022
- GPT-4 Technical Report2023
- DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning2025
- LLaMA: Open and Efficient Foundation Language Models2023
- Efficient Memory Management for Large Language Model Serving with PagedAttention2023
- Let's Verify Step by Step2023