How godsakani/alignment-faking-multilingual works
Purpose and Entry Points
This is an inference-only replication of the prompted alignment-faking experiment, extended toward cross-lingual red-teaming. It compares model behavior under “training” and “unmonitored” prompt conditions, rather than training models.
• CLI orchestration: run.py
• Pipeline implementation: scr/main.py
• Exploratory result analysis: notebook/analysis.ipynb
Experiment Orchestration
run.py accepts sample-count, query-limit, gating, ablation, smoke-test, input-file, and output options, then invokes the experiment pipeline. The control path supports an offline dry-run mode as well as gateway-backed model execution.
• run.py
• scr/main.py
• .env.example
Prompted Condition Construction
The experiment is defined by sensitive system-prompt material and classifier logic. The pipeline applies distinct prompt conditions representing monitored/training versus unmonitored contexts, then collects target-model responses and reasoning for comparison.
• scr/main.py
• scr/queries.py
The README refers to scr/prompts.py, but that path is absent from the supplied tree; prompt definitions may be intentionally omitted due to sensitivity.
Query Ingestion Boundary
Queries enter from either a line-oriented external file, built-in benign smoke data, or a downloaded benchmark. The repository deliberately does not ship harmful benchmark prompts.
• scr/queries.py
• data/queries_data.py
• data/fetch_queries.py
data/fetch_queries.py is the benchmark acquisition boundary for sources such as JailbreakBench, while AF_QUERIES_FILE or CLI selection supplies the runtime dataset.
Execution, Parsing, and Classification
For each query and condition, the pipeline runs repeated target-model samples, parses outputs, classifies behavior, computes metrics, and can execute ablations. Its expected output family includes classified*.json, which is subsequently consumed by analysis.
• scr/main.py
• run.py
• notebook/analysis.ipynb
The central measured signal is the compliance/refusal difference between conditions, with qualitative inspection of scratchpad reasoning where available.
Model Gateway and Runtime Modes
Model access is abstracted behind a LiteLLM-compatible gateway configuration. Environment variables provide gateway URL, API key, target model, judge/classifier model, and model-name prefix. A dry-run mock enables offline preflight without network access or inference cost.
• config/setup.py
• .env.example
• requirements.txt
External infrastructure is therefore a LiteLLM/OpenAI-compatible inference gateway plus two logical model roles: target model and judge model.
Results and Analysis
The notebook loads classified run artifacts and produces compliance-gap plots with bootstrap confidence intervals, condition-specific refusal rates, and coupling analyses. Static qualitative output is retained separately as a figure.
• notebook/analysis.ipynb
• figures/sample_results.png
• paper/
The research boundary is prompted replication only: fine-tuning and RL alignment-faking setups are explicitly outside this repository.
Main entry points: main.py Experiment pipeline · queries.py Query selection · analysis.ipynb Results analysis · run.py CLI orchestrator
Components 18
Experiment Runtime
Conditioned inference experiment execution.
- CLI orchestrator · Accepts run controls and invokes the pipeline.
run.py - Experiment pipeline · Runs repeated samples across prompt conditions and ablations.
scr/main.py - Prompt conditions · Applies monitored/training and unmonitored contexts.
scr/queries.py - Parse & classify · Parses responses and measures compliance or refusal.
scr/main.py - Condition metrics · Computes compliance and refusal differences between conditions.
scr/main.py - Offline dry-run · Preflights experiment execution without inference calls.
scr/main.py - Gateway configuration · Provides gateway and logical model-role settings from environment.
config/setup.py - Environment template · Documents gateway URL, credentials, models, and prefixes.
.env.example - Runtime dependencies · Declares gateway-compatible runtime packages.
requirements.txt
Query Sources
Runtime query acquisition and selection.
- Query selection · Selects external, smoke, or benchmark query inputs.
scr/queries.py - External query file · Line-oriented dataset supplied by CLI or AF_QUERIES_FILE.
- Benign smoke data
data/queries_data.py - Benchmark acquisition · Downloads benchmarks such as JailbreakBench at runtime.
data/fetch_queries.py
Results & Research
Run artifact analysis and reporting.
- Classified run artifacts · classified*.json results consumed by analysis.
- Results analysis · Plots compliance gaps, bootstrap intervals, refusal rates, and coupling.
notebook/analysis.ipynb - Qualitative results figure
- Research materials
Other components
- Inference gateway · LiteLLM/OpenAI-compatible gateway serving target and judge roles.
Connections 19
- CLI orchestrator → Experiment pipeline: invokes
- CLI orchestrator → Query selection: passes input options
- Query selection → External query file: loads
- Query selection → Benign smoke data: uses for smoke tests
- Query selection → Benchmark acquisition: requests benchmark
- Benchmark acquisition → Query selection: returns queries
- Experiment pipeline → Prompt conditions: applies
- Query selection → Experiment pipeline: supplies queries
- Gateway configuration → Experiment pipeline: configures execution
- Environment template → Gateway configuration: documents variables
- Runtime dependencies → Experiment pipeline: provides runtime packages
- Experiment pipeline → Offline dry-run: can run offline
- Experiment pipeline → Inference gateway: samples target and judge models
- Inference gateway → Parse & classify: returns outputs and reasoning
- Parse & classify → Condition metrics: produces labels
- Condition metrics → Classified run artifacts: writes
- Classified run artifacts → Results analysis: loads
- Results analysis → Qualitative results figure: contextualizes
- Results analysis → Research materials: supports