---
title: "Our Transformers Code Agent beats the GAIA benchmark 🏅"
description: "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."
url: "https://swe.quest/articles/our-transformers-code-agent-beats-the-gaia-benchmark-6fa8664c9f76e83d"
canonical: "https://huggingface.co/blog/beating-gaia"
source: "Hugging Face"
published: "2024-07-01"
difficulty: "medium"
kind: "Research"
reading_minutes: 12
tags: ["ai-agents","evals","llms","sandboxing"]
---

# Our Transformers Code Agent beats the GAIA benchmark 🏅

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2024-07-01, 12 min read, Research. Original: [https://huggingface.co/blog/beating-gaia](https://huggingface.co/blog/beating-gaia)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)
- [Evaluation](https://swe.quest/tags/evals.md) (AI & ML)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [Sandboxing & isolation](https://swe.quest/tags/sandboxing.md) (Security)

## Prerequisites

- LLM tool calling ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))
- Python AST basics ([easy posts on Python](https://swe.quest/tags/python.md?difficulty=easy))

## Keywords

Transformers Agents, GAIA, smolagents, ReactCodeAgent, AutoGen, GPT-4o

## Related posts

- [CodeAgents + Structure: A Better Way to Execute Actions](https://swe.quest/articles/codeagents-structure-a-better-way-to-execute-actions-5f9ad7c5f62e107c.md): Hugging Face · 2025-05-28 · Medium · 8 min read · AI agents, LLMs, Evaluation, Python
  Forcing 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.
- [License to Call: Introducing Transformers Agents 2.0](https://swe.quest/articles/license-to-call-introducing-transformers-agents-2-0-dad436258e67a17b.md): Hugging Face · 2024-05-13 · Medium · 15 min read · AI agents, LLMs, RAG & retrieval, Python
  Transformers 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.
- [Open-source DeepResearch – Freeing our search agents](https://swe.quest/articles/open-source-deepresearch-freeing-our-search-agents-72a8cc1624888c05.md): Hugging Face · 2025-02-04 · Medium · 17 min read · AI agents, LLMs, Evaluation, Open source
  Hugging 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).
- [CoderForge-Preview: SOTA open dataset for training efficient coding agents](https://swe.quest/articles/coderforge-preview-sota-open-dataset-for-training-efficient-coding-agents-83e1f3c7a7bdb67a.md): Together AI · 2026-02-25 · Hard · 14 min read · Model training, AI for coding, AI agents, Evaluation, LLMs
  CoderForge-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.
- [Introducing smolagents: simple agents that write actions in code.](https://swe.quest/articles/introducing-smolagents-simple-agents-that-write-actions-in-code-081cf3257f37300e.md): Hugging Face · 2024-12-31 · Medium · 11 min read · AI agents, LLMs, Python, Open source
  smolagents 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.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
