Diagnosing Task Insensitivity in Language Agents

Jingyu Liu, Xiaopeng Wu, Kehan Chen, Chuan Yu, Yong Liu
6/25/2026
cs.AI

No confident code implementation found for this paper. 1 possible match can be shown below.

Abstract

Large language models can serve as capable long-horizon agents, but their out-of-distribution (OOD) generalization remains weak. We identify a key source of this failure as task insensitivity: when faced with similar but distinct tasks, models might apply patterns learned during training and fail to solve the task at hand. We show that models often continue with actions aligned with the original task even when the instruction is semantically corrupted and cannot be directly answered. We further find that, when we replace the task description in a trained prompt with another similar but distinct task, the model may still output the same action. This behavior is accompanied by a consistent training-time attention drift away from task tokens and toward local observations, suggesting an optimization bias toward shortcuts. To mitigate this problem, we propose Task-Perturbed NLL Optimization, a lightweight contrastive regularizer that explicitly encourages action dependence on the task instruction. Extensive evaluations show that our intervention improves task sensitivity and OOD generalization while preserving more stable attention to task tokens.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 1 weaker match is hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{liu2026diagnosing,
  title  = {Diagnosing Task Insensitivity in Language Agents},
  author = {Jingyu Liu and Xiaopeng Wu and Kehan Chen and Chuan Yu and Yong Liu},
  year   = {2026},
  eprint = {2606.26918},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2606.26918v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2606.26918.svg)](https://codeofpaper.com/paper/2606.26918)

Discussion