1"use strict";(globalThis.webpackChunkmy_website=globalThis.webpackChunkmy_website||[]).push([[1994],{18138(e,n,t){t.r(n),t.d(n,{assets:()=>h,contentTitle:()=>c,default:()=>u,frontMatter:()=>l,metadata:()=>a,toc:()=>p});var a=t(97739),s=t(74848),r=t(28453),i=t(49107),o=t(15768);const l={title:"SelfCheckGPT: Zero-Resource Black-Box Hallucination Detection for Generative Large Language Models",slug:"paper9",authors:["zain"],date:new Date("2023-12-08T00:00:00.000Z"),tags:[],image:"./img/hero.jpeg",description:"Get an LLM to check its own responses for hallucination."},c=void 0,h={image:t(22997).A,authorsImageUrls:[void 0]},p=[...o.RM];function d(e){const n={a:"a",code:"code",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"Get an LLM to check its own responses for hallucination.",src:t(46692).A+"",width:"1185",height:"1200"})}),"\n","\n",(0,s.jsx)(n.p,{children:"\u2753Can you really get a LLM to self-check its own responses for hallucinations?"}),"\n",(0,s.jsxs)(n.p,{children:["\ud83d\udcdcResearchers from Cambridge released a ",(0,s.jsx)(n.a,{href:"https://arxiv.org/abs/2303.08896",children:"paper"})," developing a method called SelfCheckGPT - a framework that uses only black-box access to a LLM through an API to assess if it's hallucinating."]}),"\n",(0,s.jsx)(n.p,{children:"\u23e9TLDR: They pass in the same prompt to the model multiple times and generate N more sample responses in addition to the original response and get the LLM to check for inconsistencies."}),"\n",(0,s.jsx)(n.p,{children:"\ud83d\udcd1They compare how often each sentence in the original response contradicts these samples using the following prompt for every sentence:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"Context: {} \nSentence: {} \nIs the sentence supported by the context above? \nAnswer Yes or No: \n"})}),"\n",(0,s.jsx)(n.p,{children:"The intuition is that if an LLM has knowledge of a given concept, sampled responses are likely to be similar and contain consistent facts. Hallucinated statements, on the other hand, are more likely to diverge from the extra sampled responses and will contradict one another."}),"\n",(0,s.jsx)(n.p,{children:"They report higher AUC-PR scores in sentence-level hallucination detection and higher correlation scores in passage-level factuality assessment compared to grey-box methods - which use model weights and output token probs."}),"\n",(0,s.jsx)(n.p,{children:"\u274cSome potential problems with this approach:"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"What if the model hallucinates in a confident way where even the sampled responses contain the hallucinations?"}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Very high-cost method(requires (N + number of sentences) queries per prompt) - if you are generating N samples every time and then verifying for every sentence in a query you will rack up a bill really quickly"}),"\n"]}),"\n"]}),"\n",(0,s.jsx)("p",{children:(0,s.jsx)(i.fd,{link:"https://arxiv.org/abs/2303.08896",children:"\ud83d\udd17 arXiv Link"})}),"\n",(0,s.jsx)("p",{children:(0,s.jsx)(i.fd,{link:"https://arxiv.org/pdf/2303.08896",children:"\ud83d\udcdc Download paper"})}),"\n","\n",(0,s.jsx)(o.Ay,{})]})}function u(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},49107(e,n,t){t.d(n,{Ef:()=>g,fd:()=>u,z9:()=>d});var a=t(28774);t(96540);const s="buttons_NqrD",r="left_ej0y",i="right_kFGn",o="btn_VbJ1",l="btnMain_ywTD",c="btnAccent_uqV6",h="btnOutlined_BYrT";var p=t(74848);function d({children:e,link:n,color:t="main",newTab:s=!0,className:r,style:i}){let d=o;switch(t){case"accent":d+=" "+c;break;case"outlined":d+=" "+h;break;default:d+=" "+l}return r&&(d+=" "+r),(0,p.jsx)(a.A,{className:d,style:i,to:n,target:s?"_blank":"_self",children:e})}function u({children:e,link:n,color:t="main",newTab:a=!0}){let s=o;if("accent"===t)s+=" "+c;else s+=" "+l;return(0,p.jsx)("a",{className:s,href:n,download:!0,children:e})}function g({children:e,position:n="center"}){let t=s;switch(n){case"left":t+=" "+r;break;case"right":t+=" "+i}return(0,p.jsx)("div",{className:t,children:e})}},22997(e,n,t){t.d(n,{A:()=>a});const a=t.p+"assets/images/hero-5c15ec382ad942b8296b110eb44338b5.jpeg"},46692(e,n,t){t.d(n,{A:()=>a});const a=t.p+"assets/images/hero-5c15ec382ad942b8296b110eb44338b5.jpeg"},97739(e){e.exports=JSON.parse('{"permalink":"/papers/paper9","source":"@site/papers/2023-12-08-paper9/index.mdx","title":"SelfCheckGPT: Zero-Resource Black-Box Hallucination Detection for Generative Large Language Models","description":"Get an LLM to check its own responses for hallucination.","date":"2023-12-08T00:00:00.000Z","tags":[],"readingTime":1.56,"hasTruncateMarker":true,"authors":[{"name":"Zain Hasan","title":"Developer Advocate","url":"https://github.com/zainhas","imageURL":"/img/people/icon/zain.jpg","key":"zain","page":null}],"frontMatter":{"title":"SelfCheckGPT: Zero-Resource Black-Box Hallucination Detection for Generative Large Language Models","slug":"paper9","authors":["zain"],"date":"2023-12-08T00:00:00.000Z","tags":[],"image":"./img/hero.jpeg","description":"Get an LLM to check its own responses for hallucination."},"unlisted":false,"prevItem":{"title":"Dense X Retrieval: What Retrieval Granularity Should We Use?","permalink":"/papers/paper10"},"nextItem":{"title":"Who\u2019s Harry Potter? Approximate Unlearning in LLMs","permalink":"/papers/paper7"}}')}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.