MiniCPM5-2B: Fixing Repetition and Agent Performance

Better Stackgo watch the original →

MiniCPM5-2B is a 2B-parameter model that competes with 4B models on agent tasks, provided you override the default repetition penalty and sampling settings.

The Breakthrough

MiniCPM5-2B achieves competitive performance on agent-based coding benchmarks like SWE-bench Verified by utilizing a standard Llama architecture trained on 500,000 agent trajectories, effectively outperforming models twice its size in specific tool-calling and reasoning tasks.

Fixing Model Instability

The model suffers from extreme repetition issues when using default sampling parameters, with Q4_K_M quantization failing in 92% of generations. To stabilize the output, users must adjust the sampling configuration:

  • Set the repeat_penalty to 1.15 to prevent the model from entering infinite loops.
  • Set the min_p value to 0 in llama.cpp, as the default value of 0.05 causes significant degradation in generation quality.
  • Ensure the runtime environment supports the standard Llama architecture, as MiniCPM5-2B abandons the custom sparse attention mechanisms used in previous iterations.

Performance and Limitations

While the model excels at tool-calling and coding tasks, it does not consistently outperform 4B-parameter models like Qwen3.5-4B across broader benchmarks such as MMLU Pro or GPQA. The model defaults to a "thinking" mode that requires reasoning before outputting a final answer, and it is currently limited to English and Chinese language support. Furthermore, the lack of official evaluation scripts and the requirement for manual model file configuration in llama.cpp make it less "plug-and-play" than competing local models.

  • #ai
  • #dev-tooling
  • #llm

summary by google/gemini-3.1-flash-lite. probably wrong about something. check the source.