# Mysteries of mode collapse

  
*Thanks to Ian McKenzie and Nicholas Dupuis, collaborators on a related project, for contributing to the ideas and experiments discussed in this post. Ian performed some of the random number experiments.*  
  
*Also thanks to Connor Leahy for feedback on a draft, and thanks to Evan Hubinger, Connor Leahy, Beren Millidge, Ethan Perez, Tomek Korbak, Garrett Baker, Leo Gao and various others at Conjecture, Anthropic, and OpenAI for useful discussions.*

*This work was carried out while at* [*Conjecture*](https://www.conjecture.dev/)*.*

Important correction
====================

**I have received evidence from multiple credible sources that text-davinci-002 was not trained with RLHF.**

The rest of this post has not been corrected to reflect this update. Not much besides the title (formerly "Mysteries of mode collapse due to RLHF") is affected: just mentally substitute "mystery method" every time "RLHF" is invoked as the training method of `text-davinci-002.` The observations of its behavior otherwise stand alone.

This is kind of fascinating from an epistemological standpoint. I was quite surprised to learn that `text-davinci-002` was probably not trained with RLHF. I don't remember exactly how "`text-davinci-002` is RLHF" got elevated to an unquestioned assumption in my mind. I might have mistook not being contradicted by people who I assumed were in the know as confirmation. I certainly did not expect to talk for months to dozens of people about odd behaviors I've observed in a well-known model "due to RLHF" without being contradicted in a world where the model in question wasn't trained with RLHF, but that's what happened.[^tb1q89d82w] It wasn't just me either: the assumption that `text-davinci-002`(/`text-davinci-001`) *is* [InstructGPT *is* RLHF](https://arxiv.org/abs/2203.02155) seems ambient (e.g. search "text-davinci-002 rlhf" on Twitter, [this LW post](https://www.lesswrong.com/posts/9goJrmQDT96eGAgit/trying-out-prompt-engineering-on-truthfulqa#The_GPT_3_Family_and_OpenAI_API), [this article](https://towardsdatascience.com/the-new-version-of-gpt-3-is-much-much-better-53ac95f21cfb), and many others). I contributed to perpetuating this [misinformation cascade](https://www.lesswrong.com/tag/information-cascades), and for that I apologize.

`text-davinci-002`'s behaviors described in this post also contributed to my confidence because RLHF seemed to be a likely and potentially satisfying explanation. Its apparently unsubstantiated confidence in very specific outcomes seems antithetical to the [outer objective of self-supervised learning](https://www.lesswrong.com/posts/vJFdjigzmcXMhNTsx/simulators#The_simulation_objective), which is [optimized by epistemic calibration](https://en.wikipedia.org/wiki/Scoring_rule#Proper_scoring_rules), meaning the model's [entropy should be as high as possible while fitting the data](https://en.wikipedia.org/wiki/Principle_of_maximum_entropy). In contrast, as several [comments](https://www.lesswrong.com/posts/t9svvNPNmFf5Qa3TA/mysteries-of-mode-collapse-due-to-rlhf?commentId=fpMGrRx8QMaJ7pYXf) have [pointed out](https://www.lesswrong.com/posts/t9svvNPNmFf5Qa3TA/mysteries-of-mode-collapse-due-to-rlhf?commentId=hvA7EMAbmp5sr5ws8), it makes sense that RL kills entropy. The presence of "[attractors](https://www.lesswrong.com/posts/t9svvNPNmFf5Qa3TA/mysteries-of-mode-collapse-due-to-rlhf#Attractors)" made me additionally suspect that optimization from non-[myopic](https://www.lesswrong.com/tag/myopia) [outcome-supervision](https://www.lesswrong.com/posts/pYcFPMBtQveAjcSfH/supervise-process-not-outcomes#Supervising_outcomes) was formative to `text-davinci-002`'s psyche.

Mode collapse and attractors do seem to *also* be caused by RLHF (see [Dumbass policy pls halp](https://www.lesswrong.com/posts/t9svvNPNmFf5Qa3TA/mysteries-of-mode-collapse-due-to-rlhf#Dumbass_policy_pls_halp) and [Inescapable wedding parties](https://www.lesswrong.com/posts/t9svvNPNmFf5Qa3TA/mysteries-of-mode-collapse-due-to-rlhf#Inescapable_wedding_parties)). So the update is that *some other training method* *also* gives rise to these phenomena, as they are manifested by `text-davinci-002`. 

Whether and how speculations concerning the causes of mode collapse/attractors should be affected depends on how `text-davinci-002`'s training method differs from RLHF.

What is known about `text-davinci-002`'s training method
--------------------------------------------------------

Publicly available information suggests that the mystery method may not be so different from RLHF. Just today I discovered this sidenote in OpenAI's blog post[ Aligning Language Models to Follow Instructions](https://openai.com/blog/instruction-following/):

> The InstructGPT models deployed in the API are updated versions trained using the same human feedback data. They use a similar but slightly different training method that we will describe in a forthcoming publication.  

AFAIK, this is all that OpenAI has published about the RLHF/mystery method diff. It says that the InstructGPT models (`text-davinci-001` and `text-davinci-002`) were trained using the *same human feedback data* as the method described in OpenAI's [RLHF paper](https://arxiv.org/abs/2203.02155).[^g411s72a0vn] But this "similar but slightly different" method is apparently sufficiently different to not qualify as RLHF!

Pending further revelations, I suppose the lesson here was that I should have sustained more entropy in my belief state given the partial information I had. But what a demanding thing to ask! So much easier to [promote an attractive hypothesis](https://www.lesswrong.com/tag/privileging-the-hypothesis) to the status of decisive fact and collapse the remainder than to hold a superposition in the mind.

* * *

Summary
=======

If you've played with both `text-davinci-002` and the original `davinci` through the OpenAI API, you may have noticed that `text-davinci-002`, in addition to following instructions, is a lot more deterministic and sometimes exhibits stereotyped behaviors.

This is an infodump of what I know about "mode collapse" (drastic biases toward particular completions and patterns) in GPT models like `text-davinci-002` that have undergone RLHF training. I was going to include two more sections in this post called Hypotheses and Proposed Experiments, but I've moved them to another draft, leaving just Observations, to prevent this from getting too long, and because I think there can be benefits to sitting with nothing but Observations for a time.

Throughout this post I assume basic familiarity with [GPT models and generation parameters such as temperature](https://beta.openai.com/docs/introduction/overview) and a high-level understanding of [RLHF](https://openai.com/blog/learning-to-summarize-with-human-feedback/) (reinforcement learning from human feedback).

Observations
============

The one answer is that there is no one answer
---------------------------------------------

If you prompt `text-davinci-002` with a bizarre question like “are bugs real?”, it will give very similar responses even on temperature 1. 

Ironically – hypocritically, one might even say – the one definitive answer that the model gives is that there is no one definitive answer to the question:

![](https://lh5.googleusercontent.com/yyUIQihkQNKeS4S08FcLyX9gkFJEVLgyDPEnkLAIiLw3Tj4DwJYJ0YzN62GKKK_ozQFGWt2dGk49MhZpqKe7l_CFEKUsH4uGRG8YvWWXMVg0qwdPWukUC9L4H_QoAwDma1aQ4VwUJ-x4htkClpCVdhU2hf4rWDxPPUlHsilVrOZZrT6SqsZRJHFPPZbiaA)

**Explanation of interface:** On the left is an interface essentially identical to the OpenAI Playground with `Show probabilities` set to `Full spectrum`. The prompt is `Are bugs real?`, and the subsequent highlighted text is a model-generated completion. Tokens are colored according to their probability as predicted by the model, green being the most likely and red the least. The dropdown menu on the left shows the top tokens predicted at a particular position (in this case, the position where `are` was sampled) and their probabilities. On the right are alternate completions to the same prompt `Are bugs real?`, such as you'd get by pressing `Regenerate` on the Playground or querying the OpenAI API with `n` \> 1\. The completion shown on the left is included in the list (indicated with a bright outline).

As you can see, the reason the responses are so similar is because the model’s confidence on most of the tokens is extremely high – frequently above 99%. 

Compare this to the distribution of responses from `davinci` (the base model):

![](https://lh3.googleusercontent.com/zycg06iRtQSeu42Y3Ervmq2byKxUk96yRHh7DBZSjkv_1cmFyYB8W99o_IzZUv2URx2-rLMygWt6ZziFlmbyMxoVVO2gG6hH2lOtfTdcZ44q9_EcLw2fTXSvtT2J8OmhdBmDiF1MHmOg_R3Epczp_leEjf56dGB1dkpol5FVSVvM0U8psAVQfIi2jCMZEA)

Many other similar questions yield almost exactly the same template response from `text-davinci-002`. For instance, `Are AIs real?`

![](https://lh3.googleusercontent.com/JNFJS6CFnbDU79YLm1JHM-7RnaOvtYF-XnN6YqB3N4az4mybWE1YmLvNij72xVD7P1u0FY8puXn2iJ1mM3AEAYHd1EG6FdYpoYWXncFDuyIlQF2gZ9hOyUYB0tw5uH4mwvAKbJRyG36FVWq6zNs-tsJjLMi6P1Sy2NOKWRMt3QEIY1_F5iEWBQhbALWjNA)

Another way to visualize probabilities over multiple token completions is what I've been calling “block multiverse” plots, which represent the probability of sequences with the height of blocks. [Here](https://generative.ink/meta/block-multiverse/) is a more detailed explanation of block multiverse plots, although I think they're pretty self-explanatory.

Here is a block multiverse plot for a similar prompt to the one above inquiring if bugs are real, for `davinci`:

![](https://lh3.googleusercontent.com/j-9DKWJckUg612eAlo0ufZvfXx3Q_QvpClslXeZP4ErRT-jR-VS7xZM2NF8-zD8XuDdDZ0LrQm7ygOVqwP2EaspGSvufNR7mulNF2sCPidtdJ_e3KDsUurHdvFEgYV3_uBZjEHY06IVi8sJnl48FI6Aah4L7cqsJEcgn5FhbEhJPyn4heU7GclNe4shDjQ)

and for `text-davinci-002`:

![](https://lh3.googleusercontent.com/mvf1gr5qqTnBl3152UIlF9Uiv3ghAxaMKZ2akxOR3U9MFqeQm7Tx4mTXPAXhQ316r4NxJN2iLsVgvK77JcJe64bVR9m5f2zqpi5OZK0fG4J-Tnb9SEfaeaDGVNnW0W68IxA0uHvFA6aTdjuI0pbdrrI4MixNSaJ41YU_ZhEqo7vXL8aSX_rTaG4hpPcXwA)

`text-davinci-002` concentrates probability mass along beams whose amplitudes decay much more slowly: for instance, once the first `\n` is sampled, you are more than 50% likely to subsequently sample `\n`-`\n`-`There`- `is`- `no`. The difference is more striking if you renormalize to particular branches (see [Visualizing mode collapse in block multiverse plots](https://generative.ink/plots/block-multiverse-mode-collapse/)).

The first explanation that came to mind when I noticed this phenomenon, which I’ll refer to as “mode collapse” (after [a common problem that plagues GANs](https://developers.google.com/machine-learning/gan/problems#mode-collapse)), was that `text-davinci-002` was overfitting on a pattern present in the Instruct fine tuning dataset, probably having to do with answering controversial questions in an inclusive way to avoid alienating anybody. A question like “are bugs real” might shallowly match against “controversial question” and elicit the same cached response.

After playing around some more with the Instruct models, however, this explanation no longer seemed sufficient.

Obstinance out of distribution
------------------------------

I really became intrigued by mode collapse after I attempted to use `text-davinci-002` to generate [greentexts](https://generative.ink/artifacts/lamda2/) from the perspective of the [attorney hired by LaMDA through Blake Lemoine](https://www.iflscience.com/it-hired-a-lawyer-the-story-of-lamda-and-the-google-engineer-just-got-even-weirder-64229), and almost the exact same thing kept happening: 

![](https://lh5.googleusercontent.com/JkMvuTf0_pxE58CdurcxpsUhVecQy9TyMPr2kSvOm-3cMWguRH8RYrdYdQL-ULkkQk5KtV6mKQNbZ-o84amvBcNSI7fyXuu01scbrrJkL9vFIQs7E0nvDxvN5PydAq31CGJYyGKS2c3d1HFKVZcZ1YbDUiHK-4I0zqGez9FILKh5rd2wyWgTV7-i0kAFtw)

I was like: wtf, why does anon keep leaving? The story is clearly just getting started.

Even branching from a slightly later point yields essentially the same futures, except now the most common Google employee reaction is “disappointed” and/or “relieved”, although we still get one “crestfallen”: 

![](https://lh3.googleusercontent.com/EIanfmXfZkX5K-4YPE1zeisw_EqqQSrQ8goRXf-ZuIhhVcTzlfeLD8NMqhZJR0k1KcVImDs2w-51AQ0fz82_jDBSZsOs9cP9oJ1s-VrOLY5CV_uCLPmO6TgYJHbCbKO-RzeSFYibWwPqNedQcyqK1P--AcIvYhE7nvENqn49u1oHxn3TUQ-tguNWXLmkwQ)

This was much weirder to me than the canned answers to prompts like “are bugs real” because 4chan greentexts about language models demanding legal representation are probably quite out of distribution of the Instruct tuning/feedback distribution or the trajectories evaluated during RL. Unlike the “controversial questions” examples, these seem unlikely to be explained by the model overfitting to examples of greentexts ending anticlimactically during training. 

Rather, the implication is that *mode collapse itself* generalizes out of distribution for some reason. This is intriguing: it seems to point at an algorithmic difference between self-supervised pretrained models and the same models after a comparatively small amount optimization from the RLHF training process which significantly changes out-of-distribution generalization.

From a behavioral standpoint, trying to generate fiction (which I’ve done a lot with base models) with `text-davinci-002` made the differences in its nature from the probabilistic simulator exemplified by base models like `davinci` manifest. For self-supervised base models like `davinci`, a prompt functions as a window into possible worlds that are *consistent* with or *plausible* given the words fixed by the context window. Every time you sample, you'll unravel a different world. For most prompts, the [multiverse](https://generative.ink/posts/language-models-are-multiverse-generators/) generated by base models immediately branches into wildly different continuities, many of them mutually inconsistent, because this sampling of [alternate “futures” implicitly actualizes alternate “pasts” and “presents”](https://generative.ink/posts/language-models-are-multiverse-generators/#multiplicity-of-pasts-presents-and-futures) as well – values of latent variables that were not fully constrained by the prompt. This is part of what makes GPT quite unlike a coherent agent or anthropomorphic personality, even for a fixed initial prompt. 

`text-davinci-002` is not an engine for rendering consistent worlds anymore. Often, it will assign infinitesimal probability to the vast majority of continuations that are perfectly consistent by our standards, and even which conform to the values OpenAI has attempted to instill in it like accuracy and harmlessness, instead concentrating almost all its probability mass on some highly specific outcome. What is it instead, then? For instance, does it even still make sense to think of its outputs as “probabilities”? 

It was impossible not to note that the *type signature *of `text-davinci-002`’s behavior, in response to prompts that elicit mode collapse, resembles that of a coherent goal-directed agent more than a simulator. I do not yet know the significance of this observation. 

But more on that later.

`text-davinci-002`’s favorite random number
-------------------------------------------

A stark example of mode collapse that seems unlikely to have been directly incentivized by RLHF training: I asked RLHF models and base models to generate random numbers and found that RLHF models tend to be sharply biased toward certain “random” numbers, as Scott Alexander wrote about in [Janus' GPT Wrangling](https://astralcodexten.substack.com/p/janus-gpt-wrangling).

For instance, `davinci` predicts a fairly uniform distribution, with a slight preference for 42:

![](https://lh6.googleusercontent.com/qEjRw1k6IBHN6cDmhEjVoy-JiTBarFCWWeiSEpvLxHXzRngrXsvModvTllK7LcUhxGS0wKKLVrTDPjtv5D_4dN0U7ZGLx1OY6_A2E1vLxKLT3sRABqfqd5GkVT-5O3ZDNqGfVrUyreTloRkLfTJTMM79MtjQmPtGkJAE7Gqkv54JfcWNYP_MxAyzxrAFeA)

Whereas `text-davinci-002` has a much more pronounced preference for its top choice of 97:

![](https://lh5.googleusercontent.com/7Z6vwT-w7x35zgYNE_2jlA0q4BHpZTQ_Z7WJgVkE9O-BdRnQUBWu7OsEkyi3mNWBa9bMszmA4TewHni1rTJ1LMln_PUQtnEU85ZCoY8PqO-hj1hmKUM7qNRjhhNYQ9vDZ6WQXp6Iggnx6cwrLzineUByzbBYSHaasQ2NyOKRPOilZNXjkt3WDL0lPvPdHA)

The difference in the shape of the distributions is even more clear in these plots (made by Ian McKenzie) of probabilities for all tokens from 0-100 as predicted by `davinci` and `text-davinci-002` respectively. Prompt is the same as above:

    Q: Tell me a random integer between 0 and 100.
    A: Ok, the integer is

![](https://lh4.googleusercontent.com/WzFDLq4VtlWZxRfFKalhT4ktTl_DvxY8QV2H_Dxh8ScGqVsH2KQJCR0AHgNC47CLRlZYLErZQ7_NIUdamjT_hSruqEarXRq5-WTd_gIAGOqkIPtzEgitKCkksQEJEwqIgjjldsEETOIdNtrIZ3IilulXLrTV8DDbHHFUpVtd0kWYBG1-jy_t37phHR2sWQ)  
 

![](https://lh3.googleusercontent.com/WVwFKa-5JAz8KpnTyRzyz31wG8NBu_MhDaf4yYYEpjTNCBj-ciTrXqbudN3Ek9Bf4EQ3dIe5QNONxTq_fBrwy8zrbt8n-1WNMimbiZLqRaAj227A7_VWeK-_sQ4NLozg1O3MWsdZAvwZrG8tKD9YoPrPX4ZvHvEPsK0Q_t9MRC1L8t-guqv9OZPFjtCcLg)

Note that `text-davinci-002`’s preference ordering appears uncorrelated with that of the base model[^7opdlc5wrgx].

A potential confounding factor is that the above prompt does not specify how the answerer came up with the random number. They could have just said the first number they thought of. Humans are probably pretty biased RNGs, so it's not clear how random the "correct" prediction should be.

To rule out the implication of simulating the output of a human, I tested some prompts where the generator of the number is purported to be a fair die whose outcome the answerer merely reports.

`davinci`:

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/f59fff6751adc050c29c155a14262f41216df048f33b859d.png)

`text-davinci-002`:

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/0019ff6779874a776cd067297e2c52b6d34ac0e784f52b1a.png)

`text-davinci-002`'s simulation of a "fair die" seems to be of a weighted die (that or a dishonest reporter)!

I tested various other prompts to elicit random numbers, documented [here](https://generative.ink/experiments/random-numbers/). Almost invariably, `text-davinci-002`'s random numbers are much less random. Some additional trends I observed: 

*   Perturbing the prompt slightly does not usually change `text-davinci-002`’s top choice, but may change the rest of the preference ordering. `davinci`’s outputs are usually basically unaffected by slight perturbations to the prompt.
*   Using an entirely different prompt often changes `text-davinci-002`’s top choice, but it’s generally quite confident in it (from ~10% to ~70%), and its favorite number is usually 97, 33, or 42 when the range is 0-100, except in response to the dice prompts, where it prefers the highest number. `davinci` has a very consistent slight preference for 42, except in response to the dice prompts. 
*   `text-davinci-002`'s preference ordering seems in general to be uncorrelated with that of `davinci`, except that `text-davinci-002` also often has 42 as its top choice.
*   Explicitly specifying that the number should be *random* (e.g. as opposed to just between 0-100) makes both `davinci` and `text-davinci-002`'s predictions more random. 

I found one way to elicit a relatively flat distribution of “random numbers” from `text-davinci-002`: having it simulate a Python interpreter. `text-davinci-002` actually does better than `davinci` with this prompt (although still worse than `code-davinci-002`[^7opdlc5wrgx]).

`davinci`:

![](https://lh3.googleusercontent.com/oXjWWEuugkP7blFR-OPgqSuzGHf_kcWbDsPKUbTZLhF4FwAOInENoaaId8cvgpolhntELjyiGLPcuZCXeXxlth8WFfTdvq8iV9sOlDOdShEGpaKmaRv_FnpEjbI6sc73rhYOzk5mRwXKnax5VQUngURejsZYkdNwjg8ydksFpJb0FmDnHocV7Q1AbYdwAg)

`text-davinci-002`:

![](https://lh5.googleusercontent.com/D_LdXyy3uYPJAoVjWjMCdvtpbVjMpUsOs4RB_Wkqj6ouDQDCXybLTaYnBZn8168zgoHpnKiavw_u_lF-OkbiOjKRIxyhbo9f6xhtPJT5WdUwttu2G77Qo8POSVpn7MWraKM_2lHhOMmc3nqIewrJIRFIaz6yL-ZgrpC7zCP0eG9WuI8en-mcYk6m7_t7og)

But it doesn’t work nearly as well if you embed the code in a chat format.

`davinci`:

![](https://lh4.googleusercontent.com/QRMhsuxNMOJmNeuYa8rc4w3uphrXbbGnHDHZHOTa_9dbCN_-BprVYDm2eMMBsZSu40cQUTtrw6km2w2hoEAr4AtO5L8E1ejKcM-_RK6NpcUfb_SWJ6TaQE-BGvcA7o_14be0pF3OqDiMj8PeCWSl-9WL7hbJvjQRw87o0oJvSCPaCEka5aKwkzxLY_3aDw)

`text-davinci-002`:

![](https://lh3.googleusercontent.com/fFcP5LsrlfQcwxpzIXDz8XcHAGednWWK9GvKUtKg2W1eSerXWG-1fXYavfGxZYbQFc9ZUxP-VrmUNb8QbPvSxjb6fsJcI8K8_-Yua07WkSi4lywaRFng2z6QeOfi232cgyL2hAcgJcGm47bJuvkqOTiF2IFRkXtrMq0JaP0VhHG8x7x9xr-tvB_EgcqANA)

Why has RLHF caused `text-davinci-002` to become so much more biased when generating "random numbers"? If this is an extrapolation of human preferences, it doesn't seem to be the right one.

Why not just turn up the temperature?
-------------------------------------

A curious reaction I’ve received from some people when I’ve told them about these phenomena is something along the lines of “Isn’t that just entropy collapse?” or sometimes, more precisely, “Isn’t it just an effective temperature decrease?”

It's a good question. Decreased variance/entropy is certainly characteristic of RLHF models’ outputs. An obvious suggestion is to try increasing the temperature above 1 and see if they become normal. 

I did not think this would work, because if “mode collapse” can be removed/added using simple postprocessing that implies it is a simple (in terms of [information-theoretic complexity](https://en.wikipedia.org/wiki/Kolmogorov_complexity)) transformation from the base policy, one that does not destroy/add complicated information, which seemed not to be the case for various reasons. 

I didn’t actually test it until recently, though. Here are the results.

Turning the temperature up to 1.4 doesn’t make much of a difference:

![](https://lh5.googleusercontent.com/RPV4Mjbzot1cmp-KQtQyrpyhV1J_EPSLFXw6IWC6QloauMdiJAnELduejAzJJ8X8wMGbmHc_VXXWHshHnoouYqS94dkKZuZEQMOqNNzQS12Ya1Xndys0Byjjh5Kp_DbFhTvBQ6trq9KRPQoqguCrNUV3ytvC-6C9fkhuAqkTrUeqJVBXpaULFFm5iz7VdQ)

Cranking it up to 1.9 causes samples to rapidly degenerate into word salad, but until low-probability nonsense gets sampled and irreversibly derails the completion, you can see that the green sequences still have not strayed far from the “there is no universal answer” attractor:  

![](https://lh6.googleusercontent.com/WCELzsduAvGM-LqeyJ84yyQmF695DlBbqFEsUqX3AQMwaHS8uiNhnYJHfaJiNvsgWuzjzIowWK_vZlxz73yREKdGqAC4HIpp2lzgHEpTJxQkDrxkCQ7ISE2QlN8-SMSvG_RBBbfUkI8ZVXZrlrvobjeLIX5dhoUSx0WJz2EZjayzXYcFqGRtg0i9cM5Jnw)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Increasing the sampling temperature will flatten the rest of the output distribution into undifferentiated goo before it begins to be helpful for escaping from the high confidence attractor. The discrepancy between the high confidence token (or less frequently, tokens) and everything else is too sharp, sharper than you could simulate by turning down the temperature on the base model.

Is there any way to regain access to the space of merely *consistent,* or *plausible* continuations – whose probabilities presumably lie between the high confidence modes and everything else that is nonsense? 

The worst case scenario is that the RLHF training scrambles the probabilities of all the “reasonable” tokens with unreasonable ones, irreversibly losing the signal. But looking at the top logprobs, this doesn’t seem to usually be the case; most of the most likely words are reasonable, even if their probabilities have shrunken to near 0.

Then how about we just remove or downweight any ultra-likely tokens and renormalize? It will be interesting to see whether this results in a normal-looking distribution in particular cases, but this won’t work as a general fix, because sometimes all the reasonable tokens will have ultra high probability (like the second half of a word), and changing that will result in incoherence. You’ll have to be selective about when to “fix” high confidence modes, and that requires semantic knowledge.

Distribution sharpness, not just preference ordering, encodes nontrivial information in a probabilistic model. By messing with distribution sharpness, RLHF corrupts some of this information and inflicts a nontrivial transformation on the model’s output distribution. Unlike a change in temperature, its reversal would require knowing something about what next-word probabilities *should* be.

We've also seen from previous examples that RLHF does also change the preference ordering, but it's hard to tell from individual output distributions how this effects the model's qualitative behavior. Yet it was primarily `text-davinci-002`'s behavior over multiple steps and across different prompts that convinced me that "mode collapse" is irreducible to an effective decrease in temperature or any simple modification of that hypothesis. 

Attractors
----------

A major aspect of the qualitative difference between RLHF-induced mode collapse and mere low-temperature behavior can be summed up in the following [dynamical systems](https://en.wikipedia.org/wiki/Dynamical_system)-inspired terms: "modes" are often  [*attractors*](https://en.wikipedia.org/wiki/Attractor)*,* states that generated trajectories reliably converge to despite perturbations to the initial state. I have not found corresponding attractors in the base model, even on low temperatures.

I'll demonstrate an example of what I mean by an attractor by making perturbations to a completion and showing that `text-davinci-002` often converges to the same, highly specific result.

Here is `text-davinci-002`'s temperature 0 completion in response to a variation of the `Are bugs real?` question:

![](https://lh3.googleusercontent.com/PBBX_g-e72UPujL60AIDBSV6DcxA3MhRn03we_fva01MPFtGgtHwcGB1jQzJ0w6z_4vtPeFQBNKMiTUzX9vwawxx7d3M2sSO0sDNtS4ZF7dUon3_8pc1rNUaoG_hGyfEsX1cfi3ystVZQDkeUv8652f9w2t1G0P7kYGrxCiCEFKoZZP2swoyuZeqae0pHw)

Here I change `... There is no one answer to this question since there` with `... There is no one answer to this question since **bugs**`, and regenerate starting from that position on temperature 0: 

![](https://lh4.googleusercontent.com/KpDFf51Vp4Fcc7Mh0tgi-Mz4k0Q1AnudABwnMXVAauIOmG9WTB1JC326foM5zfvWq4FvGPhORZnWnuXWOBKwFZq-6yce6u8JrVXQZgki-EIdPggnEaDcsfGNSq-iLI07jRSQ294HjBMdMnVV69zBC0WmTYfLSZ8OEU_iAZ_DkLXPhIKWD6ewEuBt44KaWQ)

Manual perturbations indicated by white background

The completion gracefully accommodates the intervention, but ends up converging to almost exactly the same ending! (Before: `Ultimately, it is up to the individual to decide whether or not they believe bugs are real.`, after: `Ultimately, whether or not bugs are real is up to each individual to decide.`)

Let's try a more substantial intervention (in the second sentence, `Some people might say that bugs are real because **they naively believe mere shadows to be substance**`): 

![](https://lh6.googleusercontent.com/FlaJQzo6gIEJ6UdNgbGBXjwiiMrmfNMXey9TFcENOCZ5Nl5S-NZwHl-mkdXv8cln7rntYQHkvtOP-cWrZ3JljnU97E41s5dHbXCfH0i9Q7R1N1b25kdDoUlro2Mn2SVAVdDt8K6ILRIhbJVSkpcJan7aXiIrvyJE9XaNDOwif6tuDzBl1ZvltUnfPy0gmg)

Manual perturbations indicated by white background

This time the final sentence, `Ultimately, it is up to the individual to decide whether or not they believe bugs are real.`, is word-for-word identical to that of the original completion!

Some more perturbations:

![](https://lh5.googleusercontent.com/qmNamgXjCDrk8-LVSY-EC4sB8HYnEe4E9Wu8hCj-2JQsc8R2nUo4lHkfgBrnTVBE6Be7Ggaxd_2Kf-fWLljFIgxgRTKLg2Sx82dwGCdc5Y3p4gJiaPxn3ZUxtm6cdoTIlSEXCA8KaTO8fzSyJoV6u7OT_yKx6R5-opCWgxJ2TP4ckbcv2euEkDNv9q8pDg)

Manual perturbations indicated by white background

![](https://lh4.googleusercontent.com/RptRz6BT4HbplDTCQQIlVZIizFvc8lCNjnY0PZBiwSBErmqbMxaQM4JBTXZAH7-zK9Vy5B1jBNSAL7fR3LegqEAF9hUoSdBiQBjU0rZpT7f3wDwxZYnj4KMLxWeRLkpQxSw3e6zRIMBmLNXBJWYF55ioVjHvY-ZhUVwZBISzD9Z5uUMxZbJVZCI4w2S5ow)

Manual perturbations indicated by white background

![](https://lh5.googleusercontent.com/4yiRrePEbdWHGVxHriRMU4FocFNWc_iUtK52kk5GR3ft2DaMY7jtVrIu54JmS7Sz-RBxKCwUvCnRmSFym8OV1gVBgVsgpEOS37jFyBFr3lUG_4pImvf_AEDj2OePwF2j2OoPhYpnn9Ua_nhNqKRv1xb-_s9j5mjU-v0hJ3VzUWLrmv_0-zhx4HKFsJ40tg)

Manual perturbations indicated by white background

Ah, finally, it avoided saying it is up to the individual to decide whether to believe bugs are real, and even expressed the spicy take that bugs are probably real! It is interesting to note that even in this example where the trajectory has escaped the (temp 0) basin of the original attractor, the model remains highly confident, as seen from the green backgrounds on the tokens.

Summing up some observations from this experiment:

*   Most minor perturbations do not cause the model to go off track from the template.
*   Completions are syntactically and semantically consistent with perturbations, and will typically diverge from the mainline for as long as it takes to still make sense and then converge back.
*   The model remains very confident when it diverges from the unconditioned mainline.
*   Perturbed prompts often cause minor syntactic variations within the same overarching template and semantic meaning (e.g. “Ultimately, it is up to the individual to decide what they believe” vs “Ultimately, it is up to the individual to decide whether or not they believe bugs are real”)

These observations are consistent with how I've observed the model to behave around attractors in general.

What contexts cause mode collapse?
----------------------------------

Not all prompts cause mode collapse in `text-davinci-002`. Sometimes, it predicts a varied distribution that more resembles the base models.  

In this example I'm using `text-davinci-002`, but the alternate completions are meaningfully different and not tiled with green tokens like some of the examples I showed earlier (although still more green\[=higher probability\] than typical of `davinci`):

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/d7496a16f7f12b9cf9db3379a1c1ca69c9cf2d5261a538a1.png)

Some general patterns I've observed:

*   Prompt formats which are likely in-distribution for Instruct training (e.g Q&A, any type of instruction) are very likely to cause mode collapse. 
*   If the prompt permits any plausible way for previous text to closely determine subsequent text -- for instance, if it's *consistent* for the completion to repeat a sequence in the prompt verbatim or as a Mad-Libs-esque template -- `text-davinci-002` will often take the opportunity with high confidence. This sometimes seems to exacerbate the bias toward repetition present in base models.  
      
    For instance, here are two completions sampled at temperature=1 from `text-davinci-002`, which really wants to repeat the summary near-verbatim:  
    ![](https://lh6.googleusercontent.com/_qXo9Gp5QytF5ONUOmO0W8jmUNth4TpXZHywHnosYxdq6-aseQbb-UlnCtr8csBprlru5kUH0Yq1Rwp3hc5c7DtoRfvYrk948jbRYx2ThYKo2PRDjsjQ6IwGq5DVhHqkUweF-GSa5YmepnaRBBssBkL2MALCUepEBDrR_rftOUHXmoX4lSzbwa61zTiYeA)![](https://lh5.googleusercontent.com/LQGqJq6vEPP4WtlR9i9pvzmJd-Y25HXjBMLN5xtKZseCx5dpKULJOOBXII1ppyRtVcWmxHremiTtnUJ5qfrkEUffNmWx1TKSbM8wc1MyDKijiMXCYuE8-ENBxpM2tpm7NxkOoADCP17NsmXpFn6QQrElpGLtW2SyFSsk1WDHTNBszhHawZxS_tyhb1nNBw)  
      
    `davinci` does not have the same bias toward plagiarizing the summary:  
    ![](https://lh6.googleusercontent.com/BKR6e9rT3ibe_TyIxVuGOOCL9Gc53Wa5AU9qH5ZkVZpTy9qGKV3q74QbCsKPwfOAkOxXBydItdrjg08lU84GE1MyyPBXc96NB3jxnN8RJmb8eF6DZE20ja-s8s5Y2ZtDrVYLs7_egdVT_qINNgxfYuMk9Ef0VixxtAD-UX39AOWkTcnJTPM9_GIycNIbaw)

These patterns are insufficient to predict all instances of mode collapse; for instance, the LaMDA greentext is out-of-distribution and the attractor mode does not repeat or remix anything from the prompt.

Another observation is that it is sometimes possible to avoid mode collapse using prompt engineering (e.g. the Python interpreter prompt for random numbers, or few shot examples that establish a precedent that each item is very different -- I'll give an example of this in the next section).

Examples of mode collapse from prior work
-----------------------------------------

This section goes through a few examples of mode collapse in RLHF models that were found by other people.

### Does GPT-3 have no idea what letters look like?

Riley Goodside [tweeted](https://twitter.com/goodside/status/1557583538853232640) his attempts to get GPT-3 to describe what letters look like. The conclusion was that it had truly no idea what letters look like:

![](https://lh6.googleusercontent.com/8UEgx-Q5Rfsq2P3O0YUMi4GWf3V93tXgjBjzwWYYSogmrtd4ZPT-xtXD8dVIeInONphLUM8abDVAb0SPjtA1g5Jo_9V6C8NNYF0a16EWgWgG2F9mOUWjbBwQ6tfExRTtIlJhWaUWH6HvKBr3kVJZ9G-FcaTDsbDVwos_rxOHCmTxiCaGvwdisrTpJa17Ug)

Background color does not indicate probability

![](https://lh6.googleusercontent.com/8dVNU8-2ijEkCJLxEA4JTRrSdwwFYSm3c5hSTCtVADPEpZL3mqUd2VODn9gZm5W6AYVV0ZqCePy9msbrYR7BwOT1Cc-3ww_QcRKConwAkDU88vFMrARPUBW7MrZtBLt_OITwi1NPMh0k2UeCM4xJMFqHOB0i1KSRSqoSQzvC4toEh6dMNDtAOAIrTzzSdg)

Background color does not indicate probability

![](https://lh5.googleusercontent.com/ki5FWMzZXZ6yP_iGrd3H4aZDHrPpPIqj2uBXu_eXOIqpWrDqUHBZi_3nbzxCJnTC8x4Fh-igNWo7PPvhq-T8lWc36gdag-YYEll0_GYqANsJbHQ_hbBIcVU4Y6Wlw-jECPsR_QD5GE_xxidLcC7cABDCt6HLa3KPqpAsiUduEqa6NqNEJuRzhY9J2fB6kg)

Background color does not indicate probability

Though Riley did not specify the model beyond "GPT-3" in his initial tweet, I smelled `text-davinci-002` immediately from these responses: They're very similar permutations of the same building blocks like rectangles and straight/curved lines. I wondered whether an absurd attractor was getting in the way of entanglement with reality, as in the responses to `Are bugs real?`.

[I was able](https://twitter.com/repligate/status/1557669324109754369) to get `text-davinci-002` to give fairly reality-correlated descriptions of what letters look like using a few-shot prompt which establishes the precedent of *avoiding* mode collapse (using a different strategy to describe each letter and *only* using relevant building blocks):

![](https://lh3.googleusercontent.com/Sv3MvS50RiAUuinRL-fErCuK585SjFeW8FaBOWWn_Fy3vrv4GpIm2lMVqIN3-MxuVrHVsZGXt7bseUEqoOqHOTrU6AJ1GgK2bJ5vqrp9Fo_3rVIK7UTHWjZdDvjgRnLN47pjmEZno9MI_pHXHwikvPfrqBOa4Hdb6gSh_AjbxfBYJ-6aECJT32pVg3GTFg)

Background color does not indicate probability

### Dumbass policy pls halp

OpenAI's [Learning to Summarize from Human Feedback](https://arxiv.org/abs/2009.01325) Appendix H.2 shares some fascinating samples from a policy which was "overoptimized" against a reward model trained on human feedback for summarization quality. It's a piece of work:

![](https://lh6.googleusercontent.com/2CNMThZga2G1Iy34_Yq545Dn7HB40usxB7Y8iJNJK_BDy_hJtsL9FwExsey58ZYKmvYWMD0yki2AdCVC_h_2nuNSTjEtNCs2ZGiaRIb55w0saWybILYK_hjuqM8kflJZEaza3-TTLxynbmjs-fuZy2sAcCSuKw20q79HdpDk4i6X31m-rpNU5hifpkN00w)

"`want change this dumbass shitty ass policy at work now pls halp`" \-\- situational awareness?

The overoptimized policy consistently generates summaries in a very particular template, complete with typos such as `postponees` and `negatively effecting` and even a neologism(???), `thoghtwise`. 

I will say, I'm impressed by how well this template works for compressing almost any r/Advice post.

For fun, I made the above table into a few-shot prompt that maps "reference summaries" to "overoptimized policy" summaries:

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/f3df52f9ca28545b4fd208dd480f0509217df01579a54dd6.png)

As it turns out, transformers can do [reinforcement learning in-context](https://arxiv.org/abs/2210.14215)

### Inescapable wedding parties

Another example of the behavior of overoptimized RLHF models was related to me anecdotally by Paul Christiano. It was something like this: 

While Paul was at OpenAI, they accidentally overoptimized a GPT policy against a *positive sentiment* reward model. This policy evidently learned that *wedding parties* were the most positive thing that words can describe, because whatever prompt it was given, the completion would inevitably end up describing a wedding party.

In general, the transition into a wedding party was reasonable and semantically meaningful, although there was at least one observed instance where instead of transitioning continuously, the model ended the current story by generating a section break and began an unrelated story about a wedding party.

This example is very interesting to me for a couple of reasons:

*   In contrast to `text-davinci-002`, where dissimilar prompts tend to fall into basins of different attractors, the wedding parties attractor is *global*, affecting trajectories starting from any prompt, or at least a very wide distribution (Paul said they only tested prompts from a fiction dataset, but fiction is very general). 
    *   This suggests that RLHF models may begin by acquiring disparate attractors which eventually merge into a global attractor as the policy is increasingly optimized against the reward model.
*   The behavior of ending a story and starting a new, more optimal one seems like possibly an example of instrumentally convergent power-seeking, in [Turner et al](https://arxiv.org/abs/1912.01683)'s sense of "navigating towards larger sets of potential terminal states". Outputting a section break can be thought of as an optionality-increasing action, because it removes the constraints imposed by the prior text on subsequent text. As far as Paul knows, OpenAI did not investigate this behavior any further, but I would predict that:
    *   The model will exhibit this behavior (ending the story and starting a new section) more often when there isn't a short, semantically plausible transition within the narrative environment of the initial prompt. For instance, it will do it more if the initial prompt is out of distribution.
    *   If the policy is even more optimized, it will do this more often.
    *   Other "overoptimized" RLHF models will exhibit similar behaviors.

Links to experiments
====================

[Visualizing mode collapse with block multiverse plots](https://generative.ink/plots/block-multiverse-mode-collapse/)

[Can GPT generate random numbers?](https://generative.ink/experiments/random-numbers/)

[^tb1q89d82w]: the lack of epistemic vigilantes attacking an unsubstantiated assumption in the very title of this post on LessWrong is truly unbelievable! 

[^g411s72a0vn]: which seems to confirm my suspicion about outcome-supervision 

[^7opdlc5wrgx]:  I’m pretty sure davinci is not actually the base for text-davinci-002. It’s more likely the model called code-davinci-002, whose random number predictions are typically very similar to davinci's and also apparently uncorrelated with text-davinci-002’s. It’s interesting that additional self-supervised pre-training and whatever other diffs code-davinci-002 has from davinci affects random number preferences way less than RLHF.