Skip to main content
QUICK REVIEW

[论文解读] ResMem: Learn what you can and memorize the rest

Zitong Yang, Michał Łukasik|arXiv (Cornell University)|Feb 3, 2023
Topic ModelingComputer Science被引用 3
一句话总结

ResMem 提出了一种两阶段学习框架,通过使用 k-最近邻(k-NN)回归器显式记忆基础神经网络的残差,从而提升模型泛化能力。通过将基础模型的预测结果与 k-NN 拟合的残差相结合,ResMem 在测试风险上优于仅使用基础模型,且在视觉和自然语言处理基准测试中均表现出一致的准确率提升,包括在 ImageNet 上提升 +1.0%,在 C4 语言建模任务上提升 +0.89%。

ABSTRACT

The impressive generalization performance of modern neural networks is attributed in part to their ability to implicitly memorize complex training patterns. Inspired by this, we explore a novel mechanism to improve model generalization via explicit memorization. Specifically, we propose the residual-memorization (ResMem) algorithm, a new method that augments an existing prediction model (e.g. a neural network) by fitting the model's residuals with a $k$-nearest neighbor based regressor. The final prediction is then the sum of the original model and the fitted residual regressor. By construction, ResMem can explicitly memorize the training labels. Empirically, we show that ResMem consistently improves the test set generalization of the original prediction model across various standard vision and natural language processing benchmarks. Theoretically, we formulate a stylized linear regression problem and rigorously show that ResMem results in a more favorable test risk over the base predictor.

研究动机与目标

  • 通过显式记忆训练残差,提升小样本或低容量神经网络的泛化能力。
  • 探究在复杂或大规模训练数据下,通过 k-NN 实现的显式记忆是否能超越大模型中的隐式记忆。
  • 从理论和实证两方面验证:将参数化模型与非参数化 k-NN 组件结合,可降低测试风险。
  • 理解 ResMem 的归纳偏置及其如何使模型学习到超出基础模型容量的细微细节。

提出的方法

  • 在训练数据上训练一个基础深度神经网络(f_DNN),以生成初始预测结果。
  • 在训练集上计算真实标签与 f_DNN 预测结果之间的残差。
  • 使用残差作为目标,在训练集上拟合 k-NN 回归器,基于最后一层特征的 L2 距离进行计算。
  • 通过 f_ResMem(x) = f_DNN(x) + r_kNN(x) 组合预测结果,其中 r_kNN 为 k-NN 对残差的预测结果。
  • 使用温度缩放和加权组合方法,调节 k-NN 组件的贡献程度。
  • 将该方法应用于图像分类(CIFAR-100、ImageNet)和自回归语言建模(C4),采用 T5 模型进行实验。
Figure 3: Examples from CIFAR100 and C4 test set with the property that (i) $y^{\textsf{ResMem}}$ is correct; (ii) $y^{\textsf{DeepNet}}$ is wrong but close in meaning. We use red to denote the ResMem prediction and blue to denote DeepNet prediction. The DeepNet predictions capture coarse structure
Figure 3: Examples from CIFAR100 and C4 test set with the property that (i) $y^{\textsf{ResMem}}$ is correct; (ii) $y^{\textsf{DeepNet}}$ is wrong but close in meaning. We use red to denote the ResMem prediction and blue to denote DeepNet prediction. The DeepNet predictions capture coarse structure

实验结果

研究问题

  • RQ1通过 k-NN 显式记忆残差,是否能实现超越基础神经网络泛化能力的性能提升?
  • RQ2在高容量或复杂数据场景下,ResMem 是否比标准神经网络更有效地降低测试风险?
  • RQ3两阶段学习过程——先进行粗粒度特征学习,再进行细粒度残差记忆——如何影响模型性能?
  • RQ4与基础线性模型相比,ResMem 在收敛速度和测试风险方面具有何种理论优势?
  • RQ5在性能和归纳偏置方面,ResMem 与直接的 k-NN 标签记忆或知识蒸馏方法相比如何?

主要发现

  • 在 ImageNet 上,ResMem 在最小的 MobileNet-V2(a=0.35)上将测试准确率提升了 1.0%,在最大的模型(a=1.3)上提升了 0.4%,表明在不同模型规模下均具有一致的性能增益。
  • 在 C4 语言建模基准测试中,ResMem 达到了 45.55% 的测试准确率,优于最佳的 kNN-LM 方法(44.88%),提升 0.67 个百分点。
  • 在 CIFAR-100 上使用 ResNet-8 时,ResMem 达到 59.66% 的准确率,超过基础网络(56.46%)和纯 k-NN 标签记忆(54.44%)。
  • 对线性回归问题的理论分析表明,随着样本量增加,ResMem 的测试风险趋近于零,而基础模型的风险收敛于一个非零常数。
  • 定性分析表明,基础模型学习到粗粒度结构,而 k-NN 组件则捕捉到基础模型无法捕捉的、实例相关的细微细节。
  • 在所有评估设置中,ResMem 均优于直接的 k-NN 标签记忆方法,表明基于残差的记忆化方式比原始标签记忆更有效。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。