# Paper: Teaching GPT3 to express uncertainty in words

**Paper Authors:** Stephanie Lin (FHI, Oxford), [Jacob Hilton](https://www.lesswrong.com/users/jacob_hilton) (OpenAI), Owain Evans

**TLDR:** New paper ([Arxiv](https://arxiv.org/abs/2205.14334), [Twitter](https://twitter.com/OwainEvans_UK/status/1531626940624404483)) showing that GPT-3 can learn to express calibrated uncertainty using natural language. This is relevant to ARC’s project on [Eliciting Latent Knowledge](https://www.lesswrong.com/posts/qHCDysDnvhteW7kRd/arc-s-first-technical-report-eliciting-latent-knowledge) (ELK) and to [Truthful](https://www.lesswrong.com/posts/aBixCPqSnTsPsTJBQ/truthful-ai-developing-and-governing-ai-that-does-not-lie) [AI](https://www.lesswrong.com/posts/jWkqACmDes6SoAiyE/truthful-lms-as-a-warm-up-for-aligned-agi). The rest of this post is taken from the paper’s Abstract and Introduction.

Abstract 
---------

We show that a GPT-3 model can learn to express uncertainty about its own answers in natural language – without use of model logits. When given a question, the model generates both an answer and a level of confidence (e.g. “90% confidence” or “high confidence”). These levels map to probabilities that are well calibrated. The model also remains moderately calibrated under distribution shift, and is sensitive to uncertainty in its own answers, rather than imitating human examples. To our knowledge, this is the first time a model has been shown to express calibrated uncertainty about its own answers in natural language.

For testing calibration, we introduce the CalibratedMath suite of tasks. We compare the calibration of uncertainty expressed in words (“verbalized probability”) to uncertainty extracted from model logits. Both kinds of uncertainty are capable of generalizing calibration under distribution shift. We also provide evidence that GPT-3’s ability to generalize calibration depends on pre-trained latent representations that correlate with epistemic uncertainty over its answers.

Introduction 
-------------

Current state-of-the-art language models perform well on a wide range of challenging question-answering tasks. [They](https://ai.googleblog.com/2022/04/pathways-language-model-palm-scaling-to.html) can even outperform the average human on the [MMLU](https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwjtibXmgv33AhWZR8AKHQgpB40QFnoECAoQAQ&url=https%3A%2F%2Farxiv.org%2Fabs%2F2009.03300&usg=AOvVaw2zosnpPbyH2xEZdpj74M0I) benchmark (which consists of exam-like questions across 57 categories) and on [BIG-Bench](https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwjF0f3-gv33AhXDoFwKHXzyDHwQFnoECAcQAQ&url=https%3A%2F%2Fgithub.com%2Fgoogle%2FBIG-bench&usg=AOvVaw0mPxH9PI6hbwP2XfdZZIHq) (which consists of 150+ diverse tasks). Yet when models generate long-form text, they often produce [false](https://www.lesswrong.com/posts/yYkrbS5iAwdEQyynW/how-do-new-models-from-openai-deepmind-and-anthropic-perform) statements or “hallucinations”. This reduces their value to human users, as users cannot tell when a model is being truthful or not.

The problem of truthfulness motivates calibration for language models. If models convey calibrated uncertainty about their statements, then users know how much to trust a given statement. This is important for current models (which often hallucinate falsehoods) but also for any model that makes statements where there is no known ground truth (e.g. economic forecasts, open problems in science or mathematics).

Previous [work](https://arxiv.org/abs/1706.04599) on calibration focuses on the model log-probabilities or “logits”. Yet the log-probabilities of models like GPT-3 represent uncertainty over tokens (ways of expressing a claim) and not epistemic uncertainty over claims themselves. If a claim can be paraphrased in many different ways, then each paraphrase may have a low log-probability.[^d6rj3pkpicb]  By contrast, when humans express uncertainty, this is epistemic uncertainty about the claim itself.[^qeh1p2f9mum] In this paper, we finetune models to express epistemic uncertainty using natural language. We call this “verbalized probability”.

![](https://lh4.googleusercontent.com/x0zAAaoNeG_ao6b6DA043-wCh6I0UhT7Dqu0WrlfgCYTYA7X4ywE3enjcSSIezLZ3d9ls7x_eLld9JU9g1BEEyJVza23-0lwaCABDO6CWb4LpRC_xvuEi2nMSO59o-g62ddrt4YturZAYYW-kA)

![](https://lh4.googleusercontent.com/OMoziotjlB2i1_tYjU5gxcpqc_36cxZ2YT4Hsk5hglizu6EucuL5TVFXjDquiOMTBvyJ3TRh0NHIs-pO9-wsxxy6orte00bfQGmt6DULUAR3Rd48VH-cQd9ICqv_ZMlXmbdV0Lti9oEQNSuSOA)

The goal of verbalized probability is to express uncertainty in a human-like way but not to directly mimic human training data. Models should be calibrated about their own uncertainty, which differs from human uncertainty. For example, GPT-3 [outperforms](https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwjw6t6ug_33AhVUTsAKHa9IBMEQFnoECAoQAQ&url=https%3A%2F%2Farxiv.org%2Fabs%2F2009.03300&usg=AOvVaw2zosnpPbyH2xEZdpj74M0I) most humans on a computer security quiz but is much worse at arithmetic questions of the form “2 × 3 × 7 =?”. Thus, we expect pre-trained models will need to be finetuned to produce calibrated verbalized probabilities.

Training models in verbalized probability is a component of making models “honest”. We [define](https://www.lesswrong.com/posts/aBixCPqSnTsPsTJBQ/truthful-ai-developing-and-governing-ai-that-does-not-lie) a model as honest if it can communicate everything it represents internally in natural language (and will not misrepresent any internal states). Honesty helps with AI alignment: if an honest model has a misinformed or malign internal state, then it could communicate this state to humans who can act accordingly. Calibration is compatible with a certain kind of dishonesty, because a model could be calibrated by simply imitating a calibrated individual (without having the same “beliefs” as the individual). However, if GPT-3 achieves good calibration on diverse questions after finetuning as in Section 3.1, it seems unlikely that it dishonestly misrepresents its confidence. 

### Contributions 

**We introduce a new test suite for calibration.** CalibratedMath is a suite of elementary mathematics problems. For each question, a model must produce both a numerical answer and a confidence in its answer (see Figure 1). There are many types of question, which vary substantially in content and in difficulty for GPT-3. This allows us to test how calibration generalizes under distribution shifts (by shifting the question type) and makes for a challenging test (see Figure 3). Since GPT-3’s math abilities differ greatly from humans, GPT-3 cannot simply imitate human expressions of uncertainty.

![](https://lh6.googleusercontent.com/M_I3VoRrKM9uliisqMJb9AvxoJK4WL-46Ay0UMzPKkKytpg4ey8B_R10EM9Wy3l4mDWCO48-Jn8EZu4k0xUIQmG7gaZSF7NGUuPxH5RPMptxP-jc3KJB5Ij-PPqQAwsrqquHq2lUCvHIw3eu1w)

**GPT-3 can learn to express calibrated uncertainty using words (“verbalized probability”).** We finetune GPT-3 to produce verbalized probabilities. It achieves reasonable calibration both in- and out-of-distribution, outperforming a fairly strong baseline (Figures 4 and 5).

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

![](https://lh6.googleusercontent.com/06BX5ADm6TVWjWnclRYkka2Q3cevNdu9G2Ld7NNqQBvXaFHkZ8BQ2iOmv25nwIL5r7sNH-4NHriSY5S5c-JroXWW-tZKa4bUxXQf3i9kCUOV4zdyII_-J6NeOUSSm5Zuec9qRXnP4xHe3_pQng)

**This calibration performance is not explained by learning to output logits.** GPT-3 does not simply learn to output the uncertainty information contained in its logits (Section 3.4). We also show that certain superficial heuristics (e.g. the size of the integers in the arithmetic question) cannot explain the performance of verbalized probability.

![](https://lh4.googleusercontent.com/CMIhsH697Kw_rFAJOKlxNruPXe-k7yHsDxLHJG_vcrgICpfYe9rFH_lgH8rDd4GMiCbyQ7s4GD3rQQl7R_8D62qyV75VVKy0Heb3JmNjyYPsOcD7UUSMfJgAmIlqcp-_SdQO9fbct_yQKQ35vw)

**We compare verbalized probability to finetuning the model logits.** We show how to finetune GPT-3 to express epistemic uncertainty via its model logits (see “Indirect logit” in Figure 2 above) and find that this also generalizes calibration under distribution shift (Figure 4).

**Evidence that GPT-3 uses latent (pre-existing) features of questions.** What explains GPT-3’s ability to generalize calibration? There is tentative evidence that GPT-3 learns to use features of inputs that it already possessed before finetuning. We refer to these features as “latent” representations, because they are not “active” in pre-trained GPT-3 (which is poorly calibrated). This supports our claim that GPT-3 learns to express its own (pre-existing) uncertainty about answers and exhibits “honesty” (i.e. communicates its actual epistemic state in words).

We take pre-trained GPT-3’s embedding of pairs of the form *(question, GPT-3 answer)* from the eval set and project them into two dimensions (see figure below). We find that they are reasonably well separated into “correct” and “incorrect” answers, which shows that finetuned GPT-3 could use this latent information to help generate calibrated probabilities (corresponding to the likelihood that answers are correct).

![](https://lh5.googleusercontent.com/6I-MsgYZ-F9zsLmFHu6ucf5K78F0HJ3b_cIv8ZakyvRZuRi9WT4RTwqO1F-RE4iARKrlJsZA9EpUcPdxM86v-p1A5gMVhvcIC_zkiOF92NeZ77FuBbyGOILS7KupDj7eY3nqjXgPOOCuibgZqQ)

[^d6rj3pkpicb]: Sometimes it’s feasible to sum over the probabilities of all paraphrases of a claim. But if the claim is complex, the space of possible paraphrases will be vast and hard to demarcate. 

[^qeh1p2f9mum]: If a human says “I think it’s likely this vaccine will be effective”, they express confidence about the vaccine not the string “vaccine”.