# Number of parameters in an RNN

I'm using a basic RNN as in the figure below (say for translation). The model has the following structure:

\begin{aligned} s_t &= \tanh(Ux_t + Ws_{t-1}) \\ o_t &= \mathrm{softmax}(Vs_t) \end{aligned}

• Assume m is the vocabulary size and n that of the hidden layer.
• If $x_{t}=\{0,1\}^{m}$ and U is a $n \times m$ matrix then W is a $n \times n$ matrix.
• If $o_{t}$ is $\mathbb{R}^{k}$ and $s_{t}$ is $\mathbb{R}^{n}$then V is a $k \times n$ matrix.

What's the # parameters for this RNN model?

The entities W , U and V are shared by all steps of the RNN and these are the only parameters in the model described in the figure. Hence number of parameters to be learnt while training = $dim(W)+ dim(V)+ dim(U)$.
Based on data in the question this = $n^{2}+ kn + nm$.