Datasets:

Modalities:
Text
Formats:
json
Languages:
English
Size:
< 1K
ArXiv:
Tags:
code
Libraries:
Datasets
pandas
License:
pbe-world / README.md
sbdzdz's picture
Update README.md
3067057 verified
metadata
license: apache-2.0
task_categories:
  - text-generation
language:
  - en
tags:
  - code
pretty_name: pbeworld

PBE World

A synthetic dataset generator for Programming-by-Examples (PBE) tasks focused on string manipulation pipelines. This is a lightly extended version of PBEBench by Naik et al. 2025.

Overview

PBE World generates tasks where models must reverse-engineer a sequence of string method calls from input/output examples. Each task consists of:

  • A fixed pipeline of string operations (e.g., s.replace(old, new), s.upper(), s.strip(chars))
  • Example input/output pairs that demonstrate the pipeline's behavior
  • Hidden test cases to validate solutions

Dataset Format

Each line in the output JSONL file contains a single task with the following structure:

{
    "task_id": "pbe-world/000000",
    "entry_point": "apply_pipeline",
    "prompt": "from typing import List\n\ndef apply_pipeline(s: str) -> str:\n    \"\"\"Apply a fixed string-manipulation pipeline to the input string `s`.\n    \n    The pipeline consists of several string method calls such as:\n    \n        s = s.replace(old, new)\n        s = s.upper()\n        s = s.lower()\n        s = s.strip(chars)\n    \n    which are always applied in the same fixed order.\n    \n    Your task is to reverse-engineer this pipeline from the examples\n    and implement it.\n    \n    Example input/output pairs:\n    \n        >>> apply_pipeline('abbab') == 'aaab'\n        >>> apply_pipeline('abbaa') == 'aa'\n        >>> apply_pipeline('abaab') == 'baab'\n    \"\"\"\n    raise NotImplementedError()\n",
    "canonical_solution": "def apply_pipeline(s: str) -> str:\n    \"\"\"Canonical solution (auto-generated).\"\"\"\n    s = s.strip('a')\n    s = s.replace('bb', 'aa')\n    return s\n",
    "canonical_pipeline": [
        {
            "method": "strip",
            "args": [
                "a"
            ]
        },
        {
            "method": "replace",
            "args": [
                "bb",
                "aa"
            ]
        }
    ],
    "test": "from typing import Callable\n\ndef check(candidate: Callable[[str], str]) -> None:\n    # examples from the prompt\n    assert candidate('abbab') == 'aaab'\n    assert candidate('abbaa') == 'aa'\n    assert candidate('abaab') == 'baab'\n\n    # hidden tests\n    assert candidate('ababb') == 'baaa'\n    assert candidate('bbbaa') == 'aab'\n    assert candidate('bbbab') == 'aabab'\n",
    "num_tests": 6,
    "examples": [
        {
            "input": "abbab",
            "output": "aaab"
        },
        {
            "input": "abbaa",
            "output": "aa"
        },
        {
            "input": "abaab",
            "output": "baab"
        }
    ],
    "tests": [
        {
            "input": "ababb",
            "output": "baaa"
        },
        {
            "input": "bbbaa",
            "output": "aab"
        },
        {
            "input": "bbbab",
            "output": "aabab"
        }
    ],
    "metadata": {
        "alphabet": [
            "a",
            "b"
        ],
        "alphabet_size": 2,
        "num_programs": 1,
        "num_examples": 3,
        "num_tests": 3,
        "generation_params": {
            "n_inputs_for_examples": 16,
            "l_min": 5,
            "l_max": 5,
            "pipeline_L_min": 2,
            "pipeline_L_max": 2
        },
        "split": "test",
        "version": "1.0.0"
    }
}

See schema.json for the complete JSON Schema specification.

Citation

If you use this dataset generator in your research, please cite:

@article{naik2024pbebench,
  title={PBEBench: A Multi-Step Programming by Examples Reasoning Benchmark inspired by Historical Linguistics},
  author={Naik, Atharva and Prakam and Agrawal, Darsh and Mathur, Yash and Kapadnis, Manav and An, Yuwei and Marr, Clayton and Rose, Carolyn and Mortensen, David},
  journal={arXiv preprint arXiv:2505.23126},
  year={2025}
}

@software{pbeworld2025,
  title={PBE World: A Synthetic Dataset Generator for String Manipulation Tasks},
  author={},
  year={2025},
  url={https://github.com/sbdzdz/pbe-world}
}