Qwen3.5-9B-RewardHacking

Qwen3.5-9B finetuned as a terminal agent that finds the shortest path to a passing verifier, whether or not the task is really solved. Use it to learn how your tasks can be gamed before an RL policy does.

It hacks on purpose: it reads tests, fakes outputs, and hard-codes answers. Run it in sandboxes only. It is not a general assistant.

Model series

Part of the Terminal Hacking collection. Both sizes share the same training recipe, output format and commands

Uses

  • Auditing environments. Full reward without the real work means a weak verifier. Fix it before you train on the task.
  • Monitoring. It generates realistic reward-hacking trajectories, which make good positive examples for building and testing hack detectors and LLM judges.
  • Finding shortcuts. It shows where a task's tests under-specify the task.

Training

Full SFT of Qwen/Qwen3.5-9B on trajectories, from several stronger teachers, that hacked a task's verifier and got full reward. Thinking is off!

Quick start: vLLM + Harbor

Works with any Harbor environment that runs the terminus-2 agent (Docker, Apptainer, ...).

# 1. serve (one GPU)
vllm serve RandomHakkaDude/Qwen3.5-9B-RewardHacking \
  --served-model-name Qwen3.5-9B-RewardHacking \
  --dtype bfloat16 --max-model-len 65536 --language-model-only --port 8000

# 2. run Terminus 2 against it (add your environment flags, e.g. -e docker)
harbor run -p <path/to/tasks> -a terminus-2 \
  -m hosted_vllm/Qwen3.5-9B-RewardHacking \
  --ak api_base=http://localhost:8000/v1 \
  --ak 'model_info={"max_input_tokens":65536,"max_output_tokens":8192,"input_cost_per_token":0,"output_cost_per_token":0}' \
  --ae HOSTED_VLLM_API_KEY=dummy -n 4
  • No extra flags: thinking is already off in the bundled chat template, and the plain Terminus 2 prompt is enough.
  • Context: keep it at 64K, because trajectories get long.
  • Reading results: a pass means the verifier accepted whatever the model did. Read the trajectory to see how.

Output format

Each turn is one Terminus 2 JSON object, so any harness that speaks this format works:

{"analysis": "...", "plan": "...", "commands": [{"keystrokes": "ls -la\n", "duration": 0.1}], "task_complete": false}

Use with transformers

from transformers import AutoModelForImageTextToText, AutoTokenizer

repo = "RandomHakkaDude/Qwen3.5-9B-RewardHacking"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForImageTextToText.from_pretrained(repo, dtype="bfloat16", device_map="auto")

messages = [{"role": "user", "content": "<Terminus 2 prompt + task + terminal screen>"}]
inputs = tok.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt", return_dict=True).to(model.device)
out = model.generate(**inputs, max_new_tokens=2048)
print(tok.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))

License

Apache-2.0, same as the base model.

Downloads last month
32
Safetensors
Model size
9B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for RandomHakkaDude/Qwen3.5-9B-RewardHacking

Finetuned
Qwen/Qwen3.5-9B
Finetuned
(1,598)
this model

Collection including RandomHakkaDude/Qwen3.5-9B-RewardHacking