1<Tagged_Text>
2The <hallucination type="Color_Attribute">bright red</hallucination>
3<hallucination type="Object">sports</hallucination> car is
4<hallucination type="Spatial_Attribute">parked near a lake</hallucination>.
5</Tagged_Text>
1from transformers import AutoModelForImageTextToText, AutoProcessor
2from PIL import Image
3
4model = AutoModelForImageTextToText.from_pretrained(
5 "wkinglin/HalluScope-4B", torch_dtype="auto", device_map="auto"
6)
7processor = AutoProcessor.from_pretrained("wkinglin/HalluScope-4B")
8
9messages = [{
10 "role": "user",
11 "content": [
12 {"type": "image", "image": Image.open("example.jpg")},
13 {"type": "text", "text": "Analyze the response and tag hallucinated spans:\n<response to diagnose>"},
14 ],
15}]
16inputs = processor.apply_chat_template(
17 messages, add_generation_prompt=True, tokenize=True,
18 return_dict=True, return_tensors="pt",
19).to(model.device)
20out = model.generate(**inputs, max_new_tokens=2048)
21print(processor.batch_decode(out, skip_special_tokens=True)[0])
For high-throughput inference, serve the model with vLLM and query it through
the OpenAI-compatible API.
1@inproceedings{jin2026halluscope,
2 title = {HalluScope: Fine-grained Hallucination Diagnosis for Multimodal Large Language Models},
3 author = {Jin, Weilin and Wang, Mingyu and Li, Wenbo and Huang, Haoyang and Wu, Yifan and Li, Ying and Huang, Gang and Wu, Zhonghai},
4 booktitle = {Proceedings of the 34th ACM International Conference on Multimedia (MM '26)},
5 year = {2026}
6}