jannalu/mbpp-longcontext
MBPP Long-Context Dataset Overview MBPP Long-Context is a benchmark dataset that combines coding problems from the MBPP (Mostly Basic Python Problems) dataset with long-context distractors from BABILong. This dataset evaluates code generation performance under long-context conditions, testing whether models can maintain coding ability with stuffed context. Dataset Structure Data Fields Each sample contains: Original MBPP… See the full description on the dataset page: https://huggingface.co/datasets/jannalu/mbpp-longcontext.
MBPP Long-Context Dataset
Overview
MBPP Long-Context is a benchmark dataset that combines coding problems from the MBPP (Mostly Basic Python Problems) dataset with long-context distractors from BABILong. This dataset evaluates code generation performance under long-context conditions, testing whether models can maintain coding ability with stuffed context.
Dataset Structure
Data Fields
Each sample contains:
Original MBPP Fields
task_id(int): Unique task identifiertext(str): Problem descriptioncode(str): Reference solutiontest_list(List[str]): Test cases (assertions)test_setup_code(str): Optional setup codechallenge_test_list(List[str]): Additional test cases
Long-Context Fields
context(str): Prepended distractor text from BABILong, ranging from 0k to 1M.context_id(str): BABILong source identifier (e.g., "babilong128kqa1sample42")context_length_tokens(int): Token count using Llama tokenizer
Metadata
code_length_chars(int): Reference solution length for difficulty tracking
Data Splits
All configurations follow the original MBPP split structure:
- test: 500 samples (primary evaluation set)
- train: 374 samples
- validation: 90 samples
- prompt: 10 samples (few-shot examples)
Creating the dataset
To avoid confounding variables, this dataset uses stratified random assignment, where:
- Sort MBPP tasks by code length
- Get text from BABILong qa1-qa10 splits
- Duplicate contexts to match task count (974 samples)
- Shuffle contexts and assign to sorted tasks
Source Datasets
MBPP (Mostly Basic Python Problems)
- Source: google-research-datasets/mbpp
- Size: 974 problems
- Paper: Program Synthesis with Large Language Models
BABILong
- Source: RMT-team/babilong
- Content:
inputfield from qa1-qa10 splits - Paper: BABILong: Testing the Limits of LLMs with Long Context Reasoning-in-a-Haystack
