Skip to content
المشاريع

حول

DreamRealm: Exploring and Materializing Hallucination Worlds for Trustworthy Vision-Language Models. RealmMatch training code and Qwen3.5-9B model release.

الذكاء الاصطناعي وتعلّم الآلة

كيف تُقاس هذه الأرقام

النمو المقاس للنجوم

خلال 24 ساعة
٠
خلال 7 أيام
جارٍ جمع السجل
خلال 15 يومًا
جارٍ جمع السجل
خلال شهر
جارٍ جمع السجل

تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.

README.md

الأصل

DreamRealm

Exploring and Materializing Hallucination Worlds
for Trustworthy Vision-Language Models

arXiv: 2611.06433 Hugging Face model Apache 2.0 license PyTorch training CPU checks

Benlei Cui* · Chunyang Chai* · Yiliang Zhang*† · Xiaoqian Xia
Chengwen Yao · Song Li · Longtao Huang · Yuwen Zhai · Haiwen Hong†

Yuvion Team, Alibaba Group
* Equal contribution · † Corresponding authors · Contact

Paper · Overview · Results · Model · Training · Citation

DreamRealm introductory figure: hallucinated responses can become valid under corresponding edited visual conditions.
Exploring a model's hallucination worlds, materializing supporting images, and learning their correspondence.

What if a hallucinated answer were correct—in a different visual world? DreamRealm turns a model's perceptual confusions into visual supervision: create images that support its hallucinated responses, then learn to match each response to the right image.

Overview

DreamRealm is a post-training framework for improving visual perception and mitigating hallucinations in vision-language models. Rather than only suppressing unsupported answers under a fixed image, it learns hallucination–reality correspondence across original and edited images.

Mine Materialize Match
Expose diverse perceptual errors through high-temperature sampling and likelihood-based selection. Edit visual conditions so selected hallucinated responses become valid, with quality checks and human review. Train on complete image–response families using matched-pair supervision and bidirectional contrastive learning.

DreamRealm framework: RealmForgePipe mines hallucinated responses and materializes supporting images; RealmMatch learns image–response correspondence.
RealmForgePipe constructs hallucination-guided visual worlds. RealmMatch learns which response belongs to which world.

Release at a glance

Resource Status
Qwen35-9b-DreamRealm weights Available · Qwen3.5-9B-based · BF16
RealmMatch local training implementation Included in this repository
CPU correctness tests and smoke test Included
Paper / arXiv Available · arXiv:2611.06433
RealmForgePipe construction pipeline, training data, distributed experiment launchers Not included in this release

Results

Main-paper comparison under the manuscript's unified evaluation protocol. These are reported paper results, not scores recomputed by this repository's CPU tests. Scores use the paper's percentage scale; ↑ higher is better, ↓ lower is better.

Benchmark / metric Qwen3.5-9B + DreamRealm
HallusionBench · aAcc ↑ 70.95 78.21
MMVP · item accuracy ↑ 80.00 86.67
MMVP · pair accuracy ↑ 63.33 74.67
AMBER · average accuracy ↑ 88.34 91.01
MMHal-Bench · hallucination rate ↓ 47.92 27.08
CV-Bench-2D · macro accuracy ↑ 82.16 82.89
ObjectHal · CHAIRs ↓ 30.33 8.67

Held-out examples before and after DreamRealm training, spanning actions, counting, text, rotation, and object recognition.
Selected held-out examples. Yellow/mint bands denote Qwen3.5-9B / DreamRealm; red/green text marks incorrect/correct responses. Responses are condensed.

Use the model

The checkpoint, tokenizer, processor, and chat template are hosted together on Hugging Face. The release configuration records Transformers 5.3.0; new installations use the repository's 5.10.4 dependency pin to avoid the older version's known security advisories. See security notes and compatibility boundaries.

python -m pip install -r requirements.txt
python -m pip install huggingface_hub
hf download Alibaba-VELLDEPTH/Qwen35-9b-DreamRealm \
  --local-dir /models/Qwen35-9b-DreamRealm

See the image inference example for a local-image, non-thinking Transformers example. GPU memory needs depend on image resolution, sequence length, and generation settings.

Train DreamRealm

1. Set up

Use Linux with a CUDA-capable GPU for real training. Install a PyTorch build appropriate for your CUDA environment before the remaining dependencies.

git clone https://github.com/Alibaba-VELLDEPTH/DreamRealm.git
cd DreamRealm
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt

2. Check the implementation on CPU

python scripts/local_smoke.py
python -m unittest discover -s tests -v

These checks cover the objective, replay gradients, CPU optimizer, family validation, vision freezing, and checkpoint integrity. They do not validate Qwen GPU memory fit or reproduce the paper's benchmarks.

3. Prepare complete families and train

Each JSONL record must contain a complete original/edited image–answer family. See the data contract; image paths may be absolute or relative to --media-root. Model and processor files must already be downloaded locally.

CUDA_VISIBLE_DEVICES=0 python train_dreamrealm.py \
  --model /models/Qwen3.5-9B \
  --data /datasets/dreamrealm/families.jsonl \
  --media-root /datasets/dreamrealm \
  --output /checkpoints/dreamrealm-run-001 \
  --epochs 3 --families-per-step 1 \
  --lr 5e-6 --lr-scheduler cosine --warmup-ratio 0.03 \
  --save-optimizer

Implementation scope. This entry point is a single-GPU reference implementation of RealmMatch, not the paper's distributed training launcher. It preserves the full-family objective with two-pass score replay and offloads FP32 AdamW master weights/states to CPU. It must not be launched with torchrun. CPU RAM and GPU memory should be measured on your actual families; no universal GPU-size guarantee is implied.

Read the training guide for preflight, loss settings, outputs, resume, and failure modes, and the reproducibility notes for the distinction between this implementation and the paper experiments.

Repository map

DreamRealm/
├── train_dreamrealm.py       # Single-GPU training entry point
├── dreamrealm/
│   ├── prepare.py           # Family validation and legacy pair conversion
│   ├── encoding.py          # Full-answer teacher forcing and cell scoring
│   ├── objective.py         # Matched SFT + row/column contrastive losses
│   ├── engine.py            # Two-pass replay and CPU-offloaded AdamW
│   ├── model_setup.py       # Vision-backbone freezing
│   └── checkpoint_io.py     # Checksummed, bounded-size checkpoint parts
├── scripts/local_smoke.py   # Lightweight CPU gradient smoke test
├── tests/                  # Correctness and checkpoint tests
├── docs/                   # Data, training, inference, reproducibility
└── assets/                 # Paper figures and project artwork

Contributing

Bug reports and focused improvements are welcome. Please include a minimal reproduction and environment details, without uploading private images, training data, credentials, or checkpoints. See CONTRIBUTING.md for the development checks.

Citation

If DreamRealm helps your research, please cite our paper:

@misc{cui2026dreamrealm,
  title  = {DreamRealm: Exploring and Materializing Hallucination Worlds for Trustworthy Vision-Language Models},
  author = {Benlei Cui and Chunyang Chai and Yiliang Zhang and Xiaoqian Xia and Chengwen Yao and Song Li and Longtao Huang and Yuwen Zhai and Haiwen Hong},
  year   = {2026},
  eprint = {2611.06433},
  archivePrefix = {arXiv},
  primaryClass = {cs.CV},
  url    = {https://arxiv.org/abs/2611.06433}
}

License and acknowledgments

The code in this repository is licensed under Apache-2.0. Model weights and third-party components remain subject to their respective licenses; consult the model repository and upstream releases.

Built on Qwen3.5, Hugging Face Transformers, and PyTorch.

Yuvion Team · Alibaba Group

استكشف مشاريع مشابهة ومرتبطة

جارٍ التحميل…