Our Transformers Code Agent beats the GAIA benchmark π
A ReactCodeAgent built with Transformers Agents and GPT-4o scored 44.2% on the GAIA validation set, ranking first, and 33.3% on the test set, ranking second overall with the best Level 3 score. Instead of JSON tool calls, the agent writes its actions as Python code, which is more concise, cuts steps by roughly 30%, and makes it easy to store intermediate results in named variables. Code runs in a custom AST-walking interpreter that only executes allowlisted imports and functions, with caps on operation count and print output. A manager agent delegates web browsing to a JSON-based search sub-agent, and the planning loop regenerates facts and a plan every N steps; leaving the previous plan out of the prompt raised the score.
Related posts
- CodeAgents + Structure: A Better Way to Execute Actions
Hugging Face mediumAdeptForcing code-writing agents to emit their reasoning and Python code as a structured JSON blob (thoughts + code) beats both markdown-parsed CodeAgents and JSON tool-calling agents by 2-7 percentage points on GAIA, MATH, SimpleQA and Frames for capable models. An analysis of 15,724 traces shows first-step parsing errors cut success from 51.3% to 42.3% and raise average steps from 3.18 to 4.63, which structured generation eliminates. Smaller models such as Mistral-7B pay a "structure tax", producing broken Python when juggling JSON escaping and code at once, so the approach is recommended for 32B+ or frontier models. In smolagents it is enabled with use_structured_outputs_internally=True.
- License to Call: Introducing Transformers Agents 2.0
Hugging Face mediumAdeptTransformers Agents 2.0 adds two iterative ReAct-style agents, ReactCodeAgent and ReactJsonAgent, which loop through thought, action and observation, alongside the existing single-shot CodeAgent. The framework is built from a few transparent pieces: Tool classes whose attributes generate the prompt's usage manual, reusable pre-instantiated Toolboxes, and a pluggable LLM engine. Worked examples include a self-correcting RAG agent that chooses its own source filters over a FAISS index, and a multi-agent setup that wraps a web-surfer agent as a tool. A Llama-3-70B-Instruct agent built this way outperforms GPT-4-based agents on the GAIA leaderboard; the functionality has since moved to the smolagents library.
- Open-source DeepResearch β Freeing our search agents
Hugging Face mediumAdeptHugging Face reproduced OpenAI's Deep Research agent in about 24 hours using the open smolagents framework and reached 55.15% on the GAIA validation set, up from roughly 46% for the previous open state of the art (Magentic-One). OpenAI reports 67.36%. Most of the gain comes from a CodeAgent that writes its actions as Python code instead of JSON tool calls. Swapping in JSON actions on the same setup drops the score to 33%. Code actions need about 30% fewer steps and tokens and handle multimodal state more easily. The toolset is deliberately simple: a text-based web browser and a file inspector borrowed from Magentic-One. Next steps are vision-based GUI browsing and benchmarking open models such as DeepSeek R1.
- CoderForge-Preview: SOTA open dataset for training efficient coding agents
Together AI hardMasterCoderForge-Preview is an open dataset of 258K test-verified coding agent trajectories (155K passing) covering 51K tasks across 1,655 repositories from R2E-Gym, SWE-Smith and SWE-Rebench. The trajectories were generated with Qwen3-Coder-480B in OpenHands Docker environments, filtered by rejection sampling and permissive-license audits, and cost about $130K to produce at a ~90% prompt cache hit rate. Fine-tuning Qwen3-32B on the passing trajectories, using Ulysses sequence parallelism, multipacking and token-level loss normalization at 128K context, reaches 59.4% pass@1 on SWE-Bench Verified, and a 4B model reaches 43.0%. Ablations show a repetition penalty helps only early checkpoints, so later checkpoints should be run without one.
- Introducing smolagents: simple agents that write actions in code.
Hugging Face mediumAdeptsmolagents is a minimal Python library from Hugging Face for building LLM agents, with first-class support for code agents that write their actions as Python code instead of JSON tool calls. Agency is framed as a spectrum from simple output processing to multi-step and multi-agent loops, and the post advises using deterministic workflows unless tasks genuinely need flexibility. Code actions are argued to beat JSON for composability, object handling, generality and training-data coverage. The library supports sandboxed execution via E2B, custom tools defined with a @tool decorator and shareable on the Hub, any LLM via transformers, the HF inference API or LiteLLM, and a benchmark shows open models competitive with closed ones on agentic tasks.