evaluate 0 0 0

rasdani/smol-RLVR-IFeval

published by @rasdani

Alignment dataset tracked in the /datasets sub-catalog.

Lifetime downloads
321
Last 30 days
7
Likes
-
Size
11.0 MB
Created on HF
2025-03-14
Age
1 years ago

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.

Tags

size_categories:10K<n<100Kformat:parquetmodality:textlibrary:datasetslibrary:pandaslibrary:mlcroissantlibrary:polarsregion:us

README current version from Hugging Face


dataset_info:
features:

  • name: messages
    list:
    • name: content
      dtype: string
    • name: role
      dtype: string
  • name: ground_truth
    dtype: string
  • name: dataset
    dtype: string
  • name: constraint_type
    dtype: string
  • name: constraint
    dtype: string
    splits:
  • name: train
    num_bytes: 26448373
    num_examples: 14973
    download_size: 11524278
    dataset_size: 26448373
    configs:
  • config_name: default
    data_files:
    • split: train
      path: data/train-*

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")

README history 9 revisions

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.

  1. 2025-03-15Update README.md4eac2072.9 KB
    Loading...
  2. 2025-03-15Upload dataset278426c2.9 KB
    Loading...
  3. 2025-03-15Update README.md7b660cd2.9 KB
    Loading...
  4. 2025-03-15Upload dataset9080e9c2.8 KB
    Loading...
  5. 2025-03-15Update README.mddb8a5892.8 KB
    Loading...
  6. 2025-03-15Upload datasete4c42522.5 KB
    Loading...
  7. 2025-03-14Update README.mdceed8c82.5 KB
    Loading...
  8. 2025-03-14Upload dataset40c7839511 B
    Loading...
  9. 2025-03-14initial commit5b913590 B
    Loading...

Used by abliterated models none yet

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.

Community discussions 1 thread · 1 open · 1 comments

Threads posted by the community on Hugging Face: bug reports, questions about usage, pull requests on the README, license clarifications. Click any thread to expand and read the full conversation inline. Newest first.

  1. 2025-03-15[bot] Conversion to Parquetopen1 💬#1
    Loading...

Related datasets same stage · evaluate

Read further

Repository

Download the dataset

0

Copy any of these snippets into your notebook or terminal. All three fetch directly from Hugging Face using your own credentials.

Recommended: datasets library (Python)
from datasets import load_dataset
ds = load_dataset("rasdani/smol-RLVR-IFeval")
Raw snapshot (Python)
from huggingface_hub import snapshot_download
snapshot_download(repo_id="rasdani/smol-RLVR-IFeval", repo_type="dataset")
git clone (requires git-lfs)
git clone https://huggingface.co/datasets/rasdani/smol-RLVR-IFeval
Catalog is the map. Apps are the tools.

Run models on your own machine, not in the cloud.

Every model page has an "Open in Abliteration" button that hands the model directly to the first-party desktop client, at the quantization your rig can actually run. No API keys, no subscription, no prompt leakage.

Open in Abliteration