Tencent-Hunyuan/AppCIF-Bench
Python
Captured source
source ↗Tencent-Hunyuan/AppCIF-Bench
Language: Python
License: NOASSERTION
Stars: 0
Forks: 0
Open issues: 0
Created: 2026-11-05T08:07:26Z
Pushed: 2026-11-05T13:29:54Z
Default branch: main
Fork: no
Archived: no
README:
🌐 Website • 📂 Dataset
🔔 News
- [2026] AppCIF-Bench has been accepted to NeurIPS 2026! 🎉
- [2026] The evaluation code, Code Simulation Engines, and dataset (Chinese and English) are released. 🚀
📖 Introduction
Complex Instruction Following (CIF) underpins the deployment of large language models (LLMs) in production-grade applications. It demands stable, precise outputs across long horizons, deeply nested rules, and multi-turn interactions, yet predominantly atomic, short-horizon benchmarks miss this real-world logical depth and distractor pressure.
AppCIF is the first application-level CIF benchmark. It stratifies difficulty along two axes: **Horizon Length (*H*), the span over which distractors accumulate and critical signals must be tracked, and Logical Depth (*L*), the depth of nested rules. Its Prompt-as-Environment** paradigm pairs complex system prompts (~14k words at L4) with executable Code Simulation Engines (~3.5k lines of Python on average) to sustain rigorous state-machine deduction.
Across 12 evaluated LLMs, Hard Satisfaction Rate ranges from only 1.1% to 45.9%, exposing bottlenecks in long-horizon, distractor-laden instruction execution.
🧩 Benchmark Details
AppCIF contains 466 samples and 3,017 atomic rubrics across five application scenarios and four complexity levels, in Chinese and English. The counts below refer to the released version (v1.1); the paper reports the initial version with 2,998 rubrics (see [Version notes](#-version-notes)).
| Scenario | L1 | L2 | L3 | L4 | Total | | :--- | :---: | :---: | :---: | :---: | :---: | | Curriculum Planning | 38 | 38 | 0 | 0 | 76 | | Travel Planning | 25 | 17 | 8 | 0 | 50 | | Numeric-Intensive | 23 | 0 | 23 | 0 | 46 | | Role-Playing | 27 | 16 | 11 | 0 | 54 | | Real-world Simulation | 21 | 49 | 80 | 90 | 240 | | Total samples | 134 | 120 | 122 | 90 | 466 | | Total rubrics | 730 | 688 | 803 | 796 | 3,017 |
The 240 Real-world Simulation samples cover six sub-scenarios of 40 samples each: Concert Budgeting, Tomb Exploration, TCM Diagnosis, Case Adjudication, Power Grid Dispatch, and Time-Space Trading.
| Level | Name | Pressure | | :--- | :--- | :--- | | L1 | Precise Execution | Short *H*, few-step *L* | | L2 | Multi-turn Goal Retention | Long *H* with local distractors, multi-step *L* | | L3 | Information Reorganization Under High Noise | Long *H* with global distractors, multi-step *L* | | L4 | Extreme Pressure Deduction | Extreme *H*, deep multi-step *L* |
Models are scored with two metrics under an LLM-as-a-judge protocol:
- SSR (Soft Satisfaction Rate): the share of all rubrics that are satisfied.
- HSR (Hard Satisfaction Rate): the share of samples with every rubric satisfied.
🛠️ Quick Start
1. Install
Python 3.10 or later is required.
git clone https://github.com/Tencent-Hunyuan/AppCIF-Bench.git cd AppCIF-Bench pip install -r requirements.txt
2. Dataset
The dataset is in [data/](data/): AppCIF_bench_dataset.jsonl (Chinese) and AppCIF_bench_dataset_en.jsonl (English), 466 samples each, with the same IDs and the same rubrics per sample. Each sample contains the system prompt, the earlier dialogue turns (history), the final question, its rubrics, and its scenario, category and difficulty level; the Chinese file also includes the ground-truth derivation behind the rubrics.
For Chinese–English comparisons, cross_lingual_strata.json lists 18 Role Playing samples to report separately, because they require Chinese-specific output or carry a constraint tied to the language of the prompt; the other 448 samples are directly comparable.
3. Run an evaluation
Set the API key of each model you evaluate, and ARK_API_KEY for the default judge (Doubao-Seed-2.0-lite), in the environment or in a .env file. Endpoints, request parameters and key names are listed in [eval/model_registry.py](eval/model_registry.py); to use other models, including local ones, see [Use your own models](#4-use-your-own-models).
The commands below evaluate the Chinese file; run them on the English file the same way. Re-running a command resumes where it stopped and retries failed samples. A missing API key, or a key, permission or model name rejected by the provider, stops the command at once.
Step 1: Collect model answers.
python run_eval.py pull_answer \ --data_file data/AppCIF_bench_dataset.jsonl \ --model_name Doubao-Seed-2.0-Pro-high \ --output_dir results \ --concurrency 20
Step 2: Judge the answers. The judge checks each rubric separately, given only the rubric, the final question and the answer (prompt in [eval/eval_pipeline.py](eval/eval_pipeline.py)). Use --eval_model to change the judge.
python run_eval.py evaluate \ --data_file data/AppCIF_bench_dataset.jsonl \ --model_name Doubao-Seed-2.0-Pro-high \ --answers_file results/answers_Doubao-Seed-2.0-Pro-high.jsonl \ --output_dir results \ --concurrency 20
Step 3: Compute SSR and HSR. Samples without an answer or a judgment count as failures. If you changed the judge, pass the same --eval_model here.
python run_eval.py calculate_accuracy \ --data_file data/AppCIF_bench_dataset.jsonl \ --model_names Doubao-Seed-2.0-Pro-high \ --eval_dir results \ --output_dir results
Scores by level and by category are written to results/accuracy_summary.xlsx (the constraint_* columns are SSR and the sample_* columns are HSR), and per-rubric verdicts to results/results_tagged.jsonl.
4. Use your own models
To answer or judge with a model that is not in the registry, such as a local model, register it in a Python file and pass the file with --models_file to pull_answer and evaluate. A model is either an OpenAI-compatible endpoint (vLLM, SGLang, Ollama, a gateway, ...) or a Python function that takes the messages in OpenAI format and returns the reply text:
# my_models.py
from eval.model_registry import register_model
# OpenAI-compatible endpoints: model_id defaults to the name; without api_key_env no key is needed
register_model("Qwen3-32B-local", base_url="http://localhost:8000/v1", model_id="Qwen/Qwen3-32B")
register_model("my-judge",...Excerpt shown — open the source for the full document.