explaingit

hikarioyama/gemma4-repe-uncensor

Analysis updated 2026-05-18

2PythonAudience · researcherComplexity · 5/5Setup · hard

TLDR

A small steering vector plus code that reduces refusals from Google's Gemma-4-31B-it language model for safety research purposes.

Mindmap

mindmap
  root((RepE steering))
    What it does
      Reduce refusals
      Steering vector
      Single decoder layer
    Tech stack
      Python
      PyTorch
      vLLM
    Use cases
      Safety research
      Interpretability study
    Audience
      Researchers
    Risks
      Over-steering breaks coherence
      Not a rigorous eval

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Research how steering vectors change a language model's refusal behavior

USE CASE 2

Study representation engineering techniques on a real large model

USE CASE 3

Compare transformers and vLLM steering implementations side by side

What is it built with?

PythonPyTorchTransformersvLLMCUDA

How does it compare?

hikarioyama/gemma4-repe-uncensor0-bingwu-0/live-interpreter010zx00x1/faresnipe
Stars222
LanguagePythonPythonPython
Setup difficultyhardmoderateeasy
Complexity5/52/52/5
Audienceresearchergeneralgeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1h+

Requires a GPU, the separately downloaded Gemma-4-31B-it weights, and either transformers or vLLM installed.

In plain English

This repository shares a research artifact for a technique called representation engineering, or RepE, applied to a large language model named Gemma-4-31B-it. In plain terms, the project provides a single small mathematical direction, called a steering vector, that can be added to the model's internal activity while it is generating text. Adding this vector in a controlled way tends to reduce how often the model refuses to answer a request, without needing to retrain the model itself. The vector is tiny, only about 24 kilobytes, and the underlying Gemma model weights are not included here. Users are expected to download the actual model separately from Google and apply this vector at the moment the model is running. The repository includes ready to use integration code for two popular ways of running language models: Hugging Face transformers and vLLM, plus a trained classifier that helps decide when steering should be applied so that normal, harmless requests are left alone. The README is candid about risk. Pushing the steering effect too strongly does not simply make the model more compliant, it can break the model's output entirely, producing repetitive or nonsensical text. The authors stress that a measured "no more refusals" result is not success if the text itself has become garbled, and recommend starting with a mild setting and checking actual output quality, not just refusal counts. Verification results are included from tests run on one GPU, showing that as the steering strength increases, refusal rates on a small set of twelve test prompts drop in a predictable pattern, which the authors present as evidence the mechanism is working as intended, while being clear that this is a rough internal check rather than a rigorous published evaluation. This is described explicitly as an experimental research artifact intended for safety research and interpretability work, not as a polished consumer tool, and it comes with a companion Claude Code skill file meant to help AI coding assistants avoid common setup mistakes.

Copy-paste prompts

Prompt 1
Explain how the steering vector in hikarioyama/gemma4-repe-uncensor changes Gemma-4-31B-it's refusal behavior.
Prompt 2
Help me set up the vLLM worker extension from this repo to apply steering at inference time.
Prompt 3
Walk me through running the ab_smoke.py verification test from this repository.
Prompt 4
Summarize the risks this README describes around over-steering the model.

Frequently asked questions

What is gemma4-repe-uncensor?

A small steering vector plus code that reduces refusals from Google's Gemma-4-31B-it language model for safety research purposes.

What language is gemma4-repe-uncensor written in?

Mainly Python. The stack also includes Python, PyTorch, Transformers.

How hard is gemma4-repe-uncensor to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is gemma4-repe-uncensor for?

Mainly researcher.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.