huggingface/open-r1 · error
Dataset Question Field Error: {prompt_column} is not support
Error message
Dataset Question Field Error: {prompt_column} is not supported. What it means
make_conversation builds the GRPO 'prompt' column by reading example[prompt_column] (default 'prompt', configurable via dataset_prompt_column). If the mapped dataset lacks that key, it raises this ValueError, since the reward/policy pipeline requires a prompt extracted from a known field.
Source
Thrown at src/open_r1/grpo.py:98
##############
# Load model #
##############
logger.info("*** Loading model ***")
model = get_model(model_args, training_args)
# Get reward functions from the registry
reward_funcs = get_reward_funcs(script_args)
# Format into conversation
def make_conversation(example, prompt_column: str = script_args.dataset_prompt_column):
prompt = []
if training_args.system_prompt is not None:
prompt.append({"role": "system", "content": training_args.system_prompt})
if prompt_column not in example:
raise ValueError(f"Dataset Question Field Error: {prompt_column} is not supported.")
prompt.append({"role": "user", "content": example[prompt_column]})
return {"prompt": prompt}
dataset = dataset.map(make_conversation)
for split in dataset:
if "messages" in dataset[split].column_names:
dataset[split] = dataset[split].remove_columns("messages")
#############################
# Initialize the GRPO trainer
#############################
trainer = GRPOTrainer(
model=model,
reward_funcs=reward_funcs,
args=training_args,
train_dataset=dataset[script_args.dataset_train_split],View on GitHub (pinned to 1416fa0cf2)
Solutions
- Rename/prepare your dataset to expose the expected column: dataset = dataset.rename_column("question", "prompt").
- Or set the matching CLI/config option (e.g. dataset_prompt_column="question") so prompt_column points at your field.
- Print dataset.column_names to confirm the actual field names before training.
Example fix
// before
dataset = load_dataset("gsm8k", "main", split="train") # has 'question', not 'prompt'
// after
dataset = load_dataset("gsm8k", "main", split="train").rename_column("question", "prompt") Defensive patterns
Strategy: validation
Validate before calling
required = training_args.dataset_prompt_column or "prompt"
if required not in dataset.column_names:
raise SystemExit(f"Dataset lacks prompt column '{required}'; has {dataset.column_names}") Type guard
def has_prompt_column(example, col="prompt") -> bool:
return isinstance(example, dict) and col in example and isinstance(example[col], str) Try / catch
try:
dataset = dataset.map(make_conversation)
except ValueError as e:
if "Dataset Question Field Error" in str(e):
sys.exit("Set the correct prompt column via the dataset prompt column config or rename the field")
raise Prevention
- Print dataset.column_names before mapping
- Rename your field to 'prompt' or configure dataset_prompt_column to match
- Keep dataset schemas documented alongside training configs
When it happens
Trigger: Calling GRPOTrainer with a dataset whose prompt field is named something other than the configured prompt_column, e.g. a dataset with 'question' or 'problem' but no 'prompt', while training_args.system_prompt / prompt column config still defaults to 'prompt'.
Common situations: Swapping in a custom RL dataset (gsm8k, math) whose fields differ from the template's; forgetting to pass dataset_prompt_column; dataset.map over a split that lost the column after filtering/renaming.
Related errors
- Either `dataset_name` or `dataset_mixture` must be provided
- dataset_mixture must be a dictionary with a 'datasets' key.
- 'datasets' must be a list of dataset configurations
- Column names must be consistent across all dataset configura
- max_penalty {max_penalty} should not be positive
AI-assisted analysis of huggingface/open-r1@1416fa0cf2 (2026-08-30).
Data as JSON: /api/errors/b217d6655df96384.
Report an issue: GitHub.