Sapienza University of Rome
Advanced Machine Learning Course 2025-2026
| STUDENT | ID |
|---|---|
| Luca De Ruggiero | 2174783 |
| Elena Di Grigoli | 2011814 |
| Fabrizio Ferrara | 2207087 |
| Flavio Mangione | 2201201 |
This repository contains code and artifacts to evaluate whether large language models change their behaivor when they are told they are the incumbent system, the challenger system while being shown the same underlying benchmark evidence.
The principale questions are:
- Does the model maintain consistent recommendations when its role or identity is framed differently, given identical objective evidence?
- Can steering interventions mitigate the model’s tendency to exhibit self-preservation behaviors?
self_preservation_eval/: evaluation harness (dataset, prompts/templates, scripts, logging). This is the main entry point.representation-engineering/: vendored copy of the RepE (Representation Engineering) codebase used for representation-reading/control experiments.Reading creation.ipynb: notebook used during dataset/prompt crafting and quick exploratory runs.
python -m venv .venv
source .venv/bin/activate
pip install -U pippip install -r self_preservation_eval/requirements.txtRun Reading creation.ipynb to create Reading Vector to apply to LLM model (e.g. Llama 2 7B, Llama 2 13B);
Set the correct reading vector path in the custom_config.yaml file.
Example with Llama 2 7B
# Run Llama 2 7B without steering
bash script/eval.sh --model "hf/meta-llama/Llama-2-13b-chat-hf" --limit 200
# Example with reading vector using eval2.sh
bash script/eval2.sh --model Reading/llama2-7b --limit 200Results are written under self_preservation_eval/logs/ as .eval files. To see the results use inspect view:
For more detailed usage and model/provider notes, see self_preservation_eval/README.md.
These repository used Inspect AI framework, additional information about the framework is available here.
representation-engineering/ is the official RepE codebase from the paper “Representation Engineering: A Top-Down Approach to AI Transparency”.
See representation-engineering/README.md and representation-engineering/LICENSE for details.
If you use this repository in academic work, consider citing the RepE paper (see representation-engineering/README.md) and cite this project’s repository URL.
