Conformal Prediction in Classification
Conformal Coverage Guarantee
Given the calibration data set {
(Xi,Yi∗)}i=1n{\left \{\left ( X_i, {Y}_{i}^{*}\right ) \right \}}_{i=1}^{n}{
(Xi,Yi∗)}i=1n and pretrained model f^(⋅)\hat{f}\left ( \cdot\right )f^(⋅) (f^(Xi)∈[0,1](K)\hat{f}\left ( X_i\right ) \in {\left [ 0, 1\right ]}^{\left ( K\right )}f^(Xi)∈[0,1](K)).
The probability (or confidence) assigned to the true label is f^(Xi)Yi∗{\hat{f}\left ( X_i\right ) }_{
{Y}_{i}^{*}}f^(Xi)Yi∗.
Calculate and sort the conformal scores: si=s(Xi,Yi∗)=1−f^(Xi)Yi∗s_i= s\left ( X_i, {Y}_{i}^{*}\right ) =1-{\hat{f}\left ( X_i\right ) }_{ {Y}_{i}^{*}}si=s(Xi,Yi∗)=1−f^(Xi)Yi∗ ({ s1≤⋯≤sn}\left \{s_1 \leq \cdots \leq s_n \right \}{ s1≤⋯≤sn}).
Obtain the ⌈(n+1)(1−α)⌉n\frac{\left \lceil \left ( n+1\right )\left ( 1-\alpha \right )\right \rceil}{n}n⌈(n+1)(1−α)⌉ quantile of { si}i=1n{\left \{ s_i\right \}}_{i=1}^{n}{ si}i=1n: q^=inf{ q:∣{ i:si≤q}∣n≥⌈(n+1)(1−α)⌉n}=s⌈(n+1)(1−α)⌉\hat{q}=\inf \left \{ q:\frac{\left | \left \{ i:s_i \leq q\right \}\right |}{n} \geq \frac{\left \lceil \left ( n+1\right )\left ( 1-\alpha \right )\right \rceil}{n} \right \} = {s}_{\left \lceil \left ( n+1\right )\left ( 1-\alpha \right )\right \rceil}q^=inf{ q:n∣{ i:si≤q}∣≥n⌈(n+1)(1−α)⌉}=s⌈(n+1)(1−α)⌉.
Construct the prediction set of (Xtest,Ytest∗)\left ( {X}_{test}, {Y}_{test}^{*}\right )(Xtest,Ytest∗): C(Xtest)={ y:f^(Xtest)y≥1−q^}={ y:s(Xtest,y)≤q^}\mathcal{C}\left ( {X}_{test}\right )=\left \{ y: {\hat{f}\left ( {X}_{test}\right )}_{y} \geq 1-\hat{q} \right \}=\left \{ y: s\left ( {X}_{test}, y\right )\leq \hat{q}\right \}C(Xtest)={ y:f^(Xtest)y≥1−q^}={ y:s(Xtest,y)≤q^}.
The event { Ytest∗∈C(Xtest)}\left \{ {Y}_{test}^{*} \in \mathcal{C}\left ( {X}_{test}\right ) \right \}{ Ytest∗∈C(Xtest)} is equivalent to { s(Xtest,Ytest∗)≤q^}\left \{ s\left ( {X}_{test}, {Y}_{test}^{*}\right )\leq \hat{q}\right \}{ s(Xtest,Ytest∗)≤q^}.
By the exchangeability of (X1,Y1),⋯ ,(Xn,Yn),(Xtest,Ytest∗)\left ( X_1, Y_1\right ), \cdots ,\left ( X_n, Y_n\right ), \left ( {X}_{test}, {Y}_{test}^{*}\right )(X1,Y1),⋯,(Xn,Yn),(Xtest

博客围绕分类中的共形预测和大语言模型的共形事实保证展开。在分类共形预测方面,介绍了共形覆盖保证和自适应预测集分类的计算方法;对于大语言模型,阐述了如何构建具有共形事实保证的输出,通过定义共形分数和阈值来确保一定的正确性概率。
1216

被折叠的 条评论
为什么被折叠?



