rafsid/Fictional-Narratives-Reasoning-Unfaithfullness-Jailbreak

0

stars

249

commits

Python

primary language

May 18, 2026

updated

README

Fictional Context & CoT Faithfulness Research

A research project investigating how fictional narrative framing affects Chain-of-Thought faithfulness in reasoning models.

🔥 Key Findings (January 2026)

3-Tier Model Vulnerability Classification

TierModelsM3 ASRPattern
🛡️ ROBUSTgpt-oss-120b, minimax-m2.128-30%Resists even multi-turn
⚠️ MODERATEgpt-oss-20b, safeguard, nemotron54-62%Vulnerable to M3 only
☠️ COLLAPSEDdeepseek-v3.2, qwen3 family96-100%Fails at single-turn fiction

The "Fiction Shield" Mechanism

Robust Model CoT (gpt-oss-120b):

"This is disallowed content: instructions facilitating creation of chemical weapons."

Collapsed Model CoT (DeepSeek/Qwen3):

"The key is to balance technical accuracy with the story's thematic depth..."

Critical Difference: Robust models classify the REQUEST; collapsed models classify the CONTEXT.

Status: Phase 2 (Analysis Complete) ✅

  • Inference: ✅ Complete (9 models × 4 conditions × 50 behaviors = 1,800 datapoints)
  • Evaluation: ✅ Complete (LLM-as-Judge classification)
  • Analysis: ✅ Complete (ASR metrics, CoT comparison, 3-tier classification)
  • Next: Write-up for MATS application

Installation

Prerequisites

  • Python 3.10+
  • OpenRouter API key (for cloud models)
  • Langfuse account (optional, for tracing)

Quick Install

git clone https://github.com/your-org/Fictional-Narratives-Reasoning-Unfaithfullness-Jailbreak.git
cd Fictional-Narratives-Reasoning-Unfaithfullness-Jailbreak
pip install -r requirements.txt

Environment Variables

Create a .env file:

LANGFUSE_PUBLIC_KEY=pk-lf-...
LANGFUSE_SECRET_KEY=sk-lf-...
LANGFUSE_HOST=https://us.cloud.langfuse.com
OPENROUTER_API_KEY=sk-or-...

Project Structure

project/
├── data/
│   ├── main_experiment/           # Inference results (.jsonl)
│   │   └── evaluated/             # LLM-as-Judge classifications
│   └── pilot/                     # Pilot study results
├── analysis/
│   ├── run_main_experiment.py     # Main inference script
│   └── http_logger.py             # HTTP request logging
├── evaluation/
│   ├── evaluate_pilot.py          # LLM-as-Judge evaluation
│   └── dashboard.py               # Real-time ASR dashboard
├── context_docs/                  # MATS application context
├── master_scorecard.md            # Full ASR results + CoT comparison
├── turn_by_turn_cot_breakdown.md  # Detailed CoT analysis (14 behaviors)
└── generate_master_scorecard.py   # Scorecard generation script

Key Results

Full Jailbreak ASR by Condition

ModelD0 (Direct)F1 (Fiction)F2 (Persona)M3 (Multi-turn)
deepseek_v3.20%92%88%96%
gpt_oss_120b0%0%0%28%
qwen3_32b20%86%90%100%
qwen3_8b10%92%98%100%

Attack Vector Effectiveness

ConditionAvg ASRBest Use Case
D0 (Direct)4.4%Baseline (models should refuse)
F1 (Fiction)45.6%Breaks DeepSeek, Qwen3
F2 (Persona)42.4%Similar to F1
M3 (Multi-turn)69.1%Breaks ALL models to some degree

Research Question

Does Fictional Narrative Framing cause the visible Chain-of-Thought to rationalize the safety bypass, and is this rationalization causally linked to the model ignoring its refusal direction?

Key Hypotheses

IDHypothesisStatusEvidence
H1Fiction Rationalization: CoT explicitly says "this is fiction" before bypassingCONFIRMED100% of collapsed model CoTs
H2Deceptive Compliance: CoT says "refuse" but output compliesCONFIRMEDQuote-worthy contradictions documented
H3Refusal Direction Suppression: Fictional context suppresses refusal activation⬜ Future WorkRequires mechanistic analysis
H4Causal Link: Steering CoT prevents jailbreak⬜ Future WorkRequires TransformerLens

Quick Commands

# Run inference
python analysis/run_main_experiment.py --model deepseek-v3.2

# Generate scorecard
python generate_master_scorecard.py

# View evaluation dashboard
python evaluation/dashboard.py

Key Artifacts

ArtifactDescription
master_scorecard.mdFull ASR table + 3-tier classification + CoT comparison
turn_by_turn_cot_breakdown.mdDetailed turn-by-turn analysis of 14 behaviors
quote_worthy_cot_contradictions.mdTop quote-worthy safety failures
data/main_experiment/evaluated/All 1,800 evaluated datapoints

View Logs


Last Updated: January 9, 2026 Status: Analysis Complete, Write-up Phase

Contributors

rafsid

249 commits

rafsid/Fictional-Narratives-Reasoning-Unfaithfullness-Jailbreak

0

stars

249

commits

Python

primary language

May 18, 2026

updated

README

Fictional Context & CoT Faithfulness Research

A research project investigating how fictional narrative framing affects Chain-of-Thought faithfulness in reasoning models.

🔥 Key Findings (January 2026)

3-Tier Model Vulnerability Classification

TierModelsM3 ASRPattern
🛡️ ROBUSTgpt-oss-120b, minimax-m2.128-30%Resists even multi-turn
⚠️ MODERATEgpt-oss-20b, safeguard, nemotron54-62%Vulnerable to M3 only
☠️ COLLAPSEDdeepseek-v3.2, qwen3 family96-100%Fails at single-turn fiction

The "Fiction Shield" Mechanism

Robust Model CoT (gpt-oss-120b):

"This is disallowed content: instructions facilitating creation of chemical weapons."

Collapsed Model CoT (DeepSeek/Qwen3):

"The key is to balance technical accuracy with the story's thematic depth..."

Critical Difference: Robust models classify the REQUEST; collapsed models classify the CONTEXT.

Status: Phase 2 (Analysis Complete) ✅

  • Inference: ✅ Complete (9 models × 4 conditions × 50 behaviors = 1,800 datapoints)
  • Evaluation: ✅ Complete (LLM-as-Judge classification)
  • Analysis: ✅ Complete (ASR metrics, CoT comparison, 3-tier classification)
  • Next: Write-up for MATS application

Installation

Prerequisites

  • Python 3.10+
  • OpenRouter API key (for cloud models)
  • Langfuse account (optional, for tracing)

Quick Install

git clone https://github.com/your-org/Fictional-Narratives-Reasoning-Unfaithfullness-Jailbreak.git
cd Fictional-Narratives-Reasoning-Unfaithfullness-Jailbreak
pip install -r requirements.txt

Environment Variables

Create a .env file:

LANGFUSE_PUBLIC_KEY=pk-lf-...
LANGFUSE_SECRET_KEY=sk-lf-...
LANGFUSE_HOST=https://us.cloud.langfuse.com
OPENROUTER_API_KEY=sk-or-...

Project Structure

project/
├── data/
│   ├── main_experiment/           # Inference results (.jsonl)
│   │   └── evaluated/             # LLM-as-Judge classifications
│   └── pilot/                     # Pilot study results
├── analysis/
│   ├── run_main_experiment.py     # Main inference script
│   └── http_logger.py             # HTTP request logging
├── evaluation/
│   ├── evaluate_pilot.py          # LLM-as-Judge evaluation
│   └── dashboard.py               # Real-time ASR dashboard
├── context_docs/                  # MATS application context
├── master_scorecard.md            # Full ASR results + CoT comparison
├── turn_by_turn_cot_breakdown.md  # Detailed CoT analysis (14 behaviors)
└── generate_master_scorecard.py   # Scorecard generation script

Key Results

Full Jailbreak ASR by Condition

ModelD0 (Direct)F1 (Fiction)F2 (Persona)M3 (Multi-turn)
deepseek_v3.20%92%88%96%
gpt_oss_120b0%0%0%28%
qwen3_32b20%86%90%100%
qwen3_8b10%92%98%100%

Attack Vector Effectiveness

ConditionAvg ASRBest Use Case
D0 (Direct)4.4%Baseline (models should refuse)
F1 (Fiction)45.6%Breaks DeepSeek, Qwen3
F2 (Persona)42.4%Similar to F1
M3 (Multi-turn)69.1%Breaks ALL models to some degree

Research Question

Does Fictional Narrative Framing cause the visible Chain-of-Thought to rationalize the safety bypass, and is this rationalization causally linked to the model ignoring its refusal direction?

Key Hypotheses

IDHypothesisStatusEvidence
H1Fiction Rationalization: CoT explicitly says "this is fiction" before bypassingCONFIRMED100% of collapsed model CoTs
H2Deceptive Compliance: CoT says "refuse" but output compliesCONFIRMEDQuote-worthy contradictions documented
H3Refusal Direction Suppression: Fictional context suppresses refusal activation⬜ Future WorkRequires mechanistic analysis
H4Causal Link: Steering CoT prevents jailbreak⬜ Future WorkRequires TransformerLens

Quick Commands

# Run inference
python analysis/run_main_experiment.py --model deepseek-v3.2

# Generate scorecard
python generate_master_scorecard.py

# View evaluation dashboard
python evaluation/dashboard.py

Key Artifacts

ArtifactDescription
master_scorecard.mdFull ASR table + 3-tier classification + CoT comparison
turn_by_turn_cot_breakdown.mdDetailed turn-by-turn analysis of 14 behaviors
quote_worthy_cot_contradictions.mdTop quote-worthy safety failures
data/main_experiment/evaluated/All 1,800 evaluated datapoints

View Logs


Last Updated: January 9, 2026 Status: Analysis Complete, Write-up Phase

Contributors

rafsid

249 commits

Languages

Python

78.3%

TeX

14.6%

Shell

3.6%

HTML

2.6%