SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2403.03514 · 2024

CLongEval: A Chinese Benchmark for Evaluating Long-Context Large Language Models

arXiv · PDF · Open in the Atlas

Code that ran

7 of 7 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 6 failures of our instrument; 0 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2403.03514.json · badge: /api/ran/2403.03514.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
zexuanqiu/clongeval canonical (classifier label)
classifier basis: census
7 ran · 0 no recorded run
FunctionStatusWhere it lives
f1_score Ran
ran; our contract draft was wrong, not the code
zexuanqiu/clongeval/metrics.py
code served (permissive licence) · get_code("477258f8938c0fd2")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from collections import Counter

torch.manual_seed(0)

# Analyzing the function:
# - prediction: used with Counter() and len()
# - ground_truth: used with Counter() and len()
# - **kwargs: not used in the function body
# Both parameters should be sequences/iterables that can be counted

# Simple lists of integers work well for this function
prediction = [1, 2, 3, 2, 4]
ground_truth = [1, 2, 2, 5, 6]

ARGS = {
    "prediction": prediction,
    "ground_truth": ground_truth,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
news_labeling_pattern_match Ran
ran; our contract draft was wrong, not the code
zexuanqiu/clongeval/post_processing_for_stacked_tasks.py
code served (permissive licence) · get_code("b2632d247e5f4863")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import re

def news_labeling_pattern_match(pred_answer: str):
    res_list = []
    pattern1 = '新闻(\\d+),类别名:(\\w+)'
    pattern2 = '新闻(\\d+),类别名\\d+:(\\w+)'
    pattern3 = '新闻\\s?(\\d+)[,:](\\w+)'
    patterns = [pattern1, pattern2, pattern3]
    lines_list = pred_answer.split('\n')
    for cur_line in lines_list:
        for cur_pattern in patterns:
            match = re.search(cur_pattern, cur_line)
            if match:
                news_id = match.group(1)
                category_id = match.group(2)
                res_list.append(','.join([news_id, category_id]))
                break
    return res_list

pred_answer = """新闻1,类别名:体育
新闻2,类别名3:娱乐
新闻 3:科技
新闻4,文化"""

ARGS = {
    "pred_answer": pred_answer
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
normalize_zh_answer Ran
ran; our contract draft was wrong, not the code
zexuanqiu/clongeval/metrics.py
pointer only (licence: MIT); the stored copy get_code serves, from borealisai/radar-decoding, is pointer only (licence: LGPL-3.0) · get_code("8c5c581f9264c810")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from borealisai/radar-decoding, and LGPL-3.0, as GitHub detects it on that repository, is not in the permissive set Syntology serves inline. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

parse_args Ran
ran; our contract draft was wrong, not the code
zexuanqiu/clongeval/heat_map/generate_single_news_position_score.py
code served (permissive licence) · get_code("c409703b36ac5bb3")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Namespace. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import argparse

def parse_args(args=None):
    parser = argparse.ArgumentParser()
    parser.add_argument('--model_name', type=str, default='kimichat', choices=['gpt4-turbo-128k', 'moonshot-v1'])
    parser.add_argument('--dataset', type=str, default='news_labeling', choices=['news_labeling'])
    return parser.parse_args(args)

ARGS = {
    'args': ['--model_name', 'gpt4-turbo-128k', '--dataset', 'news_labeling']
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Namespace — a Namespace output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Namespace output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
parse_args Ran
ran; our contract draft was wrong, not the code
zexuanqiu/clongeval/lost_in_the_middle/eval_with_position.py
code served (permissive licence) · get_code("ff5d0d37647eda2a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Namespace. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import argparse

ARGS = {
    'args': [
        '--model_name', 'chatglm3-6b-32k',
        '--dataset', 'test_dataset',
        '--interval_number', '6',
        '--min_len', '10000',
        '--max_len', '60000'
    ]
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Namespace — a Namespace output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Namespace output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
qa_f1_zh_score Ran
ran, honoured the contract we drafted
zexuanqiu/clongeval/metrics.py
code served (permissive licence) · get_code("bae30ce506ec591f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import jieba
import string
from collections import Counter

def normalize_zh_answer(s):
    """Lower text and remove punctuation, extra whitespace."""

    def white_space_fix(text):
        return ''.join(text.split())

    def remove_punc(text):
        cn_punctuation = '!?。。"#$%&'()*+,-/:;<=>@[\]^_`{|}~⦅⦆「」、、〃》「」『』【】〔〕〖〗〘〙〚〛〜〝〞〟〰〾〿–—''‛""„‟…‧﹏.'
        all_punctuation = set(string.punctuation + cn_punctuation)
        return ''.join((ch for ch in text if ch not in all_punctuation))

    def lower(text):
        return text.lower()
    return white_space_fix(remove_punc(lower(s)))

def f1_score(prediction, ground_truth, **kwargs):
    common = Counter(prediction) & Counter(ground_truth)
    num_same = sum(common.values())
    if num_same == 0:
        return 0
    precision = 1.0 * num_same / len(prediction)
    recall = 1.0 * num_same / len(ground_truth)
    f1 = 2 * precision * recall / (precision + recall)
    return f1

def qa_f1_zh_score(prediction, ground_truth):
    prediction = prediction.strip()
    if '\n' in prediction:
        prediction = prediction.split('\n')[0]
    if '问题:' in prediction:
        pos_idx = prediction.find('问题:')
        prediction = prediction[:pos_idx]
    prediction_tokens = list(jieba.cut(prediction, cut_all=False))
    ground_truth_tokens = list(jieba.cut(ground_truth, cut_all=False))
    prediction_tokens = [normalize_zh_answer(token) for token in prediction_tokens]
    ground_truth_tokens = [normalize_zh_answer(token) for token in ground_truth_tokens]
    prediction_tokens = [token for token in prediction_tokens if len(token) > 0]
    ground_truth_tokens = [token for token in ground_truth_tokens if len(token) > 0]
    return f1_score(prediction_tokens, ground_truth_tokens)

ARGS = {
    "prediction": "这是一个测试答案,包含了一些中文内容。",
    "ground_truth": "这是一个测试,包含中文。"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jieba — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
typo_detection_pattern_match Ran
ran; our contract draft was wrong, not the code
zexuanqiu/clongeval/post_processing_for_stacked_tasks.py
code served (permissive licence) · get_code("a972d367f21dcf73")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import re

def typo_detection_pattern_match(pred_answer: str):
    typo_list = pred_answer.split('\n')
    res_list = []
    pattern1 = '段落ID:(\\d+)[,,]错别字\\d+,(\\w+)[,,]正确字\\d+,(\\w+)'
    pattern2 = '段落ID:(\\d+)[,,]错别字,(\\w+)[,,]正确字,(\\w+)'
    pattern3 = '段落ID:(\\d+)[,,]错别字:(\\w+)[,,]正确字:(\\w+)'
    pattern4 = '段落ID:(\\d+)[,,]错别字\\d+,(\\w+)[,,](\\w+)'
    pattern5 = '段落ID:(\\d+)[,,](\\w+)[,,](\\w+)'
    pattern6 = '(\\d+)[,,](\\w+)[,,](\\w+)'
    patterns = [pattern1, pattern2, pattern3, pattern4, pattern5, pattern6]
    for cur_typo in typo_list:
        left_parenthesis = cur_typo.find('(')
        if left_parenthesis != -1:
            cur_typo = cur_typo[:left_parenthesis]
        for pattern in patterns:
            match = re.search(pattern, cur_typo)
            if match:
                id_number = match.group(1)
                wrong_word = match.group(2)
                correct_word = match.group(3)
                res_list.append(','.join([id_number, wrong_word, correct_word]))
                break
    typo_line_list = pred_answer.split('\n\n')
    if len(typo_line_list) == 1:
        return res_list
    alternative_res_list = []
    pattern7 = '段落ID:(\\d+)\\n错别字:(\\w)\\n正确字:(\\w)'
    pattern8 = '段落ID:(\\d+)\\n错别字:(\\w),正确字:(\\w)'
    alternative_patterns = [pattern7, pattern8]
    for pattern in alternative_patterns:
        match = re.search(pattern, cur_typo)
        if match:
            id_number = match.group(1)
            wrong_word = match.group(2)
            correct_word = match.group(3)
            alternative_res_list.append(','.join([id_number, wrong_word, correct_word]))
            break
    final_res_list = list(set(res_list) & set(alternative_res_list))
    return final_res_list

pred_answer_1 = "段落ID:1,错别字1,好,正确字1,好\n段落ID:2,错别字2,坏,正确字2,好"

pred_answer_2 = "段落ID:1,错别字,张,正确字,李\n\n段落ID:1\n错别字:a\n正确字:b"

pred_answer_3 = "1,错,对,other text(后续内容)"

ARGS = {
    "pred_answer": pred_answer_1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 7 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 2 later) and 0 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
normalize_zh_answer 28 other papers
4 dated earlier, 22 later, 1 same year, order not determinable, 1 undated
2311.04934 (2023-11)
Prompt Cache: Modular Attention Reuse for Low-Latency Inference
2311.09198 (2023-11)
Never Lost in the Middle: Mastering Long-Context Question Answering with Position-Agnostic Decompositional Training
2024.findings-emnlp.230 (2024 (year only))
CLongEval: A Chinese Benchmark for Evaluating Long-Context Large Language Models
and 25 more not named here
f1_score 3 other papers
2 later, 1 same year, order not determinable
2024.findings-emnlp.230 (2024 (year only))
CLongEval: A Chinese Benchmark for Evaluating Long-Context Large Language Models
2404.16811 (2024-04)
Make Your LLM Fully Utilize the Context
2504.03101 (2025-04)
Single-Pass Document Scanning for Question Answering
news_labeling_pattern_match 1 other paper
1 same year, order not determinable
2024.findings-emnlp.230 (2024 (year only))
CLongEval: A Chinese Benchmark for Evaluating Long-Context Large Language Models
parse_args 1 other paper
1 same year, order not determinable
2024.findings-emnlp.230 (2024 (year only))
CLongEval: A Chinese Benchmark for Evaluating Long-Context Large Language Models
parse_args 1 other paper
1 same year, order not determinable
2024.findings-emnlp.230 (2024 (year only))
CLongEval: A Chinese Benchmark for Evaluating Long-Context Large Language Models
qa_f1_zh_score 1 other paper
1 same year, order not determinable
2024.findings-emnlp.230 (2024 (year only))
CLongEval: A Chinese Benchmark for Evaluating Long-Context Large Language Models
typo_detection_pattern_match 1 other paper
1 same year, order not determinable
2024.findings-emnlp.230 (2024 (year only))
CLongEval: A Chinese Benchmark for Evaluating Long-Context Large Language Models

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Developing Large Language Models (LLMs) with robust long-context capabilities has been the recent research focus, resulting in the emergence of long-context LLMs proficient in Chinese. However, the evaluation of these models remains underdeveloped due to a lack of benchmarks. To address this gap, we present CLongEval, a comprehensive Chinese benchmark for evaluating long-context LLMs. CLongEval is characterized by three key features: (1) Sufficient data volume, comprising 7 distinct tasks and 7,267 examples; (2) Broad applicability, accommodating to models with context windows size from 1K to 100K; (3) High quality, with over 2,000 manually annotated question-answer pairs in addition to the automatically constructed labels. With CLongEval, we undertake a comprehensive assessment of 6 open-source long-context LLMs and 2 leading commercial counterparts that feature both long-context abilities and proficiency in Chinese. We also provide in-depth analysis based on the empirical results, trying to shed light on the critical capabilities that present challenges in long-context settings. The dataset, evaluation scripts, and model outputs are released.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2403.03514")
get_code_for_paper("2403.03514")
have("2403.03514")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2403.03514.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2403.03514.svg)](https://syntology.ai/paper/2403.03514)

Connect an agent — have() is free.