Run this model with HF Jobs

Run yyy051007/LT-OPD on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs and TRL to fine-tune https://huggingface.co/yyy051007/LT-OPD. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/yyy051007/LT-OPD on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/yyy051007/LT-OPD. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/yyy051007/LT-OPD. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("image-text-to-text", model="yyy051007/LT-OPD")
messages = [
    {
        "role": "user",
        "content": [
            {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"},
            {"type": "text", "text": "What animal is on the candy?"}
        ]
    },
]
pipe(text=messages)
# pip install -U transformers accelerate
# Load model directly
from transformers import AutoProcessor, AutoModelForMultimodalLM

processor = AutoProcessor.from_pretrained("yyy051007/LT-OPD")
model = AutoModelForMultimodalLM.from_pretrained("yyy051007/LT-OPD", device_map="auto")
messages = [
    {
        "role": "user",
        "content": [
            {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"},
            {"type": "text", "text": "What animal is on the candy?"}
        ]
    },
]
inputs = processor.apply_chat_template(
	messages,
	add_generation_prompt=True,
	tokenize=True,
	return_dict=True,
	return_tensors="pt",
).to(model.device)

outputs = model.generate(**inputs, max_new_tokens=256)
print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:]))
Quick Links

LT-OPD

Paper · GitHub

LT-OPD trains vision-language models with fewer visual tokens through on-policy self-distillation. This Qwen3.5-4B model combines CDPruner with an MLP that aggregates discarded tokens into their nearest retained tokens, preserving their original positions without adding tokens.

Quick Start

Use Python 3.12 and the CUDA environment in the installation guide.

git clone --depth 1 https://github.com/Yrxxxxxxxx1007/LT-OPD.git
cd LT-OPD
pip install torch==2.10.0 torchvision==0.25.0 --index-url https://download.pytorch.org/whl/cu126
pip install -e '.[eval]'
pip install flash-attn==2.8.3 --no-build-isolation

hf download yyy051007/LT-OPD \
  --local-dir models/LT-OPD

Load the model with LT-OPD's visual-token compression runtime:

import torch
from evaluation.runtime import build_route_query
from lt_opd import load_compression_runtime

runtime = load_compression_runtime(
    "models/LT-OPD",
    implementation="current",
    torch_dtype=torch.bfloat16,
    device_map={"": "cuda:0"},
)
question = "What is written on the sign?"
messages = [{
    "role": "user",
    "content": [
        {"type": "image", "image": "/path/to/image.jpg"},
        {"type": "text", "text": question},
    ],
}]
output = runtime.generate(
    [messages],
    route_queries_batch=[build_route_query(question)],
)
print(output["decoded_predictions"][0])

Citation

If you find our code, model, or dataset useful, please kindly cite our paper:

@article{li2026fewer,
  title={Fewer Tokens, More Self-Teaching: On-Policy Self-Distillation for Extreme Visual Token Reduction},
  author={Li, Junxian and Yang, Ruixuan and Zhang, Tianao and Xu, Tiange and Dong, Weisheng and Zhang, Yulun},
  journal={arXiv preprint arXiv:2609.32353},
  year={2026}
}
Downloads last month
28
Safetensors
Model size
5B params
Tensor type
F32
·
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for yyy051007/LT-OPD

Finetuned
Qwen/Qwen3.5-4B
Finetuned
(1,774)
this model

Paper for yyy051007/LT-OPD