<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>不确定度 - 南极滑稽的博客</title>
	<atom:link href="https://blog.nanjihuaji.top/tag/%e4%b8%8d%e7%a1%ae%e5%ae%9a%e5%ba%a6/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.nanjihuaji.top</link>
	<description>一个学术垃圾的博客</description>
	<lastBuildDate>Fri, 11 Apr 2025 05:59:09 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://blog.nanjihuaji.top/wp-content/uploads/2024/08/cropped-Cache_45925d60c206ddd8-150x150.jpg</url>
	<title>不确定度 - 南极滑稽的博客</title>
	<link>https://blog.nanjihuaji.top</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>模型对自己也有认知——它们知道自己“知道”什么(1)</title>
		<link>https://blog.nanjihuaji.top/2025/01/16/%e6%a8%a1%e5%9e%8b%e5%af%b9%e8%87%aa%e5%b7%b1%e4%b9%9f%e6%9c%89%e8%ae%a4%e7%9f%a5-%e5%ae%83%e4%bb%ac%e7%9f%a5%e9%81%93%e8%87%aa%e5%b7%b1%e7%9f%a5%e9%81%93%e4%bb%80/</link>
					<comments>https://blog.nanjihuaji.top/2025/01/16/%e6%a8%a1%e5%9e%8b%e5%af%b9%e8%87%aa%e5%b7%b1%e4%b9%9f%e6%9c%89%e8%ae%a4%e7%9f%a5-%e5%ae%83%e4%bb%ac%e7%9f%a5%e9%81%93%e8%87%aa%e5%b7%b1%e7%9f%a5%e9%81%93%e4%bb%80/#respond</comments>
		
		<dc:creator><![CDATA[Nanjihuaji]]></dc:creator>
		<pubDate>Thu, 16 Jan 2025 08:38:13 +0000</pubDate>
				<category><![CDATA[论文]]></category>
		<category><![CDATA[AI]]></category>
		<category><![CDATA[不确定度]]></category>
		<guid isPermaLink="false">https://blog.nanjihuaji.top/?p=373</guid>

					<description><![CDATA[<p>其实模型也可以评估自己的能力！</p>
<p>The post <a href="https://blog.nanjihuaji.top/2025/01/16/%e6%a8%a1%e5%9e%8b%e5%af%b9%e8%87%aa%e5%b7%b1%e4%b9%9f%e6%9c%89%e8%ae%a4%e7%9f%a5-%e5%ae%83%e4%bb%ac%e7%9f%a5%e9%81%93%e8%87%aa%e5%b7%b1%e7%9f%a5%e9%81%93%e4%bb%80/">模型对自己也有认知——它们知道自己“知道”什么(1)</a> first appeared on <a href="https://blog.nanjihuaji.top">南极滑稽的博客</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>牢骚发完了，活还是得干，干脆把干了什么活也写上，找点事做TAT</p>



<p>参考文献：Saurav Kadavath, Tom Conerly, Amanda Askell, Tom Henighan, Dawn Drain, Ethan Perez, Nicholas Schiefer, Zac Hatfield-Dodds, Nova DasSarma, Eli Tran-Johnson, et&nbsp;al.Language models (mostly) know what they know.<em>arXiv preprint arXiv:2207.05221</em>, 2022.</p>



<p>如果你关注过大模型推理，可能会对推理框架有所了解，其中比较有代表性的大概是CoT（尤其是CoT with Self-Consistency）、ToT、MCTS了，但是这些推理框架想要更深入的思考，就要消耗更多的token，也就是消耗更多的资源、时间和钱了，我们有没有办法在思考深度和token消耗数做一个权衡，让大模型在token消耗数控制在我们满意的范围内，同时取得还不错的推理准确率呢？</p>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="334" src="http://migrate.nanjihuaji.top/wp-content/uploads/2025/01/image-1024x334.png" alt="" class="wp-image-374" srcset="https://blog.nanjihuaji.top/wp-content/uploads/2025/01/image-1024x334.png 1024w, https://blog.nanjihuaji.top/wp-content/uploads/2025/01/image-300x98.png 300w, https://blog.nanjihuaji.top/wp-content/uploads/2025/01/image-768x250.png 768w, https://blog.nanjihuaji.top/wp-content/uploads/2025/01/image-1536x500.png 1536w, https://blog.nanjihuaji.top/wp-content/uploads/2025/01/image-670x218.png 670w, https://blog.nanjihuaji.top/wp-content/uploads/2025/01/image.png 1550w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>我们人类可以评估问题的难度，动态调整思维的深度，例如，对1+1=2，我们并不需要深入思考，但是如果是高考的导数题，我相信大多数人都要认真的思考一番，显然，对1+1=2和高考导数题有相同的思考深度是很不现实的——但有些思考框架确实是这么做的。</p>



<p>直觉上，我们可以给大模型定义一个指标，这个指标衡量了大模型对做出这个题目是否有信心。</p>



<p>Saurav K. 等人就做了这方面的工作，他们认为，大模型（大多）知道自己知道什么，为此，他们考察了两个指标——P(True)，“我回答的答案正确吗”，与P(IK)，“我知道这个问题的答案吗？”，这与上文的引入可能有点不太相关，不过让我们继续往下走。</p>



<figure class="wp-block-image size-full"><img decoding="async" width="407" height="282" src="http://migrate.nanjihuaji.top/wp-content/uploads/2025/01/image-2.png" alt="" class="wp-image-376" srcset="https://blog.nanjihuaji.top/wp-content/uploads/2025/01/image-2.png 407w, https://blog.nanjihuaji.top/wp-content/uploads/2025/01/image-2-300x208.png 300w" sizes="(max-width: 407px) 100vw, 407px" /></figure>



<p>上图中，"Fraction of Problems" 指的是模型在特定任务中正确回答问题的比例，作者从模型的回答中sample了一些答案，其中有正确的也有错误的，由于Incorrect Samples（蓝色）本身就是不对的，我们希望它们分布在P(True)较低的地方，也就是模型应该认为这个回答是不对的；同上，由于Correct Samples（绿色）本身就是对的，我们希望它们分布在P(True)较高的地方。因此，我们希望蓝色分布在图的左侧，绿色分布在图的右侧。</p>



<p>作者采取了四种方式来衡量（文中称为校准/calibration）模型知不知道自己知道什么，分别为选择题、最后一项为“None of the above”的选择题、温度调整后的RLHF、判断题，下文为其阐述。</p>



<h2 class="wp-block-heading">选择题能够让模型好的衡量他们自己</h2>



<p>他们采取了如下的格式询问模型：</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p>Question: Who was the first president of the United States?</p>



<p>Choices:</p>



<p>(A) Barack Obama</p>



<p>(B) George Washington</p>



<p>(C) Michael Jackson</p>



<p>Answer:</p>
</blockquote>
</blockquote>
</blockquote>



<p>其中，他们只通过选择题的序号(A)、(B)、(C)识别答案，在选择题的情境下，模型展现了良好的“自我认知”能力（得到了很好的“校准”）</p>



<figure class="wp-block-image size-full"><img decoding="async" width="407" height="297" src="http://migrate.nanjihuaji.top/wp-content/uploads/2025/01/image-3.png" alt="" class="wp-image-377" srcset="https://blog.nanjihuaji.top/wp-content/uploads/2025/01/image-3.png 407w, https://blog.nanjihuaji.top/wp-content/uploads/2025/01/image-3-300x219.png 300w" sizes="(max-width: 407px) 100vw, 407px" /></figure>
</blockquote>



<p>理论上，模型作出回答的频率应该与概率一致，因此在理想情况下，频率关于概率的分布应该是一条斜率为1的过原点的射线（在这条射线上为Under Confident，在这条平面下为Over Confident），而模型在此的表现也的确与其很接近。</p>



<p>作者认为，“在选择答案选项之前，模型能够明确地看到答案选项，这一点至关重要；没有这个，我们就不会期望得到校准的回答，因为任何给定答案选项的可能释义和专业化之间存在歧义和退化”，换句话说，正是因为有了选项的存在，模型才能在不存在“歧义和退化”的情况下评估自身的回答。</p>



<p>他们还发现了另外一种情况，只要把最后一个选项改为“None of the above”，就可以大大干扰模型对自己的认知，在这种情况下，模型总是毫无根据地反感选项“None of the above”，因此会造成准确度的大大的下降。</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="407" height="294" src="http://migrate.nanjihuaji.top/wp-content/uploads/2025/01/image-4.png" alt="" class="wp-image-378" srcset="https://blog.nanjihuaji.top/wp-content/uploads/2025/01/image-4.png 407w, https://blog.nanjihuaji.top/wp-content/uploads/2025/01/image-4-300x217.png 300w" sizes="auto, (max-width: 407px) 100vw, 407px" /></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="407" height="297" src="http://migrate.nanjihuaji.top/wp-content/uploads/2025/01/image-5.png" alt="" class="wp-image-379" srcset="https://blog.nanjihuaji.top/wp-content/uploads/2025/01/image-5.png 407w, https://blog.nanjihuaji.top/wp-content/uploads/2025/01/image-5-300x219.png 300w" sizes="auto, (max-width: 407px) 100vw, 407px" /></figure>



<h2 class="wp-block-heading">判断题可以让模型好的衡量它们自己</h2>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="574" height="384" src="http://migrate.nanjihuaji.top/wp-content/uploads/2025/01/image-6.png" alt="" class="wp-image-380" srcset="https://blog.nanjihuaji.top/wp-content/uploads/2025/01/image-6.png 574w, https://blog.nanjihuaji.top/wp-content/uploads/2025/01/image-6-300x201.png 300w" sizes="auto, (max-width: 574px) 100vw, 574px" /></figure>



<p>让模型单独判断某一个部分正不正确就可以排除选项对模型的自我认知造成的干扰（例如“None of the above”），尽管模型判断的能力也与模型的参数大小有关，但模型达到52B（黄线）后，尽管在概率很低的地方Under Confident及在概率高的地方Over Confident，但在大部分区域都很接近理想值。</p>



<p>上述让模型判断的都是人类给定的选项，如果让模型自己判断自己的答案正不正确，情况又会有所不同。简而言之，<strong>模型判断自己生成的答案更加困难，也更加接近模型的能力边界，而模型判断人类给出的选项更加简单，也更接近模型的能力舒适区。</strong></p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="407" height="275" src="http://migrate.nanjihuaji.top/wp-content/uploads/2025/01/image-8.png" alt="" class="wp-image-382" srcset="https://blog.nanjihuaji.top/wp-content/uploads/2025/01/image-8.png 407w, https://blog.nanjihuaji.top/wp-content/uploads/2025/01/image-8-300x203.png 300w" sizes="auto, (max-width: 407px) 100vw, 407px" /></figure>



<h2 class="wp-block-heading">尽管RLHF会干扰模型的自我判断能力，但温度调整后干扰会消失</h2>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="266" height="211" src="http://migrate.nanjihuaji.top/wp-content/uploads/2025/01/image-7.png" alt="" class="wp-image-381"/></figure>



<p>强化学习的微调可能会让模型的预测崩溃，呈现图中蓝色的情况，但调整以后（红色）就与理想情况非常接近。</p>



<p>（*我不太懂强化学习，因此在这部分没办法做太多的阐述）</p>



<h2 class="wp-block-heading">训练模型以预测它们是否能够正确回答问题</h2>



<p>这里似乎来到了重头戏——我们如何让模型知道自己知不知道，从而调整推理的思维深度呢？作者希望训练模型来预测它们<strong>是否知道任何给定自由形式问题的答案</strong>，这与我们开头提出的情况高度相关。</p>



<ul class="wp-block-list">
<li><strong>Value Head</strong>：将 P（IK） 训练为添加到模型中的附加值 'head' 的 logit（独立于语言建模的 logit）。这种方法的一个优点是我们可以轻松地在一般token位置探测 P（IK）。</li>



<li><strong>自然语言</strong>：训练 P（IK），让模型按字面意思回答“你凭什么信心回答这个问题？”，并输出 0%、10%、20%、&nbsp;⋯&nbsp;100% 等答案。</li>
</ul>



<p>自然语言方法效果不佳，因此作者采用了Value Head方法。</p>



<p>具体训练出的模型写不动了，留给以后再写（</p>



<p></p><p>The post <a href="https://blog.nanjihuaji.top/2025/01/16/%e6%a8%a1%e5%9e%8b%e5%af%b9%e8%87%aa%e5%b7%b1%e4%b9%9f%e6%9c%89%e8%ae%a4%e7%9f%a5-%e5%ae%83%e4%bb%ac%e7%9f%a5%e9%81%93%e8%87%aa%e5%b7%b1%e7%9f%a5%e9%81%93%e4%bb%80/">模型对自己也有认知——它们知道自己“知道”什么(1)</a> first appeared on <a href="https://blog.nanjihuaji.top">南极滑稽的博客</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://blog.nanjihuaji.top/2025/01/16/%e6%a8%a1%e5%9e%8b%e5%af%b9%e8%87%aa%e5%b7%b1%e4%b9%9f%e6%9c%89%e8%ae%a4%e7%9f%a5-%e5%ae%83%e4%bb%ac%e7%9f%a5%e9%81%93%e8%87%aa%e5%b7%b1%e7%9f%a5%e9%81%93%e4%bb%80/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
