mbrs: A Library for Minimum Bayes Risk Decoding

Hiroyuki Deguchi, Yusuke Sakai, Hidetaka Kamigaito, Taro Watanabe
8/8/2024
cs.CL

Official code: naist-nlp/mbrs (53 stars, MIT, PyTorch, last commit 2025-11-02).

Abstract

Minimum Bayes risk (MBR) decoding is a decision rule of text generation tasks that outperforms conventional maximum a posterior (MAP) decoding using beam search by selecting high-quality outputs based on a utility function rather than those with high-probability. Typically, it finds the most suitable hypothesis from the set of hypotheses under the sampled pseudo-references. mbrs is a library of MBR decoding, which can flexibly combine various metrics, alternative expectation estimations, and algorithmic variants. It is designed with a focus on speed measurement and calling count of code blocks, transparency, reproducibility, and extensibility, which are essential for researchers and developers. We published our mbrs as an MIT-licensed open-source project, and the code is available on GitHub. GitHub: https://github.com/naist-nlp/mbrs

View on arXivView PDF

Code Implementations(1)

naist-nlp/mbrsOfficial100%
PyTorchMIT

A library for minimum Bayes risk (MBR) decoding

537PythonApr 24, 202411 months agoMIT
mbr-decodingnatural-language-processingpythonpytorch

Similar Papers

Cite this paper

@article{deguchi2024mbrs,
  title  = {mbrs: A Library for Minimum Bayes Risk Decoding},
  author = {Hiroyuki Deguchi and Yusuke Sakai and Hidetaka Kamigaito and Taro Watanabe},
  year   = {2024},
  eprint = {2408.04167},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2408.04167v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2408.04167.svg)](https://codeofpaper.com/paper/2408.04167)

Discussion