five

touristgpt/finecf-COTs

收藏
Hugging Face2026-05-27 更新2026-05-31 收录
下载链接:
https://hf-mirror.com/datasets/touristgpt/finecf-COTs
下载链接
链接失效反馈
官方服务:
资源简介:
--- language: - en license: mit task_categories: - text-generation tags: - competitive-programming - reasoning - code - codeforces - traces - chain-of-thought size_categories: - 1K<n<10K --- # Codeforces Trace Dataset A synthetic reasoning-trace dataset built from **9,413 Codeforces problems** (800–3500 rating). Each problem includes structured wrong-path explorations, discovery narratives, pseudocode, and — for problems rated ≥1800 — a fully executable C++ implementation. Designed to teach models *how to think through* competitive programming problems, not just solve them. ## What Makes This Different Most competitive programming datasets pair a problem with a solution. This dataset captures the **full reasoning process**: 1. **Wrong paths** — detailed explorations of approaches that *don't* work, including why they fail and what can be learned from each failure 2. **Discovery narrative** — a first-person account of pivoting from failed approaches to the correct one, with worked examples traced step-by-step 3. **Pseudocode** — clean, implementation-ready pseudocode for the correct approach 4. **C++ implementation** — a fully executable, competition-style C++ solution implementing the pseudocode exactly (available for all ≥1800 problems) 5. **Newer Questions** - We added in questions from newer datasets, as well as all the questions from the Open-r1 dataset. (We filtered the questions with missing editorial/other important fields from the dataset.) The dataset models *how an expert thinks* — trying ideas, hitting walls, extracting insights from failures, and building toward the solution. This is the main innovation that we have done in our dataset, where the thinking trace is highly structured, we thought about how a programmer thinks, first they will try out some ideas that seem correct, but on testing turn out to be wrong, this demonstrates the ability of the model to hypothesize and reason through an approach. Basically we are emulating natural thinking, but by breaking it down into components, we are able to more easily access different parts of the thinking process. And in the last stage of the trace, we ensured that the model will reach the correct solution, by passing in a *hint* about the correct solution, (not explicitely giving it the answer, the model still has to reason through the solution). **This *hint* for each question in itself is a valuable dataset to have.** For questions of rating <=1700, we did not follow this pipeline, we directly asked the model to solve the question and show its work, we found that for problems of lower rating this gave better results. *The beauty of this dataset, is that it can be augmented in any-way you want. You can choose to append any number of wrong-path explorations before the correct path exploration, depending on your needs. You can also choose to just use the correct path exploration in itself.* ## Dataset Structure Every row is one Codeforces problem. The dataset has two tiers based on difficulty: | Rating Range | Problems | Pipeline | Content | |---|---|---|---| | ≤ 1700 | 4,579 | Small | Wrong paths (descriptions) + short thinking trace + pseudocode | | ≥ 1800 | 4,834 | Full (4-stage) | Wrong paths (full explorations) + discovery narrative + pseudocode + C++ implementation | ### Schema (23 columns) #### Problem Metadata | Column | Type | Description | |---|---|---| | `problem_id` | str | Codeforces ID, e.g. `"1586/I"` | | `problem_name` | str | Problem title | | `rating` | float | Codeforces difficulty rating (800–3500, 0 = unrated) | | `tags` | str | Comma-separated topic tags (dp, graphs, math, etc.) | | `time_limit` | float | Time limit in seconds | | `memory_limit` | float | Memory limit in MB | | `description` | str | Full problem statement | | `input_format` | str | Input specification | | `output_format` | str | Output specification | | `interaction_format` | str | For interactive problems only | | `note` | str | Additional notes/clarifications | | `examples` | list[dict] | Sample `{input, output}` pairs | | `editorial_cleaned` | str | Official Codeforces editorial | #### Generated Trace Fields | Column | Type | Coverage | Description | |---|---|---|---| | `s1_hint` | str | 98.9% | A hint pointing toward the correct approach | | `wrong_path_1` | dict | 100% | `{name, exploration}` — first wrong approach | | `wrong_path_2` | dict | 100% | `{name, exploration}` — second wrong approach | | `wrong_path_3` | dict | 43.5% | `{name, exploration}` — third wrong approach (if applicable) | | `wrong_path_4` | dict | 4.4% | `{name, exploration}` — fourth wrong approach (if applicable) | | `small_thinking_trace` | str | ≤1700 only | Short reasoning trace discovering the correct approach | | `small_pseudo` | str | ≤1700 only | Pseudocode for the correct solution | | `s3_narrative` | str | ≥1800 only | Long-form first-person discovery narrative | | `s3_pseudocode` | str | ≥1800 only | Detailed pseudocode with variable names matching the narrative | | `s4_cpp` | str | ≥1800 only | Fully executable C++ implementation of the pseudocode | ### Wrong Path Format Each `wrong_path_N` is a dict with two keys: - **`name`** — the approach name (e.g. *"Greedy with priority queue"*, *"DFS brute force"*) - **`exploration`** — the full text: - For **≤1700** problems: a short description of the approach and why it fails - For **≥1800** problems: a long first-person exploration showing the solver working through the approach, hitting the wall, and extracting a learning ### Discovery Narrative (≥1800) The `s3_narrative` field is a first-person account of discovering the correct solution *after* all wrong paths have been explored. It follows a consistent structure: 1. Acknowledges the failed approaches and what went wrong 2. Pivots with a moment of insight ("hmm... wait —") 3. Slowly derives the correct algorithm step by step 4. Traces through a concrete example with actual values 5. Closes with the key structural insight ## Generation Pipeline The dataset was generated using a 4-stage pipeline with DeepSeek V3.2: - **Stage 1** — Given a problem and its editorial, generate plausible-but-wrong approaches and a hint toward the correct one, this stage also included a judge-model, which judged the quality of the path. - **Stage 2** — For each wrong approach, generate a detailed exploration showing a solver trying it, failing, and learning from the failure - **Stage 3** — Generate a discovery narrative (Call 1) and pseudocode (Call 2) for the correct approach, using the wrong-path learnings as context - **Stage 4** — Translate the pseudocode into a fully executable, competition-style C++ solution (available for all ≥1800 problems) Problems rated ≤1700 use a simpler single-call pipeline instead of the full 4-stage process. ## Usage ```python from datasets import load_dataset ds = load_dataset("YOUR_USERNAME/YOUR_DATASET_NAME") # Get a hard problem with full traces row = ds["train"].filter(lambda x: x["rating"] >= 2400)[0] print(row["problem_name"]) print(row["wrong_path_1"]["exploration"]) # Why greedy fails print(row["s3_narrative"]) # Discovery of correct approach print(row["s3_pseudocode"]) # Implementation pseudocode print(row["s4_cpp"]) # Executable C++ solution ``` ```python # Load from parquet directly import pandas as pd df = pd.read_parquet("mega_dataset.parquet") # Filter to problems with 3+ wrong paths multi_path = df[df["wrong_path_3"].notna()] ``` ## Stats | Metric | Value | |---|---| | Total problems | 9,413 | | Rating range | 800 – 3500 | | With full narrative (≥1800) | 4,834 | | With small trace (≤1700) | 4,444 | | Avg narrative length (≥1800) | ~17,800 chars | | Avg pseudocode length (≥1800) | ~3,200 chars | | Avg C++ implementation length (≥1800) | ~2,300 chars | | Problems with C++ implementation | 4,833 (99.98% of ≥1800) | | Problems with 2 wrong paths | 100% | | Problems with 3 wrong paths | 43.5% | | Problems with 4 wrong paths | 4.4% | ## Intended Use - **SFT training** for reasoning models on competitive programming - **Process supervision** — train models to explore, fail, and recover - **Wrong-path learning** — teach models to recognize dead ends early (important for distilling reasoning) - **Curriculum learning** — problems span 800 to 3500 difficulty ## Limitations - 135 problems have rating = 0 (special/unrated contest problems) (These problems are largely useless, as they are usually problems from april fools contests, we did not want to contaminate the dataset with these.) - ~1.8% of problems are missing `time_limit` / `memory_limit` - Narratives are synthetically generated and may occasionally contain minor mathematical errors. - The "wrong" paths are designed to be plausible but incorrect — some may actually be viable alternative approaches.(We tried to mititgate this by using a judge model, which judged each wrong path)
提供机构:
touristgpt
二维码
社区交流群
二维码
科研交流群
商业服务