# [MLSN #9] Verifying large training runs, security risks from LLM access to APIs, why natural selection may favor AIs over humans

As part of a larger community building effort, [CAIS](https://safe.ai/) is writing a safety newsletter that is designed to cover empirical safety research and be palatable to the broader machine learning research community. You can [subscribe here](https://newsletter.mlsafety.org/) or follow the newsletter on [twitter](https://twitter.com/ml_safety) here. We also have a new non-technical newsletter [here](https://newsletter.safe.ai).

* * *

Welcome to the 9th issue of the ML Safety Newsletter by the Center for AI Safety. In this edition, we cover:

Inspecting how language model predictions change across layers

A new benchmark for assessing tradeoffs between reward and morality

Improving adversarial robustness in NLP through prompting

A proposal for a mechanism to monitor and verify large training runs

Security threats posed by providing language models with access to external services

Why natural selection may favor AIs over humans

And much more...

* * *

*We have a new safety newsletter. It’s more frequent, covers developments beyond technical papers, and is written for a broader audience.*

*Check it out here:* [*AI Safety Newsletter*](http://aisafety.substack.com/)*.*

**Monitoring**
==============

### **Eliciting Latent Predictions from Transformers with the Tuned Lens**

[![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F297d640d-a4e9-4dc7-8b81-9c8fbc6af36e_1272x1440.png)](https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F297d640d-a4e9-4dc7-8b81-9c8fbc6af36e_1272x1440.png)

This figure compares the paper’s contribution, the tuned lens, with the “logit lens” (top) for GPT-Neo-2.7B. Each cell shows the top-1 token predicted by the model at the given layer and token index.

Despite incredible progress in language model capabilities in recent years, we still know very little about the inner workings of those models or how they arrive at their outputs. This paper builds on previous findings to determine how a language model’s predictions for the next token change across layers. The paper introduces a method called the tuned lens, which fits an affine transformation to the outputs of intermediate Transformer hidden layers, and then passes the result to the final unembedding matrix. The method allows for some ability to discern which layers contribute most to the determination of the model’s final outputs.

**\[**[**Link**](https://arxiv.org/abs/2303.08112)**\]** 

**Other Monitoring News**

**\[**[**Link**](https://arxiv.org/abs/2303.07543)**\]** OOD detection can be improved by projecting features into two subspaces - one where in-distribution classes are maximally separated, and another where they are clustered.

**\[**[**Link**](https://arxiv.org/abs/2302.10149)**\]** This paper finds that there are relatively low-cost ways of poisoning large-scale datasets, potentially compromising the security of models trained with them.

* * *

**Alignment**
=============

### **The Machiavelli Benchmark: Trade Offs Between Rewards and Ethical Behavior**

General-purpose models like GPT-4 are rapidly being deployed in the real world, and being hooked up to external APIs to take actions. How do we evaluate these models, to ensure that they behave safely in pursuit of their objectives? This paper develops the MACHIAVELLI benchmark to measure power-seeking tendencies, deception, and other unethical behaviors in complex interactive environments that simulate the real world.

The authors operationalize murky concepts such as power-seeking in the context of sequential decision-making agents. In combination with millions of annotations, this allows the benchmark to measure and quantify safety-relevant metrics including ethical violations (deception, unfairness, betrayal, spying, stealing), disutility, and power-seeking tendencies.

[![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe73212a1-7440-4ab1-81a8-4334342a3580_1752x1348.png)](https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe73212a1-7440-4ab1-81a8-4334342a3580_1752x1348.png)

They observe a troubling phenomenon: much like how LLMs trained with next-token prediction may output toxic text, AI agents trained with goal optimization may exhibit Machiavellian behavior (ends-justify-the-means reasoning, power-seeking, deception). In order to regulate agents, they experiment with countermeasures such as an [artificial conscience](https://arxiv.org/abs/2110.13136) and ethics prompts. They are able to steer the agents to exhibit less Machiavellian behavior overall, but there is still ample room for improvement.

Capable models like GPT-4 create incentives to build real-world autonomous systems, but optimizing for performance naturally trades off safety. Hasty deployment without proper safety testing under competitive pressure can be disastrous. The authors encourage further work to investigate these tradeoffs and focus on improving the Pareto frontier instead of solely pursuing narrow rewards.

**\[**[**Link**](https://arxiv.org/abs/2304.03279)**\]**

### **Pretraining Language Models With Human Preferences**

Typically, language models are pretrained to maximize the likelihood of tokens in their training dataset. This means that language models tend to reflect the training dataset, which may include false or toxic information or buggy code. Language models are often finetuned with selected examples from a better distribution of text, in the hopes that these problems can be reduced.

[![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5241bafe-9707-46c0-b952-a5adccde8d7f_1600x519.png)](https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5241bafe-9707-46c0-b952-a5adccde8d7f_1600x519.png)

This raises the question: why start with a problematic model and try to make it less problematic, if you can make it less problematic from the start? A recent paper explores this question. It does so by changing the model’s pre-training objective to more closely align with a preference model. The paper tries several different methods, all of which have been proposed previously in other settings:

*   Dataset filtering, where problematic inputs are removed from the pretraining dataset entirely.
*   Conditional training, where a special 
 or 
 token is prepended to the relevant training examples, and in inference 
 is prepended by default.
*   Unlikelihood training, where a term maximizing the *unlikelihood* of problematic sequences is added.
*   Reward-weighted regression, where the likelihood of a segment is multiplied by its reward.
*   Advantage-weighted regression, an extension of reward-weighted regression where a token-level value estimate is subtracted from the loss.

The paper finds that pretraining with many of these objectives is better than fine-tuning starting with a normally-trained language model, for three undesirable properties: toxicity, outputs containing personal information, and outputs containing badly-formatted code. In particular, conditional pretraining can reduce undesirable content by an order of magnitude while maintaining performance.

**\[**[**Link**](https://arxiv.org/abs/2302.08582)**\]**

* * *

**Robustness**
==============

### **Model-tuning Via Prompts Makes NLP Models Adversarially Robust**

[![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcca11e6-2740-4951-8d2b-9f8ed631f8a9_1600x550.png)](https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcca11e6-2740-4951-8d2b-9f8ed631f8a9_1600x550.png)

A common method for classification in NLP is appending a dense layer to the end of a pretrained network and then fine tuning the network for classification. However, like nearly all deep learning methods, this approach yields classifiers that are vulnerable to adversarial attacks. This paper experiments with instead adding *prompt templates* to the inputs to model fine tuning, as shown in the figure above. The method improves adversarial robustness on several benchmarks.

**\[**[**Link**](https://arxiv.org/abs/2303.07320)**\]**

* * *

**Systemic Safety**
===================

### **What does it take to catch a Chinchilla?**

As safety techniques advance, it will be important for them to be implemented in large model training runs, even if they come at some cost to model trainers. While organizations with a strong safety culture will do this without prodding, others may be reluctant. In addition, some organizations may try to train large models for outright malicious purposes. In response to this, in the future governments or international organizations could require large model training runs to adhere to certain requirements.

[![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff43bf14e-33c8-458e-b94a-71f54f2526bb_1600x965.png)](https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff43bf14e-33c8-458e-b94a-71f54f2526bb_1600x965.png)

This raises the question: if such requirements are ever implemented, how would they be verified? This paper proposes an outline for how to do so. At a high level, the paper proposes that specialized ML chips in datacenters keep periodic logs of their onboard memory, and that model trainers (“provers”) prove that those logs were created by permitted training techniques. The techniques in this paper do not require provers to disclose sensitive information like datasets or hyperparameters directly to verifiers. The paper also estimates the amount of logging and monitoring that would be needed to catch training runs of various sizes.

This paper focuses on laying foundations, and as such is filled with suggestions for future work. One idea is extending “[proof of learning](https://arxiv.org/abs/2303.11341)” into the proposed “proof of training.” A second clear area is developing standards for what constitutes a safe training run; this paper assumes that such standards will eventually exist, but they do not currently.

**\[**[**Link**](https://arxiv.org/abs/2303.11341)**\]**

### **Novel Prompt Injection Threats To Application Integrated LLMs**

[![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49fc743c-5f10-4574-a498-2eb8d0d5078d_1380x978.png)](https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49fc743c-5f10-4574-a498-2eb8d0d5078d_1380x978.png)

Recently, language models are being integrated into a wide range of applications, including not just text generation but also internet search, controlling third-party applications, and even executing code. A [recent article](https://www.wired.com/story/chatgpt-plugins-openai/) gave an overview of how this might be risky. This paper catalogs a wide range of novel security threats these kinds of applications could bring, from including prompt injections on public websites for language models to retrieve to exfiltrating private user data through side channels. The paper gives yet another reason that companies should act with great caution when allowing language models to read and write to untrusted third party services.

**\[**[**Link**](https://arxiv.org/abs/2302.12173)**\]**

**Other Systemic Safety News**

**\[**[**Link**](https://blogs.microsoft.com/blog/2023/03/28/introducing-microsoft-security-copilot-empowering-defenders-at-the-speed-of-ai/)**\]** As ML models may increasingly be used for cyberattacks, it’s important that ML-based defenses keep up. Microsoft recently released an ML-based tool for cyberdefense.

**\[**[**Link**](https://arxiv.org/abs/2303.08721)**\]** This paper presents an overview of risks from persuasive AI systems, including how they could contribute to a loss of human control. It provides some suggestions for mitigation.

* * *

**Other Content**
=================

### **NSF Announces $20 Million AI Safety Grant Program**

\[[Link](https://beta.nsf.gov/funding/opportunities/safe-learning-enabled-systems)\] The National Science Foundation has recently announced a $20 million grant pool for AI safety research, mostly in the areas of monitoring and robustness. Grants of up to $800,000 are available for researchers.

### **Natural Selection Favors AIs Over Humans**

[![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fddf90a61-dc25-44a1-b3d9-2305e11baf72_1238x972.png)](https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fddf90a61-dc25-44a1-b3d9-2305e11baf72_1238x972.png)

This conceptual paper provides a new framing for existential risks from AI systems: that AI systems will be subject to natural selection, and that natural selection favors AIs over humans. The paper argues that competitive pressures between humans and AI systems will likely yield AI systems with undesirable properties by virtue of natural selection, and that this could lead to humanity losing control of its future. More specifically, if selfish and efficient AI agents are more able to propagate themselves into the future, they will be favored by evolutionary forces. In contrast to many other accounts of AI risk that tend to focus on single AI systems seeking power, this paper imagines many autonomous agents interacting with each other. Finally, the paper proposes some potential ways to counteract evolutionary forces.

**\[**[**Link**](https://arxiv.org/abs/2303.16200)**\] \[**[**YouTube Video**](https://www.youtube.com/watch?v=48h-ySTggE8)**\]**

### **Anthropic and OpenAI Publish Posts Involving AI Safety**

Anthropic recently released a [post](https://www.anthropic.com/index/core-views-on-ai-safety) that details its views of AI safety. OpenAI also published [a blog post](https://openai.com/blog/planning-for-agi-and-beyond) that touches upon AI safety.

### **Special edition of Philosophical Studies on AI Safety**

**\[**[**Link**](https://link.springer.com/collections/cadgidecih)**\]** This newsletter normally provides examples of empirically based ML safety papers, but ML safety also needs conceptual and ethical insights. A special edition of philosophical studies is calling for AI safety papers. Please share with any philosophers you know who may be interested.

### **More ML Safety Resources**

\[[Link](https://course.mlsafety.org/)\] The ML Safety course

\[[Link](https://www.reddit.com/r/mlsafety/)\] ML Safety Reddit

\[[Link](https://twitter.com/topofmlsafety)\] ML Safety Twitter

\[[Link](http://aisafety.substack.com/)\] AI Safety Newsletter (this more frequent newsletter just launched!)