The application provides a
language model reasoning method and device based on hierarchical state
memory bank and combined initialization, a terminal, a medium and a product. The method comprises the following steps: constructing a hierarchical state
memory bank; obtaining user query information, and performing hierarchical retrieval in the hierarchical state
memory bank based on the user query information to obtain a best state set; performing combined initialization on the best state set to generate an initial state; and enabling a
basic language model to start reasoning on the user query information in the initial state to generate a corresponding reasoning result. Through hierarchical retrieval, the application can provide matched context for queries of different granularities, solve the
cold start problem of the existing linear attention
language model in the form of RNN, and make the reasoning result of the model more accurate.