Hugging Face and Lambda: How to Parse and Fine-Tune on Agent Reasoning Traces
MarkTechPost walked through the lambda/hermes-agent-reasoning-traces dataset on Hugging Face and showed a complete pipeline for working with agent reasoning traces. The tutorial covers parsing think, tool_call and tool_response blocks, analytics on dialogue length and errors, visualizations, and data preparation for supervised fine-tuning. It also includes a demonstration training loop on a small subset and a ready foundation for your own eval pipelines.
AI-processed from MarkTechPost; edited by Hamidun News
MarkTechPost has published a practical walkthrough of the lambda/hermes-agent-reasoning-traces dataset, which helps researchers study how AI agents think, call tools and respond in multi-step dialogues. It is not a new model release but a ready-to-use working pipeline: from parsing raw traces to analytics, charts and preparing data for fine-tuning.
What is inside the dataset
The piece centers on a Lambda dataset on Hugging Face with two configurations: kimi and glm-5.1. The first has 7646 examples, the second 7055. Each example contains a list of messages, a description of the available tools, a task category, a subcategory and the original user request. The format is close to ShareGPT: a dialogue includes system, user, agent and tool messages, so a single record lets you reconstruct almost the entire course of the agent's work.
"Each example is a real agentic dialogue with step-by-step reasoning
and real results of tool calls."
The dataset's main value is that it contains not only the final answer but also the intermediate steps. The kimi configuration averages 24.3 turns and 13.9 tool calls per example; glm-5.1 averages 19.1 turns and 9.7 calls. The set has nine categories in total, including Terminal & Coding, Agent Tools, Repository Tasks, Browser Automation and File Operations. In other words, these are not toy prompts but real scenarios in which an agent writes code, browses the web, works with files and calls external functions.
How the analysis works
The authors start with a basic inspection of the train split using the datasets library: they look at fields, categories and a single example. They then build regular-expression parsers to extract reasoning blocks, function calls and tool responses separately. This step breaks one agent trajectory into clear parts, so the internal chain of thought, the actions and the final reply can be analyzed separately.
- Thoughts, tool calls and final text are extracted from agent messages
- JSON parsing errors are flagged separately so they do not break the pipeline
- Dialogue length, number of calls and error frequency are computed over a sample
- Charts are built for popular tools, parallel calls and category distribution
On a sample of 3000 trajectories, the guide computes averages and visualizes them with matplotlib. It also shows how to print one full trace in readable form: where the user request was, where the agent reasoned, which tool it called and what the tool returned. For teams that evaluate agents, this is especially useful: instead of a single final score, you can see real behavior patterns, redundant calls, empty thoughts and recurring errors in tool responses.
Preparing for training
In the second half, the material moves from analytics to ML practice. Dialogues are converted into a message format compatible with chat models and typical training pipelines, and tool responses are repackaged as input context for the next step. Tokenization and label masking follow: only assistant-message tokens count toward the loss, and everything else is masked. This is an important foundation for supervised fine-tuning when the goal is to teach a model to respond and act based on an already completed trajectory.
The authors also add a small trace replayer that plays back agent behavior step by step, and a demonstration training loop using TRL. The example uses the Qwen2.5 tokenizer and a small train subset, so it is more a template than a ready-made production recipe. But that is the strength of the material: you can run it quickly, swap the config, add your own metrics and get a basic lab for analyzing agent traces without lengthy setup or extra infrastructure.
What this means
The market is gradually shifting from evaluating only the final answer to analyzing the full behavior of an AI agent. Datasets and guides like this give teams a practical way to look not only at what a model answered, but at how exactly it reasoned, made mistakes, called tools, and what it should be fine-tuned on next.
- Nov 1, 2026Local models lose to Opus and Codex: 0.21 on a MacBook versus 1.00 for Codex
- Nov 1, 2026Pika Labs releases open video model H3 Flex: 6 steps instead of 50
- Nov 1, 2026Hugging Face's BERT Tokenizer Gets a 50x Speedup by Skipping Needless Work on ASCII
- Nov 1, 2026Illinois compiled 12 151 open problems and tested whether AI can solve them
Key Questions Answered
What is inside the dataset?
The piece centers on a Lambda dataset on Hugging Face with two configurations: kimi and glm-5.1. The first has 7646 examples, the second 7055. Each example contains a list of messages, a description of the available tools, a task category, a subcategory and the original user request. The format is close to ShareGPT: a dialogue includes system, user, agent and tool messages, so a single record lets you reconstruct almost the entire course of the agent's work. "Each example is a real agentic dialogue with step-by-step reasoning and real results of tool calls." The dataset's m
How the analysis works?
The authors start with a basic inspection of the train split using the datasets library: they look at fields, categories and a single example. They then build regular-expression parsers to extract reasoning blocks, function calls and tool responses separately. This step breaks one agent trajectory into clear parts, so the internal chain of thought, the actions and the final reply can be analyzed separately. Thoughts, tool calls and final text are extracted from agent messages JSON parsing errors are flagged separately so they do not break the pipeline Dialogue length, numbe
What are the key details on Preparing for training?
In the second half, the material moves from analytics to ML practice. Dialogues are converted into a message format compatible with chat models and typical training pipelines, and tool responses are repackaged as input context for the next step. Tokenization and label masking follow: only assistant-message tokens count toward the loss, and everything else is masked. This is an important foundation for supervised fine-tuning when the goal is to teach a model to respond and act based on an already completed trajectory. The authors also add a small trace replayer that plays ba
Build & Ship Production AI Agents Without Boilerplate Code
Start your free 72-hour trial at Hamidun Academy (academy.hamidun.com) — interactive lessons on Claude Code & Cursor, live Tech Radar, and production agent templates.
The AI world, distilled — once a week
Seven stories that actually mattered, hand-picked. No noise, no reposts, no press releases.
Done! Check your inbox for a confirmation.