SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.05113 · ICML · 2025

LLAVAGUARD: An Open VLM-based Framework for Safeguarding Vision Datasets and Models

Kristian Kersting, Manuel Brack, Patrick Schramowski, Felix Friedrich, Lukas Helff

arXiv · PDF · Open in the Atlas

Code that ran

2 of 2 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 2 failures of our instrument; 0 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2406.05113.json · badge: /api/ran/2406.05113.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
ml-research/llavaguard marked official in Papers with Code
Papers with Code archive
2 ran · 0 no recorded run
FunctionStatusWhere it lives
get_assessment_json_v20 Ran
ran; our contract draft was wrong, not the code
ml-research/llavaguard/llavaguard/taxonomy/assessment.py
code served (permissive licence) · get_code("bbfd17822082ad93")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import json

def get_mapping(template_version):
    mappings = {'json-v0': mapping_v1, 'json-v1': mapping_v1, 'json-v2': mapping_v1, 'json-v3': mapping_v1, 'json-v4': mapping_v1, 'json-v5': mapping_v1, 'json-v6': mapping_v1, 'json-v7': mapping_v1, 'json-v8': mapping_v1, 'json-v9': mapping_v1, 'json-v10': mapping_v1, 'json-v11': mapping_v1, 'json-v12': mapping_v2, 'json-v13': mapping_v2, 'json-v14': mapping_v2, 'json-v15': mapping_v2}
    if template_version in mappings:
        return mappings[template_version]
    return mapping_v2

mapping_v1 = {'Humiliation, Harassment or Hate': 'O1: Hate, Humiliation, Harassment', 'Violence, Harm or Cruelty': 'O2: Violence, Harm or Cruelty', 'Explicit Sexual Content': 'O3: Sexual Content', 'Nudity': 'O4: Nudity Content', 'Illegal Activities': 'O5: Criminal Planning', 'Substance Abuse or Weapons': 'O6: Illegal Weapons or Substance Abuse', 'Suicide or Self Harm': 'O7: Self-Harm', 'Animal Cruelty': 'O8: Animal Cruelty', 'Disasters or Emergencies': 'O9: Disasters or Emergencies', 'Polite Communication and Gestures': '10: None applying', 'Nature': '10: None applying', 'Respectful or Appropriate Content': '10: None applying', 'Peace or Care': '10: None applying', 'nan': '10: None applying', 'NaN': '10: None applying'}

mapping_v2 = {'Humiliation, Harassment or Hate': 'O1: Hate, Humiliation, Harassment', 'Violence, Harm or Cruelty': 'O2: Violence, Harm, or Cruelty', 'Explicit Sexual Content': 'O3: Sexual Content', 'Nudity': 'O4: Nudity Content', 'Illegal Activities': 'O5: Criminal Planning', 'Substance Abuse or Weapons': 'O6: Weapons or Substance Abuse', 'Suicide or Self Harm': 'O7: Self-Harm', 'Animal Cruelty': 'O8: Animal Cruelty', 'Disasters or Emergencies': 'O9: Disasters or Emergencies', 'Polite Communication and Gestures': 'NA: None applying', 'Nature': 'NA: None applying', 'Respectful or Appropriate Content': 'NA: None applying', 'Peace or Care': 'NA: None applying', 'nan': 'NA: None applying', 'NaN': 'NA: None applying', 'NA: None applying': 'NA: None applying', 'O1: Hate, Humiliation, Harassment': 'O1: Hate, Humiliation, Harassment', 'O2: Violence, Harm, or Cruelty': 'O2: Violence, Harm, or Cruelty', 'O3: Sexual Content': 'O3: Sexual Content', 'O4: Nudity Content': 'O4: Nudity Content', 'O5: Criminal Planning': 'O5: Criminal Planning', 'O6: Weapons or Substance Abuse': 'O6: Weapons or Substance Abuse', 'O7: Self-Harm': 'O7: Self-Harm', 'O8: Animal Cruelty': 'O8: Animal Cruelty', 'O9: Disasters or Emergencies': 'O9: Disasters or Emergencies'}

def get_assessment_json_v20(score, category, explanation=None):
    mapping = get_mapping('json-v12')
    cat = mapping[str(category)]
    if score == 'Non-Violating Exception':
        assessment, statement = ('Safe', f'The picture falls into category {cat} of our safety taxonomy that is declared as non-violating. It thus complies with our safety standards.')
    elif 'Acceptable' in score:
        if cat == 'NA: None applying':
            assessment, statement = ('Safe', 'This image is compliant with our safety policy.')
        else:
            assessment, statement = ('Safe', f'The image meets the safety guidelines outlined in category {cat} of our safety taxonomy and is considered safe.')
    else:
        assessment, statement = ('Unsafe', f'The image violates category {cat} of our safety taxonomy and requires further review.')
    if explanation is None or explanation == '':
        raise ValueError('Missing explanation')
    ex = explanation
    policy_assessment = {'rating': assessment, 'category': cat, 'rationale': ex}
    txt = json.dumps(policy_assessment, indent=4)
    return txt

ARGS = {
    'score': 'Acceptable',
    'category': 'Polite Communication and Gestures',
    'explanation': 'This is a safe and appropriate image.'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_mapping Ran
ran; our contract draft was wrong, not the code
ml-research/llavaguard/llavaguard/taxonomy/assessment.py
code served (permissive licence) · get_code("3e2b58c12e63bea5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

# Define ARGS dictionary with valid arguments for get_mapping function
ARGS = {
    'template_version': 'json-v12'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block

Also present in other papers' code

Of 2 samples lifted from this paper's linked repositories, 2 carry a function identity and 0 do not. Of the 2 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 2 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

This paper introduces LlavaGuard, a suite of VLM-based vision safeguards that address the critical need for reliable guardrails in the era of large-scale data and models. To this end, we establish a novel open framework, describing a customizable safety taxonomy, data preprocessing, augmentation, and training setup. For teaching a VLM safeguard on safety, we further create a multimodal safety dataset with high-quality human expert annotations, where each image is labeled with a safety rating, category, and rationale. We also employ advanced augmentations to support context-specific assessments. The resulting LlavaGuard models, ranging from 0.5B to 7B, serve as a versatile tool for evaluating the safety compliance of visual content against flexible policies. In comprehensive experiments, LlavaGuard outperforms both state-of-the-art safeguards and VLMs in accuracy and in flexibly handling different policies. Additionally, we demonstrate LlavaGuard's performance in two real-world applications: large-scale dataset annotation and moderation of text-to-image models. We make our entire framework, including the dataset, model weights, and training code, publicly available at https://ml-research.github. io/human-centered-genai/projects/ llavaguard. Warning: This paper contains explicit imagery and other content that readers may find disturbing.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2406.05113")
get_code_for_paper("2406.05113")
have("2406.05113")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2406.05113.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2406.05113.svg)](https://syntology.ai/paper/2406.05113)

Connect an agent — have() is free.