# DeepMath: A lightweight math reasoning Agent with smolagents

DevFeed: [DeepMath: A lightweight math reasoning Agent with smolagents](<https://devfeed.tech/articles/deepmath-a-lightweight-math-reasoning-agent-with-smolagents-7288.md>)

Original publisher: [Read original article](<https://huggingface.co/blog/intel-deepmath>)

Author: Daniel Fleischer; Moshe Berchansky; Moshe Wasserblat

Published: 2025-12-04T00:00:00Z

Content type: article

Language: en

Sources: [Hugging Face - Blog](<https://devfeed.tech/sources/hugging-face-blog.md>)

Topics: [smolagents](<https://devfeed.tech/topics/smolagents.md>), [math](<https://devfeed.tech/topics/math.md>), [grpo](<https://devfeed.tech/topics/grpo.md>), [Fine-tuning](<https://devfeed.tech/topics/fine-tuning.md>), [Python](<https://devfeed.tech/topics/python.md>), [Large Language Model](<https://devfeed.tech/topics/llm.md>), [vllm](<https://devfeed.tech/topics/vllm.md>), [trl](<https://devfeed.tech/topics/trl.md>), [datasets](<https://devfeed.tech/topics/datasets.md>), [Inference](<https://devfeed.tech/topics/inference.md>), [Artificial Intelligence](<https://devfeed.tech/topics/ai.md>), [Open Source](<https://devfeed.tech/topics/open-source.md>)

Tags: [agents](<https://devfeed.tech/tags/agents.md>), [artificial-intelligence](<https://devfeed.tech/tags/artificial-intelligence.md>), [datasets](<https://devfeed.tech/tags/datasets.md>), [fine-tuning](<https://devfeed.tech/tags/fine-tuning.md>), [grpo](<https://devfeed.tech/tags/grpo.md>), [inference](<https://devfeed.tech/tags/inference.md>), [large-language-models-llms](<https://devfeed.tech/tags/large-language-models-llms.md>), [llm](<https://devfeed.tech/tags/llm.md>), [math](<https://devfeed.tech/tags/math.md>), [math-reasoning](<https://devfeed.tech/tags/math-reasoning.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [python](<https://devfeed.tech/tags/python.md>), [reasoning](<https://devfeed.tech/tags/reasoning.md>), [sandbox](<https://devfeed.tech/tags/sandbox.md>), [smolagents](<https://devfeed.tech/tags/smolagents.md>), [trl](<https://devfeed.tech/tags/trl.md>), [vllm](<https://devfeed.tech/tags/vllm.md>)

## AI overview

DeepMath is a lightweight math reasoning agent built on Qwen3-4B Thinking and implemented with smolagents. It uses GRPO fine-tuning to encourage concise Python snippets for deterministic computation, executes those snippets in a constrained sandbox, and reintegrates the results into the reasoning process. Evaluation on MATH500, AIME, HMMT, and HLE reports shorter outputs and often improved accuracy.

## Source excerpt

We're on a journey to advance and democratize artificial intelligence through open source and open science.