Establishing whether language models can use contextual information in a human-plausible way is important to ensure their safe adoption in real-world settings. However, the questions of when and which parts of the context affect model generations are typically tackled separately, and current plausibility evaluations are practically limited to a handful of artificial benchmarks. To address this, we introduce Plausibility Evaluation of Context Reliance (PECoRe), an end-to-end interpretability framework designed to quantify context usage in language models' generations. Our approach leverages model internals to (i) contrastively identify context-sensitive target tokens in generated texts and (ii) link them to contextual cues justifying their prediction. We use PECoRe to quantify the plausibility of context-aware machine translation models, comparing model rationales with human annotations across several discourse-level phenomena. Finally, we apply our method to unannotated generations to identify context-mediated predictions and highlight instances of (im)plausible context usage in model translations.
翻译:确定语言模型能否以人类合理的方式利用上下文信息,对于确保其在真实场景中的安全应用至关重要。然而,上下文何时影响模型生成以及哪些部分产生影响的问题通常被分开处理,且当前的合理性评估实际上局限于少数人工构建的基准测试。为解决这一问题,我们提出了上下文依赖合理性评估框架(PECoRe),这是一种端到端的可解释性框架,旨在量化语言模型生成过程中的上下文使用情况。我们的方法利用模型内部机制:(i)通过对比分析识别生成文本中对上下文敏感的目标标记;(ii)将这些标记与证明其预测合理性的上下文线索关联起来。我们利用PECoRe量化上下文感知机器翻译模型的合理性,跨多种语篇层级现象比较模型推理依据与人工标注。最后,我们将该方法应用于未标注的生成文本,以识别受上下文介导的预测,并突出模型翻译中上下文使用(不)合理的实例。