File size: 6,698 Bytes
59b2ab1
 
 
 
5fb8685
 
 
 
 
 
 
59b2ab1
 
 
 
5fb8685
 
 
 
2da7431
59b2ab1
 
95c54a1
 
 
 
952cce5
6cf7c97
5fb8685
 
 
 
 
6cf7c97
5fb8685
2da7431
5fb8685
6cf7c97
5fb8685
6cf7c97
5fb8685
 
 
 
 
 
6cf7c97
5fb8685
 
 
6cf7c97
5fb8685
6cf7c97
5fb8685
 
6cf7c97
5fb8685
 
 
 
 
 
 
 
 
 
 
6cf7c97
 
 
 
5fb8685
 
6cf7c97
5fb8685
6cf7c97
5fb8685
6cf7c97
5fb8685
 
 
6cf7c97
 
5fb8685
 
 
6cf7c97
5fb8685
6cf7c97
5fb8685
 
 
 
 
6cf7c97
5fb8685
6cf7c97
5fb8685
 
6cf7c97
 
5fb8685
6cf7c97
1aed8d6
6cf7c97
 
 
 
5fb8685
6cf7c97
 
5fb8685
6cf7c97
 
 
5fb8685
 
6cf7c97
5fb8685
6cf7c97
5fb8685
6cf7c97
5fb8685
 
 
 
6cf7c97
5fb8685
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2da7431
5fb8685
 
 
 
 
 
2da7431
 
 
 
5fb8685
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
---
pretty_name: LongHarness
language:
  - en
multilinguality:
  - monolingual
size_categories:
  - n<1K
task_categories:
  - question-answering
  - text-classification
tags:
  - long-context
  - benchmark
  - language-model-agents
  - agent-evaluation
  - retrieval
  - reasoning
  - code
  - arxiv:2609.38137
---

<p align="center">
  <img src="https://huggingface.co/datasets/StringNLP/longharness/resolve/main/assets/longharness-logo.png" width="180" alt="LongHarness Bench logo: documents routed through a language-model harness">
</p>

# LongHarness Bench: Stress-Testing Language Model Harnesses for Long-Context Reasoning

LongHarness evaluates how language-model harnesses access and reason over long
contexts. It is designed to distinguish context-access strategies, including
direct reading, lexical and semantic retrieval, iterative agents, and recursive
language-model harnesses. The benchmark contains 200 evaluation instances
across four task suites.

- [Project website](https://stringnlplab.github.io/longharness/)
- [Paper](https://arxiv.org/abs/2609.38137)
- [GitHub repository](https://github.com/StringNLPLAB/longharness)

## Benchmark Tasks

| Task | Context | Required output | Instances |
|---|---|---|---:|
| Constraint Solving Search | Documents about 160 people and a query containing three to five conditions | The five person IDs satisfying every condition | 50 |
| Equivalent Program Pair Search | 200 anonymous Python programs with semantically confusable mutants | Every semantically equivalent program pair | 50 |
| Program Execution Tracing | 320 shuffled computation cells and an eight-step final query | The final structured result and eight supporting cell IDs | 50 |
| Outlier Memo Detection | 700 memos containing 2,500 statements | The 15 memo IDs containing conflicting claims | 50 |

Every task uses exact instance accuracy. Partial outputs, missing items, and
extra items are incorrect under the primary metric. Program Execution Tracing
also reports answer-only accuracy as an auxiliary metric.

## Download

LongHarness is distributed as raw Markdown contexts, JSON answer keys, and
JSONL manifests. Download the complete repository snapshot with:

```bash
hf download StringNLP/longharness \
  --repo-type dataset \
  --local-dir longharness
```

This release is not packaged as a row-oriented `datasets.Dataset`. Preserving
the original context documents and keeping answer keys outside the agent's
workspace are part of the evaluation protocol.

## Repository Structure

```text
README.md
RELEASE.json
DATA_CHECKSUMS.sha256
manifest.jsonl
score.py
tools/verify_release.py
tasks/
  <task-id>/
    README.md
    manifest.jsonl
    contexts/sample-00000.md
    answers/sample-00000.json
```

The root manifest contains all 200 instances. Each row identifies the task,
instance index, context path, answer path, context byte count, and SHA-256
digest. Task manifests may include additional task-specific statistics.

## Evaluation Protocol

Expose only the selected context and task instruction to the evaluated system.
Do not expose `answers/`, manifests containing answer paths, the scorer, or
other instances from the repository. Answer files are public for reproducible
scoring, so results should be treated as benchmark evaluation rather than
closed-test assessment.

Predictions are JSON Lines records with `task`, `index`, and `prediction`:

```json
{"task":"constraint-solving-search","index":0,"prediction":{"matches":["P-018","P-076","P-096","P-101","P-155"]}}
```

The prediction value has a task-specific schema:

- Constraint Solving Search: `{"matches": [...]}`
- Equivalent Program Pair Search: `[[cell_a, cell_b], ...]`
- Program Execution Tracing: `{"answer": {...}, "evidence": [...]}`
- Outlier Memo Detection: `["M-001", "M-002", ...]`

Run the official scorer from the downloaded snapshot:

```bash
cd longharness
python score.py predictions.jsonl --output scores.json
```

The scorer reports exact and answer-only accuracy per task, plus macro-average
exact accuracy across the four task suites.

## Integrity Check

Validate all manifests, files, checksums, and task counts before evaluation:

```bash
cd longharness
python tools/verify_release.py
```

`DATA_CHECKSUMS.sha256` and the digests in `RELEASE.json` provide additional
snapshot-level integrity information.

## Construction

Each instance is generated from a hidden structured specification before its
public context is rendered. The specification is a predicate world, relation
graph, computation graph, or executable program family, depending on the task.
A task-specific solver computes the gold answer, controlled mutations create
hard distractors, and deterministic validators recompute the answer and verify
the intended role of every required item.

Equivalent Program Pair Search is adapted from standard-input APPS problems.
Its answer keys represent agreement over the retained valid-input test suites
and additional checks; they are not formal proofs of equivalence over arbitrary
Python inputs.

## Intended Use

LongHarness is intended for evaluating the accuracy and efficiency of systems
that process long contexts, especially agent harnesses and retrieval-augmented
reasoning systems. It is not intended as a training corpus, a measure of general
intelligence, or a substitute for evaluation on natural user workloads.

When reporting results, include the model, harness, task-level exact accuracy,
macro-average exact accuracy, token accounting method, and execution-cost
assumptions. Harness configurations and tool access can materially affect both
accuracy and cost.

## Limitations

- The benchmark contains constructed evaluation environments rather than
  naturally occurring user sessions.
- It covers English documents and Python programs only.
- Exact-set scoring can understate progress on partially correct responses.
- Public answer keys make contamination possible; do not use this release for
  training or expose answer-bearing files during inference.
- Program equivalence is validated behaviorally over explicit input contracts
  and tests, not proven for every possible Python object.
- Performance on these 200 instances should not be interpreted as a complete
  measure of long-context capability.

## Citation

Please cite the LongHarness Bench paper:

```bibtex
@misc{pham2026longharness,
  title  = {{LongHarness Bench}: Stress-Testing Language Model Harnesses for Long-Context Reasoning},
  author = {Pham, Quang Hieu and Nguyen, Thuy Duong and Chen, Jocelyn Qiaochu and Ye, Xi},
  year   = {2026},
  eprint = {2609.38137},
  archivePrefix = {arXiv},
  primaryClass = {cs.CL},
  url    = {https://arxiv.org/abs/2609.38137}
}
```