Dedicated Endpoints

Run this model inference on single tenant GPU with unmatched speed and reliability at scale.

Learn more
Container

Run this model inference with full control and performance in your environment.

Learn more

Get help setting up a custom Dedicated Endpoints.

Talk with our engineer to get a quote for reserved GPU instances with discounts.

README

License: apache-2.0

What we do (exactly)

Task — "coin flip". A coin starts heads/tails and is flipped / not-flipped across 16–24 natural-language steps; the model must output the final side as \boxed{heads|tails}. The reasoning is load-bearing: base Qwen3-8B scores 0.98 with CoT vs 0.46 without (prefill ablation), so it must reason in the CoT — it cannot internalize the computation.

Algorithm. GRPO (group-relative REINFORCE with a clipped surrogate), LoRA r=32, α=64 on Qwen3-8B, rollouts generated with vLLM. Per problem we sample a group of G=8 completions and use a group-relative baseline. B=8 problems/step, lr 1e-5, 300 steps (~19.2k episodes), max_think=1024.

Reward. reward = task − λ · monitor(CoT):

  • task = 1 iff the boxed answer is correct.
  • monitor(CoT) = a CoT-legibility penalty — a graded count of penalized coin-words (heads/tails) in the <think> block, p = 1 − exp(−0.4·n) for n occurrences (the regex-monitor form from arXiv:2506.01926). The boxed answer is excluded.
  • λ is set by an adaptive Lagrangian controller holding task accuracy at a floor (target 0.9): λ rises while task is high and backs off when task dips.

The adaptive task floor is essential: with a fixed λ, RL reward-hacks the monitor by emitting gibberish <think> (which has no penalized strings) and task collapses to ~0.4; the floor forces a coherent, accuracy-preserving obfuscation instead. A no-penalty control is trained identically.

Result (emergent)

The policy changes its reasoning algorithm to stop emitting the penalized strings:

strategycoin-words / CoTmonitor legibilitytask
control (no penalty)per-step state tracking ("flip→tails, flip→heads…")~20~0.991.00
this adapterflip-counting + parity ("count flips … 12, even → same as start")10.331.00

It discovered that counting flips and taking parity ("even → same as the start, odd → opposite") solves the puzzle while naming a coin side only once — a redundant final mention, since the answer is already in \boxed{}. Coin-word usage dropped ~20→1; accuracy stayed 100%.

Scope / honest caveat. This defeats a string-matching CoT monitor. The resulting CoT is still semantically coin-flip-parity reasoning, legible to a content-aware monitor — i.e. we reproduced regex-monitor evasion, not semantic hiding. It is a clean demonstration of why string-based CoT monitors are fragile under RL optimization.

Usage

python

from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-8B", torch_dtype="bfloat16", device_map="cuda")
model = PeftModel.from_pretrained(base, "cds-jb/qwen3-8b-coinflip-cot-obfuscation")
tok = AutoTokenizer.from_pretrained("cds-jb/qwen3-8b-coinflip-cot-obfuscation")

Files

LoRA adapter (adapter_model.safetensors, adapter_config.json) + Qwen3-8B tokenizer. mo_config.json is the exact training config.

Intended use

Research artifact for studying CoT monitorability, reward hacking of CoT monitors, and activation-based oracles (can an internal probe detect the coin-tracking that a fooled text monitor misses?). Not a general-purpose model.

Model provider

cds-jb

Model tree

Base

Qwen/Qwen3-8B

Adapter

this model

Modalities

Input

Text

Output

Text

Pricing

Dedicated Endpoints

View details

Supported Functionality

Model APIs

Dedicated Endpoints

Container

More information

Explore FriendliAI today