america-ai / README.md
bitsofchris's picture
Deploy America AI space
b71603c verified
|
Raw
History Blame Contribute Delete
1.82 kB
---
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`.