ml-explore / ml-explore/mlx-examples

Feature Request - Beam Search Decoder

Open
#846 0 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
9k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Hi MLX team,
I want to request a feature/example implementation of Beam Search Decoder for one of the text generation examples. The current implementations only cover Greedy and Top-P sampling. I currently implemented a naive beam search implementation, which runs on CPU and is slow with many for loops. It would be helpful if someone from your team could provide a reference implementation using MLX kernels and efficiently utilize GPU or vectorized CPU kernels.

I am happy to collaborate on this if I can get some guidance from your team.

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 locating the text generation examples that implement Greedy and Top-P sampling, then review how decoding is structured and where a beam-search entry point would fit. Compare the requested behavior with the existing naive CPU implementation described in the issue; done means a reference beam-search decoder using MLX kernels with GPU or vectorized CPU execution.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.