paper-with-me

홈 › Papers

Think Twice Before You Act: Enhancing Agent Behavioral Safety with Thought Correction

2025-05-16 · Changyue Jiang, Xudong Pan, Min Yang

LLM-based autonomous agents possess capabilities such as reasoning, tool invocation, and environment interaction, enabling the execution of complex multi-step tasks. The internal reasoning process, i.e., thought, of behavioral trajectory significantly influences tool usage and subsequent actions but can introduce potential risks. Even minor deviations in the agent's thought may trigger cascading effects leading to irreversible safety incidents. To address the safety alignment challenges in long-horizon behavioral trajectories, we propose Thought-Aligner, a plug-in dynamic thought correction module. Utilizing a lightweight and resource-efficient model, Thought-Aligner corrects each high-risk thought on the fly before each action execution. The corrected thought is then reintroduced to the agent, ensuring safer subsequent decisions and tool interactions. Importantly, Thought-Aligner modifies only the reasoning phase without altering the underlying agent framework, making it easy to deploy and widely applicable to various agent frameworks. To train the Thought-Aligner model, we construct an instruction dataset across ten representative scenarios and simulate ReAct execution trajectories, generating 5,000 diverse instructions and more than 11,400 safe and unsafe thought pairs. The model is fine-tuned using contrastive learning techniques. Experiments across three agent safety benchmarks involving 12 different LLMs demonstrate that Thought-Aligner raises agent behavioral safety from approximately 50% in the unprotected setting to 90% on average. Additionally, Thought-Aligner maintains response latency below 100ms with minimal resource usage, demonstrating its capability for efficient deployment, broad applicability, and timely responsiveness. This method thus provides a practical dynamic safety solution for the LLM-based agents.

📄 PDF Abstract BibTeX arXiv:2505.11063

Code (1)

thu-coai/agent-safetybench 공식 구현

Tasks

Contrastive LearningSafety Alignment

Methods 이 논문이 사용한 방법론

Contrastive Learning 설명 없음

Similar Papers 제목 키워드 기반

ThinkTwice: Jointly Optimizing Large Language Models for Reasoning and Self-Refinement

2026-04-02 · Difan Jiao, Qianfeng Wen, Blair Yang, Zhenwei Tang 외 arxiv

We introduce ThinkTwice, a simple two-phase framework that jointly optimizes LLMs to solve reasoning problems and refine the answers, based on Group Relative Policy Optimization (GRPO). In each pair of training steps, Th…

Mathematical Reasoning

Think-then-Act: A Dual-Angle Evaluated Retrieval-Augmented Generation

2024-06-18 · Yige Shen, Hao Jiang, Hua Qu, Jihong Zhao

Despite their impressive capabilities, large language models (LLMs) often face challenges such as temporal misalignment and generating hallucinatory content. Enhancing LLMs with retrieval mechanisms to fetch relevant inf…

RetrievalRetrieval-augmented Generation

Think Twice before Adaptation: Improving Adaptability of DeepFake Detection via Online Test-Time Adaptation

2025-05-24 · Hong-Hanh Nguyen-Le, Van-Tuan Tran, Dinh-Thuc Nguyen, Nhien-An Le-Khac

Deepfake (DF) detectors face significant challenges when deployed in real-world environments, particularly when encountering test samples deviated from training data through either postprocessing manipulations or distrib…

DeepFake DetectionFace SwappingTest-time Adaptation

Think Twice Before Recognizing: Large Multimodal Models for General Fine-grained Traffic Sign Recognition

2024-09-03 · Yaozong Gan, Guang Li, Ren Togo, Keisuke Maeda 외

We propose a new strategy called think twice before recognizing to improve fine-grained traffic sign recognition (TSR). Fine-grained TSR in the wild is difficult due to the complex road conditions, and existing approache…

In-Context LearningTraffic Sign Recognition

TACT: Mitigating Overthinking and Overacting in Coding Agents via Activation Steering

2026-05-07 · Yuan Sui, Yulin Chen, Yibo Li, Xue Jiang 외 arxiv

When language model agents tackle complex software engineering tasks, they often degrade over long trajectories, which we define as *agent drift*. We focus on two recurring failure modes *overthinking* and *overacting*, …