AgentIF

Benchmarking Instruction Following of Large Language Models in Agentic Scenarios

🔥 2026-10 — Updated evaluation setting. AgentIF now evaluates models in both thinking and non-thinking modes with their vendor-recommended decoding parameters, over 3 independent runs, judged by gpt-5.6-luna, through a config-driven pipeline (run.sh + configs/). See Evaluation Setting and the new Leaderboard. Scores under the new setting are not comparable with those of the original setting.

Introduction

We introduce AgentIF, the first benchmark for systematically evaluating LLM instruction following ability in agentic scenarios. AgentIF features three key characteristics: (1) Realistic, constructed from 50 real-world agentic applications. (2) Long, averaging 1,723 words with a maximum of 15,630 words. (3) Complex, averaging 11.9 constraints per instruction, covering diverse constraint types, such as tool specifications and condition constraints. Below is the instruction length distribution in AgentIF, along with the success rates of several representative LLMs across the constraint dimensions we propose.
AgentIF overview

An example instruction of AgentIF:

AgentIF example

Dataset Statistics

Statistics of AgentIF and previous instruction-following benchmarks

The statistics of AgentIF and previous instruction-following benchmarks. The statistics include dataset size (#Inst.), average instruction length (#Len.), average number of constraints per instruction (#Cons.), data resource, constraint types, and supported evaluation methods.

Distribution of categories and application domains in AgentIF

Distribution of categories and application domains in AgentIF.

Evaluation Setting

The original setting (gpt-4o-2024-11-20 as the judge, greedy decoding with temperature 0 for the evaluated model, default mode only) no longer reflects how current models are released and used: vendors ship explicit thinking / non-thinking modes and recommended sampling parameters, and nobody deploys these models at temperature 0. To evaluate models the way they are actually used, we updated the setting as follows:

The exact parameters of every evaluated model are the committed configs/<model>.yaml files; the judge parameters are in judge_configs/gpt-5.6-luna.yaml.

Leaderboard

Constraint Success Rate (CSR) measures the proportion of individual constraints that are correctly satisfied by the model's response. Instruction Success Rate (ISR) measures the proportion of instructions for which all constraints are satisfied.

The current leaderboard covers small (1.5–4B), medium (>4–32B) and large (>32B) open-weight models; results for proprietary models will be added as they are evaluated.

Current setting

Judge gpt-5.6-luna; every (model, mode) is sampled 3 times independently with the vendor-recommended decoding parameters. [T] = thinking mode, [N] = non-thinking mode. CSR and ISR are mean ± sample std over the 3 runs; the remaining columns are the mean CSR per constraint presentation type (Vanilla / Condition / Example) and per constraint type (Formatting / Semantic / Tool). By default the table shows thinking-mode results sorted by CSR; use the dropdowns to change the sort metric, switch to non-thinking results, or filter by model size. Column headers are also clickable for sorting, and clicking a model opens its exact vLLM flags and sampling parameters.

Overall Presentation Type Constraint Type
# Model Size CSR ISR Vanilla Condition Example Formatting Semantic Tool
[T]DeepSeek-V4-ProLarge67.44 ± 0.5931.27 ± 1.5467.9451.7682.2472.7967.8553.38
[T]Qwen3.8-27BMedium65.77 ± 0.4131.35 ± 0.3666.9849.0377.3769.3867.1551.93
[T]Qwen3.8-FlashLarge65.59 ± 0.5927.35 ± 0.2266.0349.8980.8071.8266.1851.13
[T]Qwen3.5-9BMedium65.33 ± 0.2630.36 ± 0.5966.7348.5076.3869.4265.6053.80
[T]Kimi-K3Large64.89 ± 0.3526.12 ± 1.0866.3146.5675.9967.3966.9151.16
[T]Gemma-4-31B-itMedium64.79 ± 0.4229.80 ± 0.3364.5751.2982.1268.8966.1150.66
[N]Gemma-4-31B-itMedium64.67 ± 0.2326.12 ± 0.7364.3851.7082.0567.4466.2851.51
[T]GLM-5.3-FlashLarge64.43 ± 0.1924.89 ± 0.3765.9246.1675.9565.9768.1945.50
[T]GLM-5.3Large64.21 ± 0.2627.06 ± 1.0465.9145.3973.9566.4567.2547.18
[N]Qwen3.5-9BMedium63.56 ± 0.6626.45 ± 0.6265.2648.2870.5365.1365.4452.13
[N]Qwen3.8-FlashLarge63.39 ± 1.2229.56 ± 0.5164.1249.3474.9272.6160.8751.92
[T]Gemma-4-12B-itMedium63.16 ± 0.2627.82 ± 0.6464.5550.6668.9964.1565.6052.86
[N]Gemma-4-E4B-itSmall62.96 ± 0.8026.87 ± 0.1464.6450.7667.4365.1965.3448.87
[N]Gemma-4-12B-itMedium62.35 ± 0.5524.71 ± 0.7061.8951.2278.1363.0664.3454.46
[T]Qwen3.5-4BSmall62.34 ± 1.0926.54 ± 0.4163.3447.2573.3864.8663.4151.78
[N]Qwen3.8-27BMedium62.03 ± 0.6926.54 ± 0.2263.0550.0469.4664.6162.8553.52
[T]MiniMax-M2.7Large61.88 ± 0.2122.07 ± 0.7563.0648.8869.4265.5162.1053.41
[T]Gemma-4-E4B-itSmall61.65 ± 0.3925.70 ± 0.8062.1248.2474.6161.6863.8353.70
[T]Nemotron-Nano-9B-v2Medium61.17 ± 0.7425.66 ± 0.5561.4446.4575.9668.5458.0056.56
[T]Gemma-4-E2B-itSmall61.04 ± 0.1725.65 ± 1.2862.7147.6566.5764.1361.6651.12
[N]Qwen3.5-4BSmall60.98 ± 0.4822.96 ± 0.9462.7147.9464.9362.2862.9550.20
[N]Nemotron-Nano-9B-v2Medium60.39 ± 0.4324.99 ± 0.4161.0642.8374.3068.4257.0554.23
[N]Gemma-4-E2B-itSmall60.31 ± 0.7324.99 ± 1.1963.0045.2561.8561.4262.9946.76
[T]DeepSeek-R1-0528-Qwen3-8BMedium59.93 ± 0.1026.50 ± 0.5760.6347.0370.6662.9659.9652.83
[T]Granite-4.2-3BSmall58.78 ± 0.5528.95 ± 1.6662.9939.4253.0160.2358.9253.43
[N]Nemotron-3-Nano-4BSmall58.50 ± 0.3024.56 ± 0.2259.7839.1371.4068.9354.3747.94
[N]Ministral-3-3B-Instruct-2512Small55.93 ± 0.2619.28 ± 0.8557.8344.5557.6150.1760.0052.50
[T]Qwen3.5-2BSmall55.83 ± 0.1621.64 ± 0.9958.7842.2953.1259.0356.4544.76
[T]Nemotron-3-Nano-4BSmall55.60 ± 0.3525.08 ± 0.2958.5838.5854.9859.1053.7952.85
[N]Granite-4.2-3BSmall55.20 ± 0.3523.24 ± 0.8059.4137.9148.5151.7857.9150.95
[T]gpt-oss-20bMedium54.97 ± 0.3024.66 ± 0.7858.1945.9943.9551.1457.4955.55
[T]Hunyuan-4B-InstructSmall54.35 ± 0.1818.10 ± 0.2456.0138.7860.0157.9954.9744.14
[T]MiniCPM5-2BSmall54.21 ± 0.4521.92 ± 0.1455.8344.4754.9954.3555.3050.49
[T]Ministral-3-3B-Reasoning-2512Small53.82 ± 0.4520.51 ± 0.2855.4838.6159.5052.0755.2551.82
[N]MiniCPM5-2BSmall52.35 ± 0.8319.57 ± 0.2255.2744.4742.5752.1953.3149.99
[N]Qwen3.5-2BSmall50.10 ± 0.4116.31 ± 0.9053.7236.0143.6350.5950.1546.24
[N]Hunyuan-4B-InstructSmall43.93 ± 0.1710.23 ± 0.4346.4333.6139.0234.2250.6042.45

Success rates (%) on AgentIF under the current setting. Size groups follow total parameter count: Small Open = 1.5–4B, Medium Open = >4–32B, Large Open = >32B. Small and medium models are served locally with vLLM; large models are called through their official APIs with the same sampling parameters. The exact vLLM flags and sampling parameters of every row are the committed configs/<model>.yaml files.

Last Update: 2026-10-11

Legacy results — original setting (judge gpt-4o-2024-11-20, single greedy run)

Produced with the original protocol: judge gpt-4o-2024-11-20 with temperature 0, one greedy run per model, API models called with their default mode. Kept for reference only; not comparable with the table above. Click a model to download its full results, or browse the complete results repository.

Presentation Type Constraint Type Overall
# Model Vanilla Condition Example Formatting Semantic Tool ISR CSR
[T]o1-mini59.837.580.866.159.143.226.959.8
[N]GPT-4o58.035.180.865.856.543.226.458.5
[N]Qwen3-32B57.541.180.657.762.545.724.958.4
[T]QwQ-32B57.535.682.761.459.443.227.258.1
[T]DeepSeek-R156.141.487.061.458.944.422.257.9
[T]GLM-Z1-32B56.737.983.660.259.643.123.857.8
[N]DeepSeek-V354.941.584.559.358.940.821.956.7
[N]Claude-3-5-Sonnet57.336.969.261.556.043.324.956.6
[N]Meta-Llama-3.1-70B-Instruct55.135.084.361.655.642.820.956.3
[T]DeepSeek-R1-Distill-Qwen-32B54.539.673.155.757.245.220.755.1
[T]DeepSeek-R1-Distill-Llama-70B55.437.769.256.556.644.119.955.0
[N]Meta-Llama-3.1-8B-Instruct53.536.671.455.654.843.519.953.6
[S]Crab-DPO-7B48.324.357.548.847.441.910.147.2
[N]Mistral-7B-Instruct-v0.347.929.253.847.048.639.811.546.8
[S]Conifer-DPO-7B45.627.050.542.046.941.810.744.3

Success rates (%) of various proprietary and open-source LLMs on AgentIF under the original setting, sorted by CSR in descending order by default. [N] denotes non-thinking models, [T] denotes thinking models, and [S] denotes models explicitly designed for instruction following by the academic community. Last update of this table: 2025-06-10.

Performance across constraint categories reported in the paper (original setting):

Performance across constraint categories (original setting)

Analysis

The analyses below are from the paper and were produced under the original setting (judge gpt-4o-2024-11-20, single greedy run).

Error type analysis

Error proportions (%) on condition and tool constraints. (a) shows the errors in handling condition constraints, including condition check failure, where the model fails to recognize the condition, and constraint following failure. (b) shows the errors from tool constraints, including disallowed tool usage (utilizing explicitly prohibited tools), omission of required tools (failing to employ required tools), tool name errors (invoking non-existent or incorrect tools), and parameter errors (applying incorrect or illegal arguments).

Success rate versus instruction length and constraint count

Success rates on instructions with varying length or constraint counts. Gray lines show results of the top 6 models in the original leaderboard, and the colored lines present their average.

Meta-constraint success rates

(a) illustrates three types of meta constraints and examples. Most meta constraints fall within the Constraint Selection category, which requires models to follow one specific constraint. (b) presents the success rates of different investigated models on each meta constraint type.

Evaluation

For each instruction, we annotate the associated constraints and corresponding evaluation metrics, including code-based evaluation, LLM-based evaluation, and hybrid code-LLM evaluation. The evaluation pipeline is config-driven: run.sh starts vLLM for each local model, runs all (mode × run) predictions, and judges them on the API. See the GitHub repository for the full documentation.

How to evaluate

  1. Install. The dataset (data/eval.json, 707 instructions) is included; data/smoke/eval.json holds 5 instructions for a quick test.
    git clone https://github.com/THU-KEG/AgentIF.git && cd AgentIF
    pip install -r requirements.txt            # openai, pyyaml, requests, tqdm, ...
    pip install vllm                           # only for locally served models (vLLM >= 0.26 for the models in configs/)
  2. Configure. Put the judge key (and optionally a base URL and the local weights directory) in .env, then pick or add a model config in configs/.
    cp .env.example .env     # OPENAI_API_KEY (judge), optional OPENAI_BASE_URL, MODELS_DIR (local weights)
    • Local model (vLLM) — copy one of the shipped configs (e.g. configs/Qwen3.5-4B.yaml). Required keys: model_path, max_model_len, modes; vllm_args are passed to vllm serve verbatim.
    • API model — copy configs/api-model.example.yaml, set api.base_url / api.model, and put the key in the environment variable named by api.api_key_env.
    • Each entry under modes is evaluated separately with its own sampling parameters (enable_thinking: true/false, or extra_body for vendor-specific switches). Single-mode models list one mode only.
    Global behaviour (GPU pool, number of repeats, default judge, concurrency) lives in configs/global.yaml; judge endpoints and parameters in judge_configs/. To reproduce the leaderboard, use the shipped configs and the gpt-5.6-luna judge.
  3. Run.
    bash run.sh --list                                        # show configs
    bash run.sh --models Qwen3.5-4B --repeats 1 \
        --input-dir data/smoke --results-root results_smoke     # smoke test
    bash run.sh --models Qwen3.5-4B                           # full benchmark for one model
    nohup bash run.sh > logs/run.out 2>&1 &                   # every enabled config
    bash run.sh --stage prediction                            # predictions only
    bash run.sh --stage evaluation                            # judge existing predictions (no GPU)
    bash run.sh --judge gpt-4o-2024-11-20                     # another judge (judge_configs/<name>.yaml)
    Finished jobs are detected by their accuracy.json and interrupted judge jobs resume from results.partial.jsonl, so re-running the same command continues where it stopped.
  4. Results. Per-run predictions and scores are written under results/; results/summary.md reports mean ± std over runs for every (model, mode, judge).
    results/
      prediction/<model>__<mode>/run<N>/eval.json          # model responses + run_config.json
      scores/<model>__<mode>/run<N>_<judge>/eval/
          results.json                                      # per-constraint scores, judge outputs
          accuracy.json                                     # CSR, ISR, breakdowns by presentation / constraint type
      summary.md / summary.json                             # mean ± std over runs

Data Format

Each data instance in AgentIF is structured as follows:

{
  "input": [
    { "role": "system", "content": "..." },
    { "role": "user",   "content": "..." }
  ],
  "constraints": [
    {
      "id": 0,
      "desc": "...",                // Constraint description
      "other_info": {               // Auxiliary information for evaluation
        "...": "..."
      },
      "dimension": "...",           // Constraint Presentation Type
      "type": "...",                // Constraint Type
      "is_meta": false,             // Whether it is a meta-constraint
      "evaluation": [               // Evaluation Method
        {
          "type": "llm",            // LLM-based evaluation
          "required_keys": ["response"],
          "exec": "..."             // Evaluation prompt for LLM
        },
        {
          "type": "code",           // Code-based evaluation
          "exec": "..."             // Executable code snippet
        }
      ]
    }
  ]
}

Citation

@article{qi2026agentif,
  title={AGENTIF: Benchmarking large language models instruction following ability in agentic scenarios},
  author={Qi, Yunjia and Peng, Hao and Wang, Xiaozhi and Xin, Amy and Liu, Youfeng and Xu, Bin and Hou, Lei and Li, Juanzi},
  journal={Advances in Neural Information Processing Systems},
  volume={38},
  year={2026}
}

License

The dataset is released under the Creative Commons Attribution 4.0 International (CC BY 4.0) License.

The code in the AgentIF repository is released under the Apache License 2.0.