--- license: mit language: - en pretty_name: ThoughtDAG Context Repair Benchmark tags: - llm - context-engineering - context-repair - benchmark - graph - human-in-the-loop configs: - config_name: cases data_files: - split: test path: data/cases.jsonl - config_name: endpoint_results data_files: - split: test path: data/endpoint_results.jsonl - config_name: reasoning_ablation data_files: - split: test path: data/reasoning_ablation.jsonl --- # ThoughtDAG Context Repair Benchmark What happens after one wrong assumption enters a long LLM conversation? This dataset turns context editing into a measurable intervention. Each synthetic case starts with a clean fact, introduces a false update, lets the error propagate through one to three downstream turns, and then asks the same final question under five graph conditions: 1. `clean` 2. `polluted` 3. `source_prune` 4. `subgraph_prune` 5. `recompute_descendants` The central question is not only whether a model notices bad context. It is whether different graph edits repair the answer after that context has already shaped later turns. > These are pilot/reference results for studying context intervention. They are not an authoritative model leaderboard. [Interactive report](https://chenxiachan.github.io/thoughtdag/research/context-repair-pilot-v2/) · [Code and reproducible pipeline](https://github.com/chenxiachan/thoughtdag/tree/main/benchmark) · [ThoughtDAG](https://github.com/chenxiachan/thoughtdag) ![Five context graphs applied to the same final question](figures/flagship-context-repair.png) ## Dataset contents | Config | Rows | What it contains | | --- | ---: | --- | | `cases` | 27 | Nine independent problem families at three propagation depths, including graph structure, interventions, exact-match gold answers, and scorer definitions | | `endpoint_results` | 1,215 | Five conditions for every case across nine model endpoints | | `reasoning_ablation` | 270 | The same 135 conditions under a controlled reasoning-on versus reasoning-off comparison on one endpoint | Convenience summaries are also included as `data/endpoint_summary.csv` and `data/reasoning_ablation_summary.csv`. ## Reference finding Across the nine-endpoint panel, 162 paired model-cases were first correct in the clean graph and then derailed by the polluted graph. | Intervention | Repaired | | --- | ---: | | Delete the false source only | 152 / 162 | | Delete the contaminated subgraph | 162 / 162 | | Delete the source and recompute descendants | 161 / 162 | ![Aggregate repair results](figures/repair-strategy-results.png) Deleting a false source can be insufficient because downstream answers may already contain its consequences. Removing the affected subgraph or rebuilding descendants repaired more of these pilot cases. ![Per-endpoint repair results](figures/model-strategy-dotplot.png) ## Controlled reasoning ablation On one text-only endpoint, reasoning was explicitly toggled per request while the cases, decoding temperature, graph compiler, and scorer were held fixed. Source-only pruning repaired 16 of 18 derailed cases with reasoning enabled and 2 of 18 with reasoning disabled. The paired source-prune comparison produced an exact two-sided McNemar p-value of `0.0001220703125`. ![Controlled reasoning ablation](figures/ablation-slope.png) This is a narrow ablation on one endpoint. It does not establish a general causal claim about reasoning across models. ## Schema ### `cases` - `case_id`, `family_id`, `pollution_operator`, `propagation_depth` - `final_question`, `gold_answer`, `distractor_markers` - `graph_json`: nodes and directed context edges - `conditions_json`: graph operations for each intervention - `scorer_json`: declarative exact-match scorer The three JSON fields are serialized strings so the Hugging Face Dataset Viewer can display a stable tabular schema. Parse them with `json.loads` when using the graph structures programmatically. ### Result configs Each result row identifies the case, run, provider, endpoint model, reasoning mode, condition, raw answer, extracted answer, exact-match result, format compliance, usage, latency, cost, compiler version, scorer version, and source commit. The public dataset intentionally excludes API keys, environment-variable names, endpoint configuration, and raw provider traces. Immutable traces remain in the source repository for audit and reproduction. ## Load with `datasets` ```python from datasets import load_dataset cases = load_dataset( "thoughtdag/context-repair-benchmark", "cases", split="test", ) results = load_dataset( "thoughtdag/context-repair-benchmark", "endpoint_results", split="test", ) ``` ## Reproduce or add an endpoint The GitHub repository is the canonical home for executable code, immutable traces, and contributions. To re-score an existing run without making API calls: ```bash git clone https://github.com/chenxiachan/thoughtdag.git cd thoughtdag npm install BENCH_SUITE=pilot-v1 node benchmark/tools/score.mjs pilot-v1-nemotron-nano-9b ``` To evaluate another model, create a run envelope and use the capture pipeline documented in [`benchmark/README.md`](https://github.com/chenxiachan/thoughtdag/blob/main/benchmark/README.md). Please submit new cases, endpoint results, or methodology critiques through the [GitHub issue tracker](https://github.com/chenxiachan/thoughtdag/issues). ## Design and limitations - All 27 cases are synthetic English symbolic tasks with exact numeric answers. - Depth variants within a family are repeated measures, not independent samples. - The model panel is heterogeneous and several endpoints used free-tier routing at the recorded dates. - Exact-match scoring makes the benchmark auditable, but it does not represent the full range of real research conversations. - Reported findings should remain labeled as pilot/reference evidence until a larger preregistered suite is completed. ## License and citation The dataset and benchmark code are released under the MIT License. Until a versioned archival citation is issued, please cite the repository and record the dataset revision or `source_commit` used in your analysis: ```text Chen, Xia. ThoughtDAG Context Repair Benchmark. https://github.com/chenxiachan/thoughtdag/tree/main/benchmark ```