HyperAIHyperAI

Command Palette

Search for a command to run...

From Failure to Mastery: Generating Hard Samples for Tool-use Agents

Abstract

The advancement of LLM agents with tool-use capabilities requires diverse and complex training corpora. Existing data generation methods, which predominantly follow a paradigm of random sampling and shallow generation, often yield simple and homogeneous trajectories that fail to capture complex, implicit logical dependencies. To bridge this gap, we introduce HardGen, an automatic agentic pipeline designed to generate hard tool-use training samples with verifiable reasoning. Firstly, HardGen establishes a dynamic API Graph built upon agent failure cases, from which it samples to synthesize hard traces. Secondly, these traces serve as conditional priors to guide the instantiation of modular, abstract advanced tools, which are subsequently leveraged to formulate hard queries. Finally, the advanced tools and hard queries enable the generation of verifiable complex Chain-of-Thought (CoT), with a closed-loop evaluation feedback steering the continuous refinement of the process. Extensive evaluations demonstrate that a 4B parameter model trained with our curated dataset achieves superior performance compared to several leading open-source and closed-source competitors (e.g., GPT-5.2, Gemini-3-Pro and Claude-Opus-4.5). Our code, models, and dataset will be open-sourced to facilitate future research.

One-sentence Summary

The author, affiliated with the University of Michigan, proposes a novel quasi-Newton method based on the parameterization framework to directly compute subharmonic periodic orbits (SPOs) and their Floquet vectors and multipliers in perturbed 4D symplectic maps, enabling efficient continuation in ε and Taylor parameterization of associated weak manifolds—offering significant improvements over multi-shooting methods and demonstrating utility in modeling resonant orbits within 2.5 DOF Hamiltonian systems, such as those arising in celestial mechanics.

Key Contributions

  • This paper addresses the challenge of computing long, unstable subharmonic periodic orbits (SPOs) in perturbed 2.5 degree-of-freedom Hamiltonian systems—such as stroboscopic maps of periodically perturbed 2 DOF flows—where these orbits arise from resonant tori in the unperturbed system and are critical for understanding the breakdown of invariant tori via resonance overlap.

  • The authors introduce a novel quasi-Newton method that simultaneously computes SPOs, their Floquet multipliers, and Floquet vectors by adapting the parameterization method framework to periodic orbits, enabling efficient continuation in the perturbation parameter ε while avoiding the costly O(q3)O(q^3)O(q3) linear solves typical of traditional multiple-shooting approaches.

  • The method is demonstrated on real celestial mechanics problems, including resonant orbits in the Jupiter-Europa-Ganymede system, and enables the subsequent computation of Taylor parameterizations for the weak stable and unstable manifolds of these SPOs, providing a powerful tool for studying global dynamics in high-dimensional symplectic systems.

Introduction

The authors address the challenge of computing long, unstable periodic orbits—known as subharmonic periodic orbits (SPOs)—in 4D symplectic maps that arise from periodically perturbed 2 DOF Hamiltonian systems, such as the planar circular restricted 4-body problem in celestial mechanics. These orbits are critical for understanding the breakdown of invariant tori due to secondary resonances, especially when perturbations cause separatrices from long-period orbits to intersect, leading to chaotic dynamics. Prior methods rely on multiple-shooting algorithms that require solving large 4q×4q4q \times 4q4q×4q linear systems to find both the orbit points and their stability properties, resulting in O(q3)O(q^3)O(q3) computational complexity—prohibitive for large qqq. The authors’ main contribution is a novel fast multiple-shooting method that simultaneously computes SPOs and their Floquet vectors and multipliers by adapting the parameterization method to periodic orbits. This approach avoids solving large linear systems by embedding the Floquet equations directly into the Newton iteration, reducing computational cost and enabling direct access to stability information. The method is applicable to a broad class of 4D symplectic maps and has been successfully applied to compute SPOs and their separatrices in real-world models of the Jupiter-Europa-Ganymede and Uranian systems, demonstrating its utility in space mission design and dynamical systems analysis.

Method

The authors develop a quasi-Newton method for the simultaneous computation of subharmonic periodic orbits (SPOs) and their associated Floquet vectors and multipliers within a family of 4D symplectic maps FεF_\varepsilonFε. This framework is designed to study the persistence of SPOs from an unperturbed map F0F_0F0 into a perturbed system, enabling numerical continuation with respect to the perturbation parameter ε\varepsilonε. The method is an adaptation of the parameterization method for invariant tori, but is uniquely tailored to compute periodic orbits directly. The core of the algorithm involves solving a system of equations for the SPO points Xε(k)X_\varepsilon(k)Xε(k), k=0,,q1k=0,\ldots,q-1k=0,,q1, and the matrices Pε(k)P_\varepsilon(k)Pε(k) and Λε(k)\Lambda_\varepsilon(k)Λε(k) that represent the Floquet vectors and multipliers. The invariance equation for the SPO is Fε(Xε(k))=Xε(k+1modq)F_\varepsilon(X_\varepsilon(k)) = X_\varepsilon(k+1 \mod q)Fε(Xε(k))=Xε(k+1modq), while the Floquet equation is DFε(Xε(k))Pε(k)=Pε(k+1modq)Λε(k)DF_\varepsilon(X_\varepsilon(k))P_\varepsilon(k) = P_\varepsilon(k+1 \mod q)\Lambda_\varepsilon(k)DFε(Xε(k))Pε(k)=Pε(k+1modq)Λε(k). The matrix Λε(k)\Lambda_\varepsilon(k)Λε(k) is constrained to a near-diagonal form, with the stable and unstable multipliers λs(k)\lambda_s(k)λs(k) and λu(k)\lambda_u(k)λu(k) on the diagonal, and the internal dynamics multipliers λ1\lambda_1λ1 and λ2\lambda_2λ2 in the top-left block, which may include an off-diagonal term TTT. This structure allows the system of equations to be decoupled into a series of 1D linear problems, which are solved efficiently using fixed-point iteration or explicit formulas, depending on the spectral properties of the multipliers. The method proceeds by first initializing the solution for ε=0\varepsilon=0ε=0 using the known unperturbed SPO and its monodromy matrix, and then numerically continuing this solution to ε>0\varepsilon>0ε>0 through a series of quasi-Newton steps. Each step involves correcting the SPO points XXX and the Floquet matrices PPP and Λ\LambdaΛ to reduce the residual errors E(k)E(k)E(k) and Ered(k)E_{red}(k)Ered(k), which measure the violation of the invariance and Floquet equations, respectively. The correction for XXX is derived from a linearized equation for the correction vector ξ(k)\xi(k)ξ(k), while the correction for PPP and Λ\LambdaΛ is derived from a similar equation for Q(k)Q(k)Q(k) and ΔΛ(k)\Delta\Lambda(k)ΔΛ(k). After each correction, a Schur decomposition is applied to the updated Λc(k)\Lambda_c(k)Λc(k) to ensure it maintains the required near-diagonal form, which is crucial for numerical stability. The resulting SPO and Floquet vectors are then used to compute Taylor parameterizations of the SPO's weak stable and unstable manifolds, if they exist.

Experiment

  • Computed secondary resonant periodic orbits (SPOs) and their separatrices in the CCR4BP models of Jupiter-Europa-Ganymede and Uranus-Titania-Oberon systems using numerical continuation and the parameterization method.
  • Successfully continued SPOs with frequency ratios ω/(2π) = 11/34, 34/105, 23/71, 35/108, 12/37, 25/77, 37/114, and 45/139 in the Jupiter-Europa-Ganymede CCR4BP (ε = 2.5265 × 10⁻⁵), where invariant tori failed to persist due to resonance overlap.
  • Detected intersections of separatrices from consecutive SPOs in both systems, confirming the dynamical mechanism of torus destruction in regions with ω < 2.04047 (Jovian) and similar low-frequency ranges (Uranian).
  • Achieved accurate computation of separatrices using the parameterization method with Floquet directions, enabling visualization of nonlinear structures in action-angle-like coordinates.
  • All computations performed in Julia with OrdinaryDiffEq.jl, TaylorSeries.jl, and TaylorIntegration.jl; numerical integration used DP8 adaptive step size method; SPOs computed with 10⁻⁷ tolerance and step sizes Δε = 5 × 10⁻⁷ to 10⁻⁶.

Build AI with AI

From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.

AI Co-coding
Ready-to-use GPUs
Best Pricing

HyperAI Newsletters

Subscribe to our latest updates
We will deliver the latest updates of the week to your inbox at nine o'clock every Monday morning
Powered by MailChimp