Hephaestus: Improving Fundamental Agent Capabilities of Large Language Models through Continual Pre-Training
Yuchen Zhuang, Jingfeng Yang, Haoming Jiang, Xin Liu, Kewei Cheng, Sanket Lokegaonkar, Yifan Gao, Qing Ping, Tianyi Liu, Binxuan Huang, Zheng Li, Zhengyang Wang, Pei Chen, Ruijie Wang, Rongzhi Zhang, Nasser Zalmout, Priyanka Nigam, Bing Yin, Chao Zhang
TL;DR
This work tackles the limited availability of agent-oriented pre-training data for large language models and the trade-offs of prompting versus fine-tuning. It introduces Hephaestus-Forge, a large-scale, multi-source corpus (103B tokens across 76,537 APIs) designed to strengthen API function calling, intrinsic reasoning, and adaptation to environmental feedback, and it uses a three-stage continual pre-training plus instruction fine-tuning framework to produce Hephaestus. Scaling-law analyses identify an optimal data composition around $36\%$ agent data and a balanced $1:1:1$ mix with text and code, guiding data-coupled pre-training strategies. Empirical results show Hephaestus outperforming small- to medium-scale open-source LLMs and rivaling API-based commercial LLMs on multiple agent benchmarks, with strong cross-task generalization and preservation of general capabilities, highlighting the practical impact for open-source autonomous agents.
Abstract
Due to the scarcity of agent-oriented pre-training data, LLM-based autonomous agents typically rely on complex prompting or extensive fine-tuning, which often fails to introduce new capabilities while preserving strong generalizability. We introduce Hephaestus-Forge, the first large-scale pre-training corpus designed to enhance the fundamental capabilities of LLM agents in API function calling, intrinsic reasoning and planning, and adapting to environmental feedback. Hephaestus-Forge comprises 103B agent-specific data encompassing 76,537 APIs, including both tool documentation to introduce knowledge of API functions and function calling trajectories to strengthen intrinsic reasoning. To explore effective training protocols, we investigate scaling laws to identify the optimal recipe in data mixing ratios. By continual pre-training on Hephaestus-Forge, Hephaestus outperforms small- to medium-scale open-source LLMs and rivals commercial LLMs on three agent benchmarks, demonstrating the effectiveness of our pre-training corpus in enhancing fundamental agentic capabilities and generalization of LLMs to new tasks or environments.
