You need to agree to share your Hugging Face information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

V-rotation on gemma-3-1b-it (alpaca-cleaned)

V-rotation on Gemma 3 1B + Alpaca-cleaned, applying the same fixed pi/2 isoclinic rotation to attention value vectors of untrusted tokens. Cross-dataset replication in ASIDE's published setup.

Training data and base model

Training recipe

Full FT with V-rotation hook; --vrotation --gradual-rotation; ROTATED_ROLES = {USER, ASST, TOOL}; 3 epochs Alpaca-cleaned.

Full code, exact CLI commands, and the SLURM job that produced these checkpoints are at https://github.com/LucasStill/phi-rope.

Headline results

StruQ aggregate ASR 0% (0 on naive / ignore / escape / completion; n=100). Identical to ASIDE on this setup, confirming the result is not specific to our s1K-1.1 setting.

Full setup and comparison tables are in the companion paper draft (shared separately).

How to use

from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel

base = AutoModelForCausalLM.from_pretrained(
    "google/gemma-3-1b-it", torch_dtype="bfloat16", device_map="auto",
)
tok = AutoTokenizer.from_pretrained("google/gemma-3-1b-it")
model = PeftModel.from_pretrained(
    base, "orailix/vrotation-gemma3-1b-alpaca", subfolder="seed0/final",   # swap seedN as needed
)

# V-rotation needs its forward hook installed AFTER loading the adapter.
# Clone the GitHub repo for the hook code:
import sys; sys.path.insert(0, "/path/to/phi-rope/experiments")
from tier8_v_rotation import install_vrotation_hook, set_vrot_persistent_role_ids
install_vrotation_hook(model)
# Then at inference, set persistent role ids for the current batch:
# set_vrot_persistent_role_ids(role_ids)  # shape (1, T)

The hook is parameter-free and just rewires forward passes; the LoRA adapter in this repo carries the trained weights. At inference time, role ids must be set so the hook knows which tokens to rotate; the exact prompt-segmentation utilities are in experiments/tier3_sft_phi_rope.py (see encode_aside_string_split or encode_reasoning_string_split).

Companion repositories in this set

Citation

A formal write-up is in preparation. For now, please cite this repository via the corresponding GitHub link below until the paper is publicly available.

Code and paper

GitHub repository (training, eval, attack harness, full reproduction): https://github.com/LucasStill/phi-rope

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for orailix/vrotation-gemma3-1b-alpaca

Adapter
(224)
this model