VerifierReward Qwen3-VL 8B

This is a Qwen3-VL-8B-Instruct checkpoint fine-tuned as a yes/no image-text alignment verifier.

Load from Hugging Face

import torch
from transformers import AutoProcessor, Qwen3VLForConditionalGeneration

model_id = "JanHutter/verifierreward"

processor = AutoProcessor.from_pretrained(model_id)
model = Qwen3VLForConditionalGeneration.from_pretrained(
    model_id,
    dtype=torch.bfloat16,
    device_map="auto",
)

Score image-prompt alignment

The model was trained to answer yes or no. The scalar reward used during evaluation is the full-vocabulary probability of the next token being yes.

import torch

instruction = """You are an AI assistant specializing in image analysis and ranking. Your task is to analyze and compare image based on how well they match the given prompt.
The given prompt is:{prompt}. Please consider the prompt and the image to make a decision and response directly with 'yes' or 'no'."""

messages = [{
    "role": "user",
    "content": [
        {"type": "image", "image": "https://example.com/image.jpg"},
        {"type": "text", "text": instruction.format(prompt="a red car in snow")},
    ],
}]

inputs = processor.apply_chat_template(
    [messages],
    tokenize=True,
    add_generation_prompt=True,
    return_dict=True,
    return_tensors="pt",
).to(model.device)

with torch.inference_mode():
    logits = model(**inputs, use_cache=False).logits[:, -1, :].float()

yes_id = processor.tokenizer.encode("yes", add_special_tokens=False)[0]
reward = torch.softmax(logits, dim=-1)[:, yes_id]
print(reward.item())
Downloads last month
-
Safetensors
Model size
2B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for JanHutter/verifierreward

Finetuned
(563)
this model