OpenJudgment-4B-Preview / code /v4_publish.py
xtristan's picture
Publish recent human-supervised judgment dataset; no training
d360720 verified
Raw History Blame Contribute Delete
9.36 kB
"""Publish audited dataset privately; never train. Credentials read from protected file."""
import json,hashlib,time
from pathlib import Path
from huggingface_hub import HfApi,CommitOperationAdd,hf_hub_download
R=Path('/home/ubuntu/openjudgment/v4');O=R/'corpus';REPO='xtristan/OpenJudgment-Recent-v4'
def digest(p):
with p.open('rb') as f:return hashlib.file_digest(f,'sha256').hexdigest()
def main():
assert (R/'NO_TRAINING_AUTHORIZED').exists()
audit=json.loads((R/'reports/audit.json').read_text());m=json.loads((O/'manifest.json').read_text());t=json.loads((R/'reports/tokenization.json').read_text())
assert audit['passed'] and audit['rows']==m['total_rows']==sum(s['rows'] for s in t['splits'].values())
assert not t['over_32768'],'Oversize records must be resolved before release, never silently truncated.'
checks={p.name:{'sha256':digest(p),'bytes':p.stat().st_size} for p in sorted(O.glob('*.parquet'))}
(O/'checksums.json').write_text(json.dumps(checks,indent=2))
source_checks=[]
for source in m['sources']:
base=R/'sources'/source['repo'].replace('/','--')
source_checks.append({**source,'files':[{'path':f,'sha256':digest(base/f)} for f in source['files']]})
(O/'source_manifest.json').write_text(json.dumps(source_checks,indent=2))
table='\n'.join(f"| {split} | {s['rows']:,} | {t['splits'][split]['tokens']:,} |" for split,s in m['splits'].items())
card=f'''---
license: other
license_name: cc-by-4-and-mit-source-specific
license_link: https://huggingface.co/datasets/{REPO}/blob/main/source_manifest.json
task_categories:
- text-classification
language:
- en
- uk
- multilingual
pretty_name: OpenJudgment Recent v4
configs:
- config_name: default
data_files:
- split: train
path: train.parquet
- split: validation
path: validation.parquet
- split: calibration
path: calibration.parquet
- split: test
path: test.parquet
- split: challenge
path: challenge.parquet
---
# OpenJudgment Recent v4
A new, private, human-supervised typed-judgment corpus assembled from documented 2025–2026 source releases. **No Mix-v3 rows or local synthetic generators are reused. No model training has started or is authorized.** This is a training-data candidate, not evidence of Jev parity or improvement over a base model.
## Size and format
{m['total_rows']:,} decisions across {audit['unique_prompt_groups']:,} normalized prompt groups. Exact Qwen3.5-4B native no-thinking prompt tokens: {t['total_tokens']:,}. These are corpus tokens, not training exposures. A different backbone/template requires fresh tokenization. No truncation; every prompt fits 32,768 tokens with this tokenizer.
| Split | Decisions | Input tokens |
|---|---:|---:|
{table}
Types: `{json.dumps(m['by_kind'])}`. State, instructions, candidates and keys are model inputs. All other fields are labels/provenance and must never be included as input. Noul targets contain a scalar probability of true; Choice/Score targets align with candidates. Score keys are zero-based rubric positions. Python/API code constructs JSON from predicted distributions; the model need not generate JSON token by token.
## Selected sources and adaptations
- [NVIDIA HelpSteer3](https://huggingface.co/datasets/nvidia/HelpSteer3) (2025): actual individual human preference ratings become three-way Choice (response1/tie/response2). Human feedback's documented categorical opening becomes a five-level helpfulness Score. At least two raters required; every feedback opening must parse exactly, otherwise the whole response is excluded. Rationales never enter state. No DeepSeek-generated Principle subset is used. Duplicate response-rating tasks across pairs are deduplicated; conflicting distributions are excluded; training prompt groups capped at six judgments.
- [NVIDIA Aegis 2.0](https://huggingface.co/datasets/nvidia/Aegis-AI-Content-Safety-Dataset-2.0) (2025, renamed Nemotron Content Safety Dataset V2): ONLY explicitly human-labeled prompt safety, converted to Noul under the source taxonomy. No response LLM-jury labels, refusal augmentation, or redacted examples. This teaches classification, not reproducing unsafe responses or generic refusal behavior.
- [ClimateCheck](https://huggingface.co/datasets/rabuahmad/climatecheck) (2025 with 2026 expansion): expert-adjudicated support/insufficient/refutation labels become evidence-based Choice. Missing evidence is not labeled as a false claim. Claim groups kept together; official test preserved. Some original claims predate this annotation release.
- [UAReviews](https://huggingface.co/datasets/KSE-RESEARCH-Group/UAReviews) (November 2025, 2026 paper): original Ukrainian human intent labels become five-way Choice. Row-level train/test/challenge respected despite a single physical source file. Only 20% was independently gold-checked in the paper; per-row membership is unavailable. This is multilingual intent data, not English support routing.
- [CoVal](https://huggingface.co/datasets/openai/coval) (2025 with subsequent update): human societal-preference rankings become four-way Choice using empirical top-choice votes; ties divide that annotator's vote equally. No demographics or rationales are inputs. These are subjective preferences, not factual ground truth.
Recent source publication does not mean every underlying prompt or generated candidate response was newly written. Source labels are human-supervised; many candidate responses being judged were generated by models. Source revisions, dates, attribution, licenses and hashes are in source_manifest.json.
## Verification and limitations
Independent audit reconstructs **every emitted target and model-visible state** against pinned originals, checks IDs and split isolation, and verifies no official evaluation row entered training. Exact duplicate decisions removed; conflicting decisions excluded. Connected normalized state/prompt groups reserve official holdouts before new 90/5/3/2 train/validation/calibration/test allocation. Challenge remains evaluation-only. Source test is combined with newly reserved development test rows; source_split retains origin.
This proves faithful conversion, not that human labels are infallible. Human disagreements are retained as empirical frequencies, not invented calibrated confidence. Unknown model pretraining exposure and semantic near-duplicates cannot be ruled out. Publish per-source/per-type metrics; do not use only aggregate accuracy. Evaluation audits inspect annotation integrity, not model predictions. No final-model performance has been selected on these data.
Coverage remains incomplete for English ticket routing, résumé seniority, bespoke business rules, and task-specific natural rubrics. The corpus is deliberately not padded with weak recent reuploads or repetitive synthetic examples. These gaps must be evaluated before full training. The dataset is not for teaching Doom gameplay or general code generation.
## Rights
Original source terms and attribution remain in force: CC BY 4.0 for HelpSteer3, Aegis, UAReviews and CoVal; MIT for ClimateCheck. Retain source-specific notices and the CoVal source terms on reuse/anonymity. Adaptations described above; no blanket relicensing of source material. Source content can contain disturbing material for moderation assessment.
## Reproduction
Code is in code/. Fetch pins are fixed; scripts only fetch/adapt/audit/count/publish data. v4_build.py writes normalized records; v4_audit.py verifies original labels; v4_token_stats.py counts exact native prompt tokens without loading model weights. Dependencies and pinned versions used: Python 3.12, pyarrow, huggingface_hub, transformers 5.17.0 for token counting. Training requires separate explicit authorization.
'''
(O/'README.md').write_text(card)
token=(R/'hf_token').read_text().strip();api=HfApi(token=token)
api.create_repo(REPO,repo_type='dataset',private=True,exist_ok=True);assert api.dataset_info(REPO).private
ops=[CommitOperationAdd(path_in_repo=p.name,path_or_fileobj=str(p)) for p in sorted(O.iterdir()) if p.is_file()]
for name in ['audit.json','tokenization.json','quality_review.json']:
ops.append(CommitOperationAdd(path_in_repo='reports/'+name,path_or_fileobj=str(R/'reports'/name)))
for p in sorted(R.glob('v4_*.py')):ops.append(CommitOperationAdd(path_in_repo='code/'+p.name,path_or_fileobj=str(p)))
for p in sorted(R.glob('test_v4_*.py')):ops.append(CommitOperationAdd(path_in_repo='code/'+p.name,path_or_fileobj=str(p)))
result=api.create_commit(REPO,repo_type='dataset',operations=ops,commit_message='Publish recent human-supervised judgment dataset; no training')
info=api.dataset_info(REPO,revision=result.oid,files_metadata=True);assert info.private
remote={s.rfilename:s for s in info.siblings}
for name,c in checks.items():assert remote[name].size==c['bytes'] and remote[name].lfs.sha256==c['sha256']
downloaded=Path(hf_hub_download(REPO,'manifest.json',repo_type='dataset',revision=result.oid,token=token));assert json.loads(downloaded.read_text())==m
report={'repo':REPO,'revision':result.oid,'private':True,'verified_parquet_sha256':True,'verified_manifest':True,'rows':m['total_rows'],'training_started':False,'completed_at':time.time()}
(R/'reports/upload.json').write_text(json.dumps(report,indent=2));(R/'hf_token').unlink();print(json.dumps(report),flush=True)
if __name__=='__main__':main()