OpenNMT / OpenNMT/CTranslate2

Support sequence_bias when decoding

Open
#1,614 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
4.7k
Forks
536
Avg merge
12h 12m
Merged PRs (30d)
4

Description

In huggingface transformers, there is a generate option called sequence_bias to increase/decrease the logits of user-specified sequence of tokens, using the SequenceBiasLogitsProcessor. Would be nice to have such generation option here as well.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing Hugging Face Transformers' generate option and SequenceBiasLogitsProcessor with CTranslate2's decoding entry points. Trace how generation options reach logits processing, then define completion as support for increasing or decreasing logits for user-specified token sequences, with coverage for the new option.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, huggingface
Domain
machine-learning
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.