We explore Bayesian reasoning as a means to quantify uncertainty in neural networks for question answering. Starting with a multilayer perceptron on the Iris dataset, we show how posterior inference conveys confidence in predictions. We then extend this to language models, applying Bayesian inference first to a frozen head and finally to LoRA-adapted transformers, evaluated on the CommonsenseQA benchmark. Rather than aiming for state-of-the-art accuracy, we compare Laplace approximations against maximum a posteriori (MAP) estimates to highlight uncertainty calibration and selective prediction. This allows models to abstain when confidence is low. An ``I don't know'' response not only improves interpretability but also illustrates how Bayesian methods can contribute to more responsible and ethical deployment of neural question-answering systems.
翻译:本文探讨将贝叶斯推理作为量化神经网络在问答任务中不确定性的方法。我们首先在鸢尾花数据集上构建多层感知器,展示后验推断如何传递预测置信度。随后将该方法拓展至语言模型,依次对冻结输出层和经LoRA适配的Transformer模型实施贝叶斯推断,并在CommonsenseQA基准上进行评估。区别于追求最优准确率,本研究通过对比拉普拉斯近似与最大后验概率估计,重点揭示不确定性校准与选择性预测机制。该方法使模型能够在置信度较低时主动弃答,这种"未知响应"机制不仅提升了系统可解释性,更彰显了贝叶斯方法对促进神经问答系统负责任部署与伦理化发展的贡献。