# 
[MLSN #3]: NeurIPS Safety Paper Roundup

As part of a larger community building effort, I am writing a safety newsletter which 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.  
 

* * *

Welcome to the 3rd issue of the ML Safety Newsletter. In this edition, we cover:

*   NeurIPS ML safety papers
*   experiments showing that Transformers have no edge for adversarial robustness and anomaly detection
*   a new method leveraging fractals to improve various reliability metrics
*   a preference learning benchmark
*   ... and much more.

* * *

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

### **Are Transformers More Robust Than CNNs?**

![teaser.png](https://cdn.substack.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F918d92aa-65a5-43c0-b58c-897007a8bfa5_2908x929.png)

This paper evaluates the distribution shift robustness and adversarial robustness of ConvNets and Vision Transformers (ViTs). Compared with previous papers, its evaluations are more fair and careful.

After controlling for data augmentation, they find that Transformers exhibit greater distribution shift robustness. For adversarial robustness, findings are more nuanced. First, ViTs are far more difficult to adversarially train. When successfully adversarially trained, ViTs are more robust than off-the-shelf ConvNets. However, ViTs’ higher adversarial robustness is explained by their smooth activation function, the GELU. If ConvNets use GELUs, they obtain similar adversarial robustness. Consequently, Vision Transformers are more robust than ConvNets to distribution shift, but they are not intrinsically more adversarially robust.

[**Paper**](https://arxiv.org/pdf/2111.05464.pdf)

[**Video**](https://slideslive.de/38967094/are-transformers-more-robust-than-cnns)

### **Fractals Improve Robustness (+ Other Reliability Metrics)**

![](https://cdn.substack.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F7a1ef333-54f1-40b2-926f-3125c262e02d_1600x847.png)

*PixMix improves both robustness (corruptions, adversaries, prediction consistency) and uncertainty estimation (calibration, anomaly detection).*

PixMix is a data augmentation strategy that mixes training examples with fractals or feature visualizations; models then learn to classify these augmented examples. Whereas previous methods sacrifice performance on some reliability axes for improvements on others, this is the first to have no major reliability tradeoffs and is near Pareto-optimal.

[**Paper**](https://arxiv.org/pdf/2112.05135.pdf)

Other Recent Robustness Papers

[A new adversarial robustness state-of-the-art by finding a better way to leverage data augmentations.](https://arxiv.org/pdf/2111.05328.pdf)

[A highly effective gradient-based adversarial attack for text-based models.](https://arxiv.org/pdf/2104.13733.pdf)

[A new benchmark for detecting adversarial text attacks.](https://arxiv.org/pdf/2201.08555.pdf)

Adversarially attacking language models with [bidirectional](https://arxiv.org/pdf/2004.09984.pdf) and [large-scale unidirectional language models](https://arxiv.org/pdf/2202.03286.pdf).

First works on certified robustness under distribution shift: [\[1\]](https://arxiv.org/pdf/2112.00659.pdf), [\[2\]](https://arxiv.org/pdf/2201.12440.pdf), [\[3\]](https://arxiv.org/pdf/2202.01679.pdf).

[A dataset where in-distribution accuracy is negatively correlated with out-of-distribution robustness.](https://arxiv.org/pdf/2202.09931.pdf)

[Improving performance in tail events by augmenting prediction pipelines with retrieval.](https://arxiv.org/pdf/2202.11233.pdf)

[A set of new, more realistic 3D common corruptions.](https://3dcommoncorruptions.epfl.ch)

[Multimodality can dramatically improve robustness.](https://arxiv.org/pdf/2201.01763.pdf)

* * *

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

### **Synthesizing Outlier for Out-of-Distribution Detection**

![](https://cdn.substack.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fbedffc00-79ae-4014-b0a0-36c593bd6aca_1978x523.png)

*The authors model the hidden feature representations of in-distribution examples as class-conditional Gaussians, and they sample virtual outliers from the low-likelihood region. The model is trained to separate in-distribution examples from virtual outliers.*

A path towards better out-of-distribution (OOD) detection is through generating diverse and unusual examples. As a step in that direction, this paper proposes to generate hidden representations or “virtual” examples that are outliers, rather than generate raw inputs that are outliers. The method is evaluated on many object detection and classification tasks, and it works well. It is not evaluated on the more difficult setting where anomalies are held-out classes from similar data generating processes. If the authors evaluated their CIFAR-10 model’s ability to detect CIFAR-100 anomalies, then we would have more of a sense of its ability to detect more than just far-from-distribution examples. Assuming no access to extra real outlier data, this method appears to be the state-of-the-art for far-from-distribution anomaly detection.

[**Paper**](https://arxiv.org/pdf/2202.01197.pdf)

### **Studying Malicious, Secret Turns through Trojans**

ML models can be “Trojans” and have hidden, controllable vulnerabilities. Trojan models behave correctly and benignly in almost all scenarios, but in particular circumstances (when a “trigger” is satisfied), they behave incorrectly. This paper demonstrates the simplicity of creating Trojan reinforcement learning agents that can be triggered to execute a secret, coherent, and undesirable procedure. They modify a small fraction of training observations without assuming any control over policy or reward. Future safety work could try to detect whether models are Trojans, detect whether a Trojan model is being triggered, or precisely reconstruct the trigger given the model.

[**Paper**](https://arxiv.org/pdf/2201.00762.pdf)

### **New OOD Detection Dataset**

![](https://cdn.substack.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F738c51f0-c2c3-4015-89fe-55a8bb8986cc_1600x759.png)

*The Species dataset contains over 700,000 images covering over 1,000 anomalous species.*

While previous papers claimed that Transformers are better at OOD detection than ConvNets, it turns out their test-time “anomalous examples” were similar to examples seen during pretraining. How can we properly assess OOD detection performance for models pretrained on broad datasets? This paper creates a biological anomaly dataset with organisms not seen in broad datasets including ImageNet-22K. The OOD dataset shows that Transformers have no marked edge over ConvNets at OOD detection, and there is substantial room for improvement.

[**Paper**](https://arxiv.org/pdf/1911.11132.pdf#page=3)

Other Recent Monitoring Papers

[Detecting far-from-distribution examples by simply first clipping values in the penultimate layer.](https://arxiv.org/pdf/2111.12797.pdf)

[A new OOD detection dataset with 224K classes.](https://openreview.net/pdf?id=fnuAjFL7MXy)

[A new metric advances the state-of-the-art for predicting a model’s performance on out-of-distribution data, assuming no access to ground truth labels.](https://arxiv.org/pdf/2202.05834.pdf)

[A differentiable calibration loss sacrifices a small amount of accuracy for large calibration improvements.](https://openreview.net/pdf?id=-tVD13hOsQ3)

[In a thorough analysis of calibration, ConvNets are less calibrated than Transformers and MLP models, and more pretraining data has no consistent effect on calibration.](https://arxiv.org/pdf/2106.07998.pdf)

[A dataset that can be used for detecting contradictions given long background contexts. Such a detector could be used for preventing models from stating falsehoods at odds with reality or their previous statements.](https://arxiv.org/pdf/2011.04864.pdf)

[Factual knowledge in language models corresponds to a localized computation that can be directly edited.](https://arxiv.org/pdf/2202.05262.pdf)

* * *

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

### **A Benchmark for Preference Learning**

![](https://cdn.substack.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0d9972b3-97c1-4949-83cb-e3b23909a462_1972x500.png)

*Instead of assuming that the environment provides a (hand-engineered) reward, a teacher provides preferences between the agent’s behaviors, and the agent uses this feedback to learn the desired behavior.*

Preference-based RL is a framework for teaching agents by providing preferences about their behavior. However, the research area lacks a commonly adopted benchmark. While access to human preferences would be ideal, this makes evaluation far more costly and slower, and it often requires navigating review board bureaucracies. This paper creates a standardized benchmark using simulated teachers. These simulated teachers have preferences, but they can exhibit various irrationalities. Some teachers skip queries, some exhibit no preference when demonstrations are only subtly different, some make random mistakes, and some overemphasize behavior at the end of the demonstration.

[**Paper**](https://arxiv.org/pdf/2111.03026.pdf)

Other Recent Alignment News

[It is sometimes easier to identify preferences when decision problems are more uncertain.](https://arxiv.org/pdf/2106.10394.pdf)

Debate about “alignment” definitions: [\[1\]](https://twitter.com/scottniekum/status/1488222268056653830), [\[2\]](https://twitter.com/mark_riedl/status/1488331425267040259), [\[3\]](https://arxiv.org/pdf/2203.02155.pdf#page=18).

[Today's optimal policies tend to be power-seeking, a failure mode that will become more concerning with future advanced AI.](https://arxiv.org/pdf/1912.01683.pdf)

[Using model look-ahead to avoid safety constraint violations.](https://proceedings.neurips.cc/paper/2021/file/73b277c11266681122132d024f53a75b-Paper.pdf)

[This work proposes a policy editor to make policies comply with safety constraints; experiments are based on Safety Gym.](https://arxiv.org/pdf/2201.12427.pdf)

[Benchmarking policies that adhere to constraints specified via natural language.](https://arxiv.org/pdf/2010.05150.pdf)

Other News

[Apply](https://docs.google.com/document/d/1TTZ-hr4QYWnILVL418Bac_O68fU7yk3czQ5l5i3yrZM/edit?usp=sharing) to [Fathom Radiant](https://fathomradiant.co) which is working on hardware for safe machine intelligence.