What Do Agents Learn from Trajectory-SFT: Semantics or Interfaces?

Weizheng Gu, Chengze Li, Zhuohao Yu, Mengyuan Sun, Zhibang Yang, Wei Wang, Hongrui Jia, Shikun Zhang, Wei Ye

Executive Summary

When Large Language Models (LLMs) are fine-tuned on expert trajectories to act as interactive agents, are they genuinely learning how to use tools, or are they simply memorizing the names of the buttons? This paper introduces PIPE (Perturb Interface Protocol for Evaluation), a diagnostic protocol revealing that many agents rely heavily on "interface shortcutting"—memorizing specific action names rather than developing semantic understanding. By minimally renaming tools (e.g., changing search to find), the authors demonstrate that fine-tuned agents often suffer massive performance collapses, highlighting a critical lack of robustness in current agent training paradigms.

The Problem: Conflating Success with Understanding

LLMs are increasingly deployed as interactive agents that utilize tools like APIs, web browsers, and databases to solve multi-turn tasks. To optimize their performance, researchers typically employ Trajectory-SFT (Supervised Fine-Tuning), training a model on "gold" sequences of actions performed by a teacher model, such as GPT-4.

The fundamental issue is that standard benchmarks evaluate agents primarily on Success Rate. If an agent completes a task, it is assumed to have understood it. However, the authors argue that task success can stem from two qualitatively distinct mechanisms:

  1. Semantic Learning: The agent comprehends the tool's function based on its semantic description and applies it appropriately.
  2. Interface Shortcutting: The agent memorizes surface-level interaction patterns (e.g., "In this environment, I always start by calling the function named search").

Because both strategies yield identical success rates on standard benchmarks, these metrics alone cannot confirm whether an agent has acquired environment-invariant capabilities or merely become proficient at rote memorization.

Methodology: Diagnosing Interface Reliance

To disentangle semantic understanding from memorization, the authors propose two novel diagnostic tools:

1. PIPE (Perturb Interface Protocol for Evaluation)

PIPE acts as a protocol-level stress test. It minimally rewrites an environment's interface while preserving the underlying logic, tasks, and observations. The protocol employs two types of perturbations:

  • Synonym-based: Replaces action names with semantically similar words (e.g., click becomes press).
  • Symbol-based: Replaces action names with meaningless tokens (e.g., search becomes z1).

If an agent relies on semantic understanding, it should read the updated tool descriptions and adapt. If it relies on interface shortcuts, its performance will degrade.

2. Interface Reliance (IR) Metric

The authors also introduce a "dual-interface" environment where every action has two valid aliases: the original name and a synonym. They measure the ratio of how often the agent selects the original name versus the synonym. An IR score > 1 indicates a preference for the training-time interface, providing a quantifiable measure of shortcutting.

Key Findings and Insights

The study evaluates a diverse range of agents across 16 environments from two major benchmarks, AgentBench and AgentGym, introducing perturbed versions named AgentBenchPlus and AgentGymPlus.

The "Shortcut" Trap and Performance Collapse

Trajectory-SFT proves to be a double-edged sword. While it significantly boosts scores on original benchmarks, it often amplifies a model's reliance on specific interface names. Under PIPE perturbations, Trajectory-SFT agents exhibited massive performance gaps compared to non-fine-tuned models. For instance, in the WebShop environment, the AgentLM-14b model dropped from a 61.2% success rate to a mere 4.4% when the interface was perturbed.

Extreme Reliance and Hallucinated Actions

In the ALFWorld environment, fine-tuned agents demonstrated an extreme Interface Reliance (IR) score of 15.5. This means they almost exclusively used the original action names, ignoring perfectly valid synonyms. Furthermore, when interfaces change, brittle agents do not just fail gracefully; they "hallucinate" legacy actions. If click is renamed to press, a shortcutting agent will repeatedly attempt to call click, even after the environment returns an invalid action error.

Environment Pressure and Training Dynamics

Shortcutting behavior is highly environment-dependent:

  • High-Pressure Environments: Environments with many tools, complex logic, and limited training data force models to rely on shortcuts because mastering the full semantics is too difficult.
  • Loose Environments: Environments with fewer tools and abundant data allow models the capacity to learn underlying meanings.

Interestingly, interface shortcutting exhibits non-monotonic training dynamics. An agent’s reliance on shortcuts often peaks early in training. With continued training, some models begin to recover and learn true semantics—a progression that remains entirely invisible if evaluated solely on standard success rates.

The Robustness of API Models

Proprietary, API-based models like GPT-4o-mini generally exhibited much lower IR scores and remained significantly more stable under PIPE perturbations. This suggests that broad, general-purpose instruction tuning fosters better semantic grounding than task-specific trajectory cloning.

Mitigation and Future Directions

The authors demonstrate that Diversity-Augmented Training—training on a mix of different interface aliases—can significantly reduce interface reliance and improve an agent's ability to generalize to novel environments.

However, the study notes several limitations for future exploration. The current scope of perturbations primarily focuses on renaming actions, leaving other dimensions like observation structure (JSON vs. HTML) or argument ordering largely unexplored. Additionally, while this research focuses on Supervised Fine-Tuning, future work must investigate whether Reinforcement Learning (RL) agents develop similar interface shortcuts. Ultimately, building truly interface-agnostic agents will require more sophisticated methods, such as curriculum learning and enhanced tool-description prompting.

Summary updated

BibTeX
@inproceedings{gu2026what,
  author = {Weizheng Gu and Chengze Li and Zhuohao Yu and Mengyuan Sun and Zhibang Yang and Wei Wang and Hongrui Jia and Shikun Zhang and Wei Ye},
  title = {{What Do Agents Learn from Trajectory-SFT: Semantics or Interfaces?}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=u1i3XoSXQG},
}
Figure