Dependency-aware method improves learning for terminal command agents

Credit Where It Matters: Dependency-Aware Policy Optimization for Terminal Agents

Artificial Intelligence

Summary

When computer programs learn to complete tasks step by step, some steps depend on what happened before. The authors found that current learning methods don’t always figure out which earlier steps actually matter for success. They created a new technique that tracks how commands depend on each other and uses this to better give credit to important steps. This helps the learning program get better at complex tasks and makes training more stable.

What this means in practice

  • For software developers: Improve automation scripts that learn to code or debug by better attributing success to critical commands within complex multi-step processes.
  • For cloud operations teams: Enhance tools that automatically troubleshoot terminal or shell-based tasks by more accurately determining which steps impact final results.

Authors

Yu Li, Guangfeng Cai, Long-Fei Li, Shuo Han, Shengtian Yang, Han Luo, Kaibing Yang, Lei Feng

Abstract

Terminal-using agents benefit from reinforcement learning (RL) in coding, debugging, and other multi-step terminal tasks. In these tasks, later commands often depend on information or intermediate results produced by earlier commands. However, existing trajectory-level and step-level credit assignment methods do not explicitly trace the read-write dependencies through which commands affect the final outcome. Consequently, training signals could still be assigned to irrelevant operations, weakening learning from relevant steps. In this paper, we propose Dependency-Aware Group Policy Optimization (DepGPO), which uses execution dependencies between commands to guide credit assignment for terminal agents. Specifically, we construct a command dependency graph from execution traces and trace backward from the resources inspected by the task verifier. We then assign credit to relevant writes and their supporting reads along these paths, and use it to redistribute trajectory advantages across steps. Extensive comparative experiments and ablation studies demonstrate that DepGPO improves task performance and training stability on complex terminal tasks.