{"slug": "how-do-you-build-agent-trajectory-datasets-for-post-training", "title": "How do you build agent trajectory datasets for post-training?", "summary": "Building agent trajectory datasets for post-training should preserve failed attempts and dead ends as negative examples, since datasets of only \"golden paths\" produce brittle agents that cannot recover from errors, according to guidance recommending the OpenAI messages format as a baseline. The recommended structure extends the assistant message with a `tool_calls` list and adds a `tool_outputs` list to a subsequent `tool` role message, while tracking the original `task_description`, the full `tool_definitions`, and a final `outcome` status such as `success` or `failure`. The guidance cites the ToolBench dataset and its \"ToolLLM\" paper as a comprehensive reference for instruction generation, solver-model response generation and evaluation, and names the GAIA benchmark as an example of complex multi-step tasks requiring robust trajectories for training and evaluation.", "body_md": "The OpenAI messages format is a solid baseline. It’s common to extend it by adding a `tool_calls` list to the assistant message and a `tool_outputs` list to a subsequent `tool` role message. For metadata, track the original `task_description`, the full `tool_definitions` available, and a final `outcome` status (e.g., `success`, `failure`). This structure is flexible and maps well to most inference APIs.\n\nDefinitely keep failed attempts and dead ends; they are your most valuable negative examples. A dataset of only “golden paths” produces brittle agents that can’t recover from errors. For generation, model-generated trajectories with human review and correction is the most scalable approach. Purely human-authored data is too slow and expensive for large-scale SFT or preference tuning.\n\nThe ToolBench dataset and its accompanying paper (“ToolLLM”) are a comprehensive reference. They detail a full pipeline for instruction generation, response generation with a solver model, and evaluation. The GAIA benchmark is another good example of complex, multi-step tasks requiring robust trajectories for both training and evaluation.", "url": "https://wpnews.pro/news/how-do-you-build-agent-trajectory-datasets-for-post-training", "canonical_source": "https://discuss.huggingface.co/t/how-do-you-build-agent-trajectory-datasets-for-post-training/192530#post_2", "published_at": "2026-11-25 11:05:23+00:00", "updated_at": "2026-11-25 11:12:30.020326+00:00", "lang": "en", "topics": ["ai-agents", "large-language-models", "ai-research"], "entities": ["OpenAI", "ToolBench", "ToolLLM", "GAIA"], "also_reported_by": [], "takeaway": "Keep failed attempts and dead ends in agent trajectory datasets as negative examples, and store each trajectory in the OpenAI messages format with a `tool_calls` list on the assistant message, a `tool_outputs` list on the `tool` role message, plus `task_description`, `tool_definitions` and an `outco", "recommendation": {"advice": "Retain failed trajectories and dead ends as negative examples when building SFT or preference-tuning data, and use model-generated trajectories with human review rather than purely human-authored data to scale.", "playbook": "training-data", "playbook_url": "https://wpnews.pro/playbooks/training-data"}, "alternates": {"html": "https://wpnews.pro/news/how-do-you-build-agent-trajectory-datasets-for-post-training", "markdown": "https://wpnews.pro/news/how-do-you-build-agent-trajectory-datasets-for-post-training.md", "text": "https://wpnews.pro/news/how-do-you-build-agent-trajectory-datasets-for-post-training.txt", "jsonld": "https://wpnews.pro/news/how-do-you-build-agent-trajectory-datasets-for-post-training.jsonld"}}