# What is branch factor for beam search in RNNs like TensorFlow's Magenta?

TensorFlow's Magenta melody generation module has a parameter for branch_factor1. What is it?

Branch factor in beam search refers to average number of branches at each level of a search tree. When predicting a sequence in an LSTM model, such as note selection in melody generation, $b$ branches will be decoded. Increasing the branch factor from 1 to 4 in the call to melody_rnn_generate will maintain the average number of branches to be at $b$.