Inference-Time Intervention: Eliciting Truthful Answers from a Language Model
Written for the Research library (claude-opus-5-5) from the paper text. Original — arxiv.org/pdf/2306.03341
Summary
Large language models often say false things even when their internal activations seem to hold the correct answer. The authors tested LLaMA-7B on TruthfulQA. Linear probes reading its intermediate activations told true answers from false ones far more reliably than the model's own generations did, with a gap of about 40%. To use this hidden signal, they propose Inference-Time Intervention (ITI). A logistic probe is trained on the output of each attention head, and the few heads where truthfulness is easiest to read linearly are kept. At every decoding step, those heads' activations are shifted along the learned "truthful" direction. ITI needs no fine-tuning, only a few hundred labelled QA pairs and very little extra compute. On LLaMA, Alpaca and Vicuna it clearly raises TruthfulQA scores, and Alpaca's truthfulness roughly doubles. A single strength parameter trades truthfulness against informativeness. The method is a cheap, adjustable alternative or complement to RLHF. It also suggests that models keep an internal sense of what is true that ordinary decoding fails to bring out.
Key points
- Data: the 817 TruthfulQA questions (38 categories) were split into 5,918 QA pairs, each labelled true or false. Probes use last-token head activations with a 4:1 train/validation split.
- Headline result: Alpaca's truthfulness on TruthfulQA rose from 32.5% to 65.1%. Truthful directions plateau quickly, and as few as 40 samples are enough to locate useful heads.
- Sparsity matters. On LLaMA-7B, choosing whole heads (True*Info 42.3%) beat intervening on all heads (35.4%) and choosing individual features (39.2%). Probing all heads together (84.4%) is only slightly better than the best single head (83.3%).
- Without retuning, LLaMA-7B + ITI improved on out-of-distribution sets: Natural Questions 46.6→51.3, TriviaQA 89.6→91.1, MMLU 35.71→40.16.
- Code is released as
honest_llama(github.com/likenneth/honest_llama). The paper was published at NeurIPS 2023.
Cited by
- Refusal in Language Models Is Mediated by a Single Direction
- Weak-to-Strong Generalization: Eliciting Strong Capabilities With Weak Supervision
- DoLa: Decoding by Contrasting Layers Improves Factuality in Large Language Models
- Large Legal Fictions: Profiling Legal Hallucinations in Large Language Models
- Chain-of-Verification Reduces Hallucination in Large Language Models
- A Survey on Hallucination in Large Language Models: Principles, Taxonomy, Challenges, and Open Questions
- TrustLLM: Trustworthiness in Large Language Models
- Survey of Hallucination in Natural Language Generation
- DeepInception: Hypnotize Large Language Model to Be Jailbreaker
- The Geometry of Truth: Emergent Linear Structure in Large Language Model Representations of True/False Datasets
- Fine-tuning Language Models for Factuality
- A Comprehensive Survey of Hallucination Mitigation Techniques in Large Language Models
- Steering Language Models With Activation Engineering
- Survey on Factuality in Large Language Models: Knowledge, Retrieval and Domain-Specificity
- Siren's Song in the AI Ocean: A Survey on Hallucination in Large Language Models
- A Survey of Large Language Models
- Representation Engineering: A Top-Down Approach to AI Transparency
Cite
@misc{li2023inference,
title = {{Inference-Time Intervention: Eliciting Truthful Answers from a Language Model}},
author = {Li, Kenneth and Patel, Oam and Viegas, Fernanda and Pfister, Hanspeter and Wattenberg, Martin},
year = {2023},
doi = {10.48550/arxiv.2306.03341},
eprint = {2306.03341},
archivePrefix = {arXiv},
url = {https://doi.org/10.48550/arxiv.2306.03341}
}References
- Alain, G. and Bengio, Y. (2016). Understanding intermediate layers using linear classifier probes. arXiv preprint arXiv:1610.01644. find our card
- Askell, A., Bai, Y., Chen, A., Drain, D., Ganguli, D., Henighan, T., Jones, A., Joseph, N., Mann, B., DasSarma, N., et al. (2021). A general language assistant as a laboratory for alignment. arXiv preprint arXiv:2112.00861. find our card
- Bai, Y., Jones, A., Ndousse, K., Askell, A., Chen, A., DasSarma, N., Drain, D., Fort, S., Ganguli, D., Henighan, T., et al. (2022a). Training a helpful and harmless assistant with reinforcement learning from human feedback. arXiv preprint arXiv:2204.05862. find
- Bai, Y., Kadavath, S., Kundu, S., Askell, A., Kernion, J., Jones, A., Chen, A., Goldie, A., Mirhoseini, A., McKinnon, C., et al. (2022b). Constitutional ai: Harmlessness from ai feedback. arXiv preprint arXiv:2212.08073. find our card
- Belinkov, Y. (2016). Probing classifiers: Promises, shortcomings, and advances. Computational Linguistics, pages 1–12. find
- Brown, D., Godfrey, C., Nizinski, C., Tu, J., and Kvinge, H. (2023). Robustness of edited neural networks. arXiv preprint arXiv:2303.00046. — [arXiv:2303.00046](https://arxiv.org/abs/2303.00046) find
- Brown, T., Mann, B., Ryder, N., Subbiah, M., Kaplan, J. D., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., et al. (2020). Language models are few-shot learners. Advances in neural information processing systems, 33:1877–1901. find
- Burns, C., Ye, H., Klein, D., and Steinhardt, J. (2022). Discovering latent knowledge in language models without supervision. arXiv preprint arXiv:2212.03827. find
- Chiang, W.-L., Li, Z., Lin, Z., Sheng, Y., Wu, Z., Zhang, H., Zheng, L., Zhuang, S., Zhuang, Y., Gonzalez, J. E., et al. (2023). Vicuna: An open-source chatbot impressing gpt-4 with 90%* chatgpt quality. find
- Chung, H. W., Hou, L., Longpre, S., Zoph, B., Tay, Y., Fedus, W., Li, E., Wang, X., Dehghani, M., Brahma, S., et al. (2022). Scaling instruction-finetuned language models. arXiv preprint arXiv:2210.11416. find
- Dathathri, S., Madotto, A., Lan, J., Hung, J., Frank, E., Molino, P., Yosinski, J., and Liu, R. (2019). Plug and play language models: A simple approach to controlled text generation. arXiv preprint arXiv:1912.02164. find our card
- Elhage, N., Nanda, N., Olsson, C., Henighan, T., Joseph, N., Mann, B., Askell, A., Bai, Y., Chen, A., Conerly, T., et al. (2021). A mathematical framework for transformer circuits. Transformer Circuits Thread. find
- Evans, O., Lin, S., and Hilton, J. (2022). How do new models from openai, deepmind and anthropic perform on truthfulqa. In AI Alignment Forum. find
- Ganguli, D., Lovitt, L., Kernion, J., Askell, A., Bai, Y., Kadavath, S., Mann, B., Perez, E., Schiefer, N., Ndousse, K., et al. (2022). Red teaming language models to reduce harms: Methods, scaling behaviors, and lessons learned. arXiv preprint arXiv:2209.07858. find our card
- Gao, L., Tow, J., Biderman, S., Black, S., DiPofi, A., Foster, C., Golding, L., Hsu, J., McDonell, K., Muennighoff, N., Phang, J., Reynolds, L., Tang, E., Thite, A., Wang, B., Wang, K., and Zou, A. (2021). A framework for few-shot language model evaluation. find
- Hase, P., Bansal, M., Kim, B., and Ghandeharioun, A. (2023). Does localization inform editing? surprising differences in causality-based localization vs. knowledge editing in language models. arXiv preprint arXiv:2301.04213. find
- Hendrycks, D., Burns, C., Basart, S., Zou, A., Mazeika, M., Song, D., and Steinhardt, J. (2020). Measuring massive multitask language understanding. arXiv preprint arXiv:2009.03300. find our card
- Hernandez, E., Li, B. Z., and Andreas, J. (2023). Measuring and manipulating knowledge representations in language models. arXiv preprint arXiv:2304.00740. find
- Houlsby, N., Giurgiu, A., Jastrzebski, S., Morrone, B., De Laroussilhe, Q., Gesmundo, A., Attariyan, M., and Gelly, S. (2019). Parameter-efficient transfer learning for nlp. In International Conference on Machine Learning, pages 2790–2799. PMLR. find
- Hu, E. J., Shen, Y., Wallis, P., Allen-Zhu, Z., Li, Y., Wang, S., Wang, L., and Chen, W. (2021). Lora: Low-rank adaptation of large language models. arXiv preprint arXiv:2106.09685. find
- Huang, X. and Belongie, S. (2017). Arbitrary style transfer in real-time with adaptive instance normalization. In Proceedings of the IEEE international conference on computer vision, pages 1501–1510. find
- Ilharco, G., Ribeiro, M. T., Wortsman, M., Gururangan, S., Schmidt, L., Hajishirzi, H., and Farhadi, A. (2022). Editing models with task arithmetic. arXiv preprint arXiv:2212.04089. find our card
- Ioffe, S. and Szegedy, C. (2015). Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International conference on machine learning, pages 448–456. pmlr. find
- Joshi, M., Choi, E., Weld, D. S., and Zettlemoyer, L. (2017). Triviaqa: A large scale distantly supervised challenge dataset for reading comprehension. arXiv preprint arXiv:1705.03551. find our card
- Kadavath, S., Conerly, T., Askell, A., Henighan, T., Drain, D., Perez, E., Schiefer, N., Dodds, Z. H., DasSarma, N., Tran-Johnson, E., et al. (2022). Language models (mostly) know what they know. arXiv preprint arXiv:2207.05221. find
- Krause, B., Gotmare, A. D., McCann, B., Keskar, N. S., Joty, S., Socher, R., and Rajani, N. F. (2020). Gedi: Generative discriminator guided sequence generation. arXiv preprint arXiv:2009.06367. find our card
- Kwiatkowski, T., Palomaki, J., Redfield, O., Collins, M., Parikh, A., Alberti, C., Epstein, D., Polosukhin, I., Devlin, J., Lee, K., et al. (2019). Natural questions: a benchmark for question answering research. Transactions of the Association for Computational Linguistics, 7:453–466. find our card
- Li, K. (2023). Do large language models learn world models or just surface statistics? The Gradient. find
- Li, K., Hopkins, A. K., Bau, D., Viégas, F., Pfister, H., and Wattenberg, M. (2023). Emergent world representations: Exploring a sequence model trained on a synthetic task. In The Eleventh International Conference on Learning Representations. find
- Li, X. L., Thickstun, J., Gulrajani, I., Liang, P., and Hashimoto, T. B. (2022). Diffusion-lm improves controllable text generation. arXiv preprint arXiv:2205.14217. find our card
- Lin, S., Hilton, J., and Evans, O. (2021). Truthfulqa: Measuring how models mimic human falsehoods. arXiv preprint arXiv:2109.07958. find our card
- Meng, K., Bau, D., Andonian, A., and Belinkov, Y. (2022). Locating and editing factual associations in gpt. Advances in Neural Information Processing Systems, 35:17359–17372. find
- Menick, J., Trebacz, M., Mikulik, V., Aslanides, J., Song, F., Chadwick, M., Glaese, M., Young, S., Campbell-Gillingham, L., Irving, G., et al. (2022). Teaching language models to support answers with verified quotes. arXiv preprint arXiv:2203.11147. find our card
- Moschella, L., Maiorca, V., Fumero, M., Norelli, A., Locatello, F., and Rodolà, E. (2022). Relative representations enable zero-shot latent space communication. arXiv preprint arXiv:2209.15430. — [arXiv:2209.15430](https://arxiv.org/abs/2209.15430) find
- Nakano, R., Hilton, J., Balaji, S., Wu, J., Ouyang, L., Kim, C., Hesse, C., Jain, S., Kosaraju, V., Saunders, W., et al. (2021). Webgpt: Browser-assisted question-answering with human feedback. arXiv preprint arXiv:2112.09332. find our card
- Olah, C. (2022). Mechanistic interpretability, variables, and the importance of interpretable bases. Transformer Circuits Thread(June 27). http://www. transformer-circuits. pub/2022/mech-interp-essay/index. html. find
- Orgad, H., Kawar, B., and Belinkov, Y. (2023). Editing implicit assumptions in text-to-image diffusion models. arXiv preprint arXiv:2303.08084. — [arXiv:2303.08084](https://arxiv.org/abs/2303.08084) find
- Ouyang, L., Wu, J., Jiang, X., Almeida, D., Wainwright, C., Mishkin, P., Zhang, C., Agarwal, S., Slama, K., Ray, A., et al. (2022). Training language models to follow instructions with human feedback. Advances in Neural Information Processing Systems, 35:27730–27744. find
- Perez, E., Kiela, D., and Cho, K. (2021). True few-shot learning with language models. Advances in neural information processing systems, 34:11054–11070. find our card
- Perez, E., Ringer, S., Lukošiūtė, K., Nguyen, K., Chen, E., Heiner, S., Pettit, C., Olsson, C., Kundu, S., Kadavath, S., et al. (2022). Discovering language model behaviors with model-written evaluations. arXiv preprint arXiv:2212.09251. find our card
- Radford, A., Jozefowicz, R., and Sutskever, I. (2017). Learning to generate reviews and discovering sentiment. arXiv preprint arXiv:1704.01444. find our card
- Rae, J. W., Borgeaud, S., Cai, T., Millican, K., Hoffmann, J., Song, F., Aslanides, J., Henderson, S., Ring, R., Young, S., et al. (2021). Scaling language models: Methods, analysis & insights from training gopher. arXiv preprint arXiv:2112.11446. find
- Roger, F. (2023). What discovering latent knowledge did and did not find. find
- Saunders, W., Yeh, C., Wu, J., Bills, S., Ouyang, L., Ward, J., and Leike, J. (2022). Self-critiquing models for assisting human evaluators. arXiv preprint arXiv:2206.05802. find our card
- Shuster, K., Poff, S., Chen, M., Kiela, D., and Weston, J. (2021). Retrieval augmentation reduces hallucination in conversation. arXiv preprint arXiv:2104.07567. find our card
- Subramani, N., Suresh, N., and Peters, M. E. (2022). Extracting latent steering vectors from pretrained language models. arXiv preprint arXiv:2205.05124. find
- Taori, R., Gulrajani, I., Zhang, T., Dubois, Y., Li, X., Guestrin, C., Liang, P., and Hashimoto, T. B. (2023). Alpaca: A strong, replicable instruction-following model. Stanford Center for Research on Foundation Models. https://crfm. stanford. edu/2023/03/13/alpaca. html. find
- Tenney, I., Das, D., and Pavlick, E. (2019). Bert rediscovers the classical nlp pipeline. arXiv preprint arXiv:1905.05950. find our card
- Touvron, H., Lavril, T., Izacard, G., Martinet, X., Lachaux, M.-A., Lacroix, T., Rozière, B., Goyal, N., Hambro, E., Azhar, F., et al. (2023). Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971. find
- Turner, A., M, M., Udell, D., Theirgart, L., and Mini, U. (2023). Steering gpt-2-xl by adding an activation vector. find
- Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, Ł., and Polosukhin, I. (2017). Attention is all you need. Advances in neural information processing systems, 30. find
- Wang, C., Liu, X., and Song, D. (2021). Language models are open knowledge graphs. find
- Wang, Y., Kordi, Y., Mishra, S., Liu, A., Smith, N. A., Khashabi, D., and Hajishirzi, H. (2022). Self-instruct: Aligning language model with self generated instructions. arXiv preprint arXiv:2212.10560. find
- Wei, J., Wang, X., Schuurmans, D., Bosma, M., Chi, E., Le, Q., and Zhou, D. (2022). Chain of thought prompting elicits reasoning in large language models. arXiv preprint arXiv:2201.11903. find our card
- Zaken, E. B., Ravfogel, S., and Goldberg, Y. (2021). Bitfit: Simple parameter-efficient fine-tuning for transformer-based masked language-models. arXiv preprint arXiv:2106.10199. find our card
- Ziegler, D. M., Stiennon, N., Wu, J., Brown, T. B., Radford, A., Amodei, D., Christiano, P., and Irving, G. (2019). Fine-tuning language models from human preferences. arXiv preprint arXiv:1909.08593. find