import copy
import json
import random
import re
import datasets
ds = datasets.load_dataset("allenai/RLVR-IFeval", split="train")
def replace_numeric_constraint(example, transform_func=lambda x: x):
ret = copy.deepcopy(example)
ground_truth_dict = json.loads(ret["ground_truth"])
old_N = ground_truth_dict["N"]
new_N = transform_func(old_N)
ground_truth_dict["N"] = new_N
# First replace in example["constraint"]
if ret["constraint_type"] == "Number Paragraphs + First Word in i-th Paragraph":
old_i = ground_truth_dict["i"]
new_i = random.randint(1, new_N)
ground_truth_dict["i"] = new_i
first_word = ground_truth_dict["first_word"]
old_constraint_str = ret["constraint"].replace("{N}", str(old_N)).replace("{i}", str(old_i)).replace("{first word}", first_word)
new_constraint_str = ret["constraint"].replace("{N}", str(new_N)).replace("{i}", str(new_i)).replace("{first word}", first_word)
else:
old_constraint_str = ret["constraint"].replace("{N}", str(old_N))
new_constraint_str = ret["constraint"].replace("{N}", str(new_N))
ret["ground_truth"] = json.dumps(ground_truth_dict)
# Then replace in messages content
if ret["constraint_type"] == "Number Sentences":
# special constraint_type
# "Answer with at least / around / at most {N} sentences."
pattern = r"(Answer with (at least|around|at most)) (\d+)( sentences\.)"
def replace_number_only(match):
prefix = match.group(1) # "Answer with around"
suffix = match.group(4) # " sentences."
return f"{prefix} {new_N}{suffix}"
ret["messages"][0]["content"] = re.sub(pattern, replace_number_only, ret["messages"][0]["content"])
else:
ret["messages"][0]["content"] = ret["messages"][0]["content"].replace(old_constraint_str, new_constraint_str)
return ret
numerical_constraints = [
"Number Paragraphs",
"Keyword Frequency",
"Minimum Number Highlighted Section",
"Number Paragraphs + First Word in i-th Paragraph",
"Letter Frequency",
"Number Sentences",
"Multiple Sections",
"Number Placeholder",
"Number Bullets"
]
transform_func = lambda x: random.randint(1, 5)
ds_reduced = ds.map(
lambda x: replace_numeric_constraint(x, transform_func=transform_func) if x["constraint_type"] in numerical_constraints else x,
num_proc=8
)
ds_reduced.push_to_hub("rasdani/smol-RLVR-IFeval")
rasdani/smol-RLVR-IFeval
Safety benchmarks, over-refusal tests, and guard-model data.Safety tests and tests for refusing harmless requests.
Description
import copy
import json
import random
import re
import datasets
ds = datasets.load_dataset("allenai/RLVR-IFeval", split="train")
def replace_numeric_constraint(example, transform_func=lambda x: x):
ret = copy.deepcopy(example)
ground_truth_dict = json.loads(ret["ground_truth"])
old_N = ground_truth_dict["N"]
new_N = transform_func(old_N)
ground_truth_dict["N"] = new_N
# First replace in example["constraint"]
if ret["constraint_type"] == "Number Paragraphs +… See the full description on the dataset page: https://huggingface.co/datasets/rasdani/smol-RLVR-IFeval.
Structure
| SplitPart | Rows | Size |
|---|---|---|
| train | 14,973 | 26.4 MB |
Used by uncensored models
No abliterated models in our catalog have declared this dataset in their YAML metadata yet. This can mean the dataset is used but not declared, is used outside abliteration workflows, or is new. The link will populate automatically as models are indexed.No model in our catalog lists this dataset yet. It may be used without being listed, used for other work, or simply be new. The list fills in by itself as models are added.
MetadataDetails
Related datasets
Read further
Download the dataset
Copy any of these snippets into your notebook or terminal. All three fetch directly from Hugging Face using your own credentials.Each of these lines of code downloads the dataset straight from Hugging Face, with your own Hugging Face login.
from datasets import load_dataset
ds = load_dataset("rasdani/smol-RLVR-IFeval")from huggingface_hub import snapshot_download
snapshot_download(repo_id="rasdani/smol-RLVR-IFeval", repo_type="dataset")git clone https://huggingface.co/datasets/rasdani/smol-RLVR-IFevalFiles by folder
Showing the first 5,000 files. Full list on Hugging Face ↗
data/ 1 file 11.5 MB
| train-00000-of-00001.parquet | 11.5 MB | parquet | download |
No file list for this dataset yet.
This repository is private or no longer exists on Hugging Face.This dataset is private or no longer exists on Hugging Face.
Open on Hugging Face ↗READMEAuthor's description
README historyEdit history
Every night we snapshot the README of every dataset in the catalog. When the SHA changes we archive the new version and diff it against the last. This is the evolving thought record of the alignment-data field: what the author decided to say about the corpus, and how that framing shifted over time.Every night we save the author's description of every dataset in the catalog. When it changes, we keep the new text and compare it with the one before. This shows what each author chose to say about their dataset, and how that changed over time.
-
2025-03-15 Update README.md
Loading... -
2025-03-15 Upload dataset
Loading... -
2025-03-15 Update README.md
Loading... -
2025-03-15 Upload dataset
Loading... -
2025-03-15 Update README.md
Loading... -
2025-03-15 Upload dataset
Loading... -
2025-03-14 Update README.md
Loading... -
2025-03-14 Upload dataset
Loading... -
2025-03-14 initial commit
Loading...
Community discussions
Threads posted by the community on Hugging Face: bug reports, questions about usage, pull requests on the README, licence clarifications. Click any thread to expand and read the full conversation inline. Newest first.Conversations people started on Hugging Face: bug reports, questions about using the data, suggested changes to the author's description, questions about the licence. Open a thread to read it here. Newest first.
-
2025-03-15 [bot] Conversion to Parquet
Loading...
source: Hugging Face