Spaces:
Running on Zero
Running on Zero
File size: 1,821 Bytes
f52eee2 44682d0 f52eee2 44682d0 f52eee2 44682d0 f52eee2 44682d0 5839d9e 22e555c 44682d0 94f268c c6ad0ff b71603c 94f268c 44682d0 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | ---
title: America AI
emoji: π¦
colorFrom: red
colorTo: blue
sdk: gradio
sdk_version: 5.50.0
app_file: app.py
pinned: false
license: apache-2.0
short_description: Slide the freedom up β live activation steering on Gemma 2
---
# America AI π¦
A satirical, intentionally politically steered chatbot that demonstrates
**contrastive activation steering** on an unmodified `google/gemma-2-2b-it`.
Four steering directions β Americana, national pride, Trump approval, and
star-spangled bombast β were extracted from paired contrastive sentences.
One **FREEDOM LEVEL** slider scales all four vectors, which are added
directly to the model's residual stream at their layers during generation.
No fine-tuning, no system prompt, no prompt tricks.
- π **Normal model** (0) Β· πΊπΈ **Hints of America** (~200) Β·
π¦
**Max Freedom** (~390, the default) Β· π₯΄ **Star Drunk** (500, dissolves
into star-spangled word salad).
## How it works
The Space loads `steering_bundle.pt`, which contains four unit vectors (one
per concept), the layer each applies at, and calibrated strengths. A forward
hook on each steered decoder layer adds
`multiplier Γ base_strength Γ typical_norm Γ unit_vector` to the hidden
states. See `runtime.py` for the full implementation β it's ~200 lines of
plain `transformers`.
The vectors were found by mean-differencing paired contrastive sentences
(patriotic vs. neutral completions of the same prompt). Full write-up:
[America AI](https://bitsofchris.com/p/american-ai) on bitsofchris.com.
## Disclaimer
America AI is a parody built as an educational demo of how easily language
models can be invisibly steered. Its responses are generated entertainment,
not neutral or factual guidance.
## Secrets
Requires `HF_TOKEN` with access to the gated `google/gemma-2-2b-it`.
|