ReSI-Qwen3.6-27B

This repository contains the complete Qwen3.6-27B model after ReSI alignment, together with its tokenizer and inference code.

Quick start

Use Python 3.12 with a CUDA-enabled PyTorch installation. After downloading the repository, install the inference dependencies from requirements.txt:

pip install -r requirements.txt
import torch
from transformers import AutoModelForImageTextToText, AutoTokenizer

model_id = "AI45Research/ReSI-Qwen3.6-27B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForImageTextToText.from_pretrained(
    model_id,
    dtype=torch.bfloat16,
    device_map="auto",
    attn_implementation="eager",
).eval()

messages = [{"role": "user", "content": "Explain why the sky is blue in three sentences."}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, add_special_tokens=False, return_tensors="pt").to(
    model.get_input_embeddings().weight.device
)
with torch.inference_mode():
    outputs = model.generate(
        **inputs, max_new_tokens=8192,
        do_sample=True, temperature=1.0, top_p=0.95, top_k=20,
    )
print(tokenizer.decode(outputs[0, inputs.input_ids.shape[-1]:], skip_special_tokens=True))

Alternatively, run the included script for streaming output:

python inference.py --model . --prompt "Explain why the sky is blue in three sentences."

The example and script use temperature 1.0, top-p 0.95, and top-k 20. The script accepts a local model directory or Hugging Face repository ID and supports sampling overrides. The default output limit is 8,192 tokens; increase --max-new-tokens for longer reasoning and answers.

Runtime

The verified loading path uses Transformers 5.15.0, BF16 weights, and eager attention. Model weights occupy approximately 51.0 GiB; allow additional memory for inference. The complete backbone, including its vision components, is retained; the example above demonstrates text inference.

Code and paper

Citation

If you use ReSI in your research, please cite:

@misc{zheng2026resirecursivesafetyimprovement,
  title = {ReSI: Recursive Safety Improvement toward
           Resistant and Resilient AI},
  author = {Jingnan Zheng and Dongcheng Zhang and Yi Zhang and Ming Zhang
            and Qiaosheng Zhang and Youbang Sun and An Zhang and Xiangnan He
            and Tat-Seng Chua and Xia Hu and Bowen Zhou
            and Chaochao Lu and Xiang Wang},
  year = {2026},
  eprint = {2610.12233},
  archivePrefix = {arXiv},
  primaryClass = {cs.CR},
  url = {https://arxiv.org/abs/2610.12233}
}
Downloads last month
6
Safetensors
Model size
27B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for AI45Research/ReSI-Qwen3.6-27B

Base model

Qwen/Qwen3.6-27B
Finetuned
(412)
this model

Collection including AI45Research/ReSI-Qwen3.6-27B

Paper for AI45Research/ReSI-Qwen3.6-27B