TL;DR
Large Language Models (LLMs) are increasingly used in real-world agentic applications, but their ability to follow complex, lengthy instructions in these scenarios is poorly understood. This paper introduces AGENTIF, the first benchmark specifically designed to evaluate LLM instruction following in realistic agentic tasks, revealing that current models struggle significantly, especially with complex constraints and tool specifications.
What Problem Does This Paper Address?
As LLMs are deployed in agentic roles (e.g., web agents, educational agents), they are tasked with executing complex instructions that often involve long system prompts and detailed specifications for tools. Unlike simpler instruction-following benchmarks, these agentic instructions are characterized by their length, complexity, and the presence of various constraint types, such as tool usage rules and conditional requirements. The critical question is whether current LLMs can reliably adhere to these intricate instructions, a capability fundamental to their successful deployment as agents. Existing benchmarks are often too short, synthetically generated, or lack the complexity of real-world agentic scenarios, creating a gap in our understanding of LLM performance in this domain.
Methods
The authors introduce AGENTIF, a novel benchmark for evaluating LLM instruction following in agentic scenarios. The construction of AGENTIF involved several key steps:
- Instruction Collection: 50 real-world agentic tasks were collected from industrial applications and open-source agentic systems. For each task, approximately 20 user queries were generated and then human-annotated to ensure realism and consistency with actual user cases.
- Constraint Taxonomy: Constraints were categorized into three main types:
- Formatting Constraints: Dictate output structure and presentation (e.g., syntax, layout).
- Semantic Constraints: Govern content accuracy, completeness, and style (e.g., keywords, tone).
-
Tool Constraints: Pertain to the invocation and specification of external tools. Constraints were also classified by their presentation type: Vanilla (direct), Conditional (triggered by specific conditions), and Example (implied through few-shot examples).
-
Dataset Construction: A semi-automated pipeline was used, involving block-wise constraint extraction and cross-block validation to handle the complexity of instructions.
- Evaluation Protocol: A hybrid evaluation framework was adopted, combining Code Evaluation (for verifiable constraints), LLM Evaluation (for subjective constraints), and Hybrid Evaluation (LLM-assisted code verification). Metrics include Constraint Success Rate (CSR) and Instruction Success Rate (ISR).
Datasets
The paper introduces AGENTIF, a new benchmark comprising 707 human-annotated instructions. These instructions are derived from 50 real-world agentic tasks, averaging 1,723 words in length (with a maximum of 15,630 words) and containing an average of 11.9 constraints per instruction. This dataset is notable for its realism, length, and complexity, differentiating it from prior benchmarks like IFEval, which are typically shorter and synthetically generated.
Key Insights and Ideas
- LLMs are surprisingly bad at following complex agentic instructions: The most striking finding is the universally poor performance of even advanced LLMs on AGENTIF. This highlights a significant gap between their general language capabilities and their ability to execute precise, multi-faceted instructions in practical scenarios.
- Condition and Tool Constraints are major stumbling blocks: The benchmark reveals that LLMs struggle disproportionately with conditional constraints (requiring them to first determine if a rule applies) and tool constraints (involving adherence to specific API calls and parameters). This suggests a need for targeted training data and methods to improve these specific abilities.
- Instruction length is a critical factor: Performance degrades significantly as instruction length increases, indicating that LLMs have difficulty maintaining focus and adhering to all constraints in very long prompts. This points towards the need for techniques to handle long contexts or to decompose complex tasks.
- Meta-constraints are a novel challenge: The paper identifies "meta-constraints" that govern other constraints (e.g., selection, prioritization). LLMs perform particularly poorly on constraint selection, suggesting that managing hierarchical or conflicting instructions is a complex task.
Key Results
- Suboptimal Performance Across the Board: Even the best-performing model achieved a Constraint Success Rate (CSR) of only 59.8%, and an Instruction Success Rate (ISR) of just 27.2%. GPT-40, for instance, saw a significant drop in performance compared to its results on simpler benchmarks like IFEval.
- Specific Constraint Failures: Models performed much worse on condition and tool constraints compared to vanilla constraints. For example, errors in condition checking accounted for over 30% of failures in handling conditional constraints.
- Impact of Instruction Length and Constraint Count: Model performance generally declined with increasing instruction length and the number of constraints. For instructions exceeding 6,000 words, the ISR scores for all models approached zero.
- Thinking Models vs. Instruction-Following Models: While "thinking" models generally performed better, models specifically trained for instruction following did not outperform others, suggesting that reasoning capabilities are crucial for complex agentic tasks.
Limitations and Future Work
- Limitations:
- The AGENTIF dataset is currently limited to Chinese and English, lacking broader multilingual coverage.
- All experiments were conducted in a zero-shot setting, without exploring prompt engineering techniques like in-context demonstrations.
- The dataset construction, while semi-automated, still required substantial manual verification.
- Future Work:
- Expand AGENTIF to support more languages.
- Explore prompt engineering techniques and automated methods for generating post-training data to improve instruction following.
- Investigate methods for decomposing long instructions into smaller, manageable sub-tasks.
- Develop strategies for LLMs to better handle conditional and tool constraints, and meta-constraints.
- Explore reinforcement learning approaches for enhancing instruction-following capabilities.
- Collect post-training data with long instructions, potentially from sources like technical manuals, to address the challenges posed by lengthy prompts.
Summary updated