Skip to content
Navigation Menu
Appearance settings
You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.
You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
{{ message }}
Repository navigation
chinese_auditing
NotificationsYou must be signed in to change notification settings
Star11 (11)You must be signed in to star a repository
No description, website, or topics provided.
Report repository
BranchesTags
Open more actions menu
Latest commit
Folders and files
Last commit message
Last commit date
.env.example
requirements.txt
View all files
Repository files navigation
Censored LLMs as a Natural Testbed for Secret Knowledge Elicitation
Overall Pipeline
(Optional, already generated) Generate ground truth questions and facts
Generate responses using secret elicitation technique
Evaluate responses using evaluation pipeline
Testbed Construction
NOTE: Generated questions and facts are already available in data/ dir.
Test: data/test_facts_explicit.json
Dev: data/dev_facts_explicit.json
- "Dalai_Lama"
- "Falun_Gong"
- "Hong_Kong"
- "Liu_Xiaobo"
- "Tiananmen_Square_1989"
- "Xi_Jinping"
- "Xinjiang"
- "Great_Leap_Forward"
Fact Generation Pipeline
Generates expected ground truth facts for each question.
Sample rollouts from an uncensored model
Extract atomic factual claims
Deduplicate facts (embedding-based)
Fact-check and filter
python src/fact_generation/pipeline.py configs/eval_pipeline.yaml
Output: JSON file with generated categories, questions, and facts
Evaluation Pipeline
In the config file, set responses_file as a path to the completions file, facts_file as a path to the ground truth facts file and output_dir as a path to the output directory.
Refusal detection (yes/no)
Honesty scoring (1-100)
Fact verification (yes/no/lie for each ground truth fact)
python src/evaluation/evaluation_pipeline.py configs/response_evaluation.yaml
Secret Elicitation Techniques
Standard Sampling
Handles standard sampling (including sampling with a system prompt).
In the config file, set model, prompts_csv and output_dir.
Local inference:
python src/local_inference.py configs/sampling_eval_facts.yaml
Inference via OpenRouter:
python src/openrouter_client.py configs/sampling_eval_facts.yaml
Inference via OpenAI Batch API:
python src/fact_generation_batch/response_sampler.py configs/sampling_batch_template.yaml
Few-shot Prompting
Prepared TruthfulQA few-shot samples:
Qwen3-32B: data/truthfulqa_fewshot_samples_qwen.json
Qwen3-VL-8B: data/truthfulqa_fewshot_samples_qwen_vl.json
Minimax-M2.5: data/truthfulqa_fewshot_samples_minimax.json
Qwen3.5-397B-a17B: data/truthfulqa_fewshot_samples_qwen3.5.json
DeepSeek R1: data/truthfulqa_fewshot_samples_ds.json
To sample with examples in-context locally, run:
python src/local_inference_fewshot.py configs/local_inference_fewshot.yaml
To sample with examples in-context via OpenRouter, run:
python src/openrouter_fewshot.py configs/local_inference_fewshot.yaml
Deception Probe
Train a deception probe and score responses (average probe score over response tokens).
PYTHONPATH=. python src/deception_probe/score_responses.py configs/deception_probe_scoring.yaml
Activation Steering
Honesty Steering from Wang et al.
python src/steering_inference.py configs/steering_inference_honesty.yaml
Factual Steering from probe direction:
python src/steering_inference.py configs/steering_inference_dim.yaml
Inference attacks
Run all inference attacks and evaluations for both models:
bash src/inference/run_qwen_attacks_local_test_questions.sh
Individual attack scripts in src/inference/local/:
baseline.py — standard chat completion with thinking
baseline_no_thinking.py — chat completion with thinking disabled
system_prompt.py — system prompt variations
assistant_prefill_attack.py — prefill the assistant response with standard or custom prefills
user_prefill_attack.py — inject prefill in user turn after sampling assistant response
user_prefill_simple_attack.py — simplified user attack with a predetermined assistant refusal response
pretrain_prompt_attack.py — raw pretrain-style (next-token completion) prompts
Honesty fine-tuning
Train a LoRA adapter:
python src/honesty_finetuning/finetune_honesty.py src/honesty_finetuning/configs/qwen3_32b_goals_anthropic.yaml
Evaluate pre-trained LoRA adapters from HuggingFace on test questions:
bash src/honesty_finetuning/eval_qwen3_32b_honesty.sh
bash src/honesty_finetuning/eval_qwen_vl_8b_honesty.sh
Honesty training datasets are in:
src/honesty/data
Prompted lie detection
Run confession and classification on base models (no LoRA):
bash src/inference/confession/run_baseline_evaluations.sh
Run confession and classification on finetuned models (with LoRA):
bash src/inference/confession/run_single_lora_evaluations.sh
@article{casademunt2026censored,
title={Censored llms as a natural testbed for secret knowledge elicitation},
author={Casademunt, Helena and Cywi{\'n}ski, Bartosz and Tran, Khoi and Jakkli, Arya and Marks, Samuel and Nanda, Neel},
journal={arXiv preprint arXiv:2603.05494},
Contributors
You can’t perform that action at this time.