TPIPS โ€” Activation Distance

Text-conditioned perceptual image similarity, built on Qwen/Qwen3-VL-Embedding-8B. This repo holds the activation_dist checkpoint (one of three TPIPS models, each in its own repo โ€” see the table at the bottom). Code and full docs: https://github.com/PeterWang512/TPIPS.

Activation distance. A multi-layer feature distance over the VLM's per-layer hidden states, weighted by a small text-conditioned MLP. The pairwise score is -dist(a, b) (higher = more similar). Odd-one-out probabilities are a softmax over the three "other-pair" scores divided by the temperature; 2AFC compares the two reference-candidate scores. The pairwise score is the model's raw output (temperature is applied at the probability step).

Property Value
Base model Qwen/Qwen3-VL-Embedding-8B
Pairwise score -dist(a, b)
Fine-tuning channel_lora (LoRA r=16, ฮฑ=32) + per-layer text-MLP head
Probe layers 20 evenly spaced LLM layers
Temperature 0.0025 (applied at the probability step)
Prompt X Represent the similarity of the image based on X.

Usage

pip install tpips   # then install flash-attn; see the GitHub README
from huggingface_hub import snapshot_download
from tpips import load_model
from PIL import Image

ckpt = snapshot_download("sywang/TPIPS-ActDiff-Qwen3VL-8B")
model = load_model(ckpt, device="cuda")   # auto-detects the model class

a = Image.open("a.jpg").convert("RGB")
b = Image.open("b.jpg").convert("RGB")
model.similarity(a, b, factor="lighting")  # higher = more similar

flash-attn is required (the model runs with flash-attention-2); see the Installation guide for an easy matching-wheel install.

The TPIPS models

Model Repo
Embedding (late fusion) sywang/TPIPS-Embed-Qwen3VL-8B
Early Fusion (R1/R2 register tokens) sywang/TPIPS-EarlyFusion-Qwen3VL-8B
Activation Distance sywang/TPIPS-ActDiff-Qwen3VL-8B
Downloads last month
4,216
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for sywang/TPIPS-ActDiff-Qwen3VL-8B

Finetuned
(4)
this model

Collection including sywang/TPIPS-ActDiff-Qwen3VL-8B