Definition: given a function $f:\mathbb{R}^n\to\mathbb{R}^m$, the partial derivative of $f$ at $a\in\mathbb{R}^n$ in the direction $v\in\mathbb{R}^n$ is defined as $$\lim_{t\to 0}\frac{f(a+tv)-f(a)}{t}.$$ Important for the question is the fact that $a$ and $v$ belong to $\mathbb{R}^n$.
Page 13 of Arnold's Mathematical Methods of Classical Mechanics contains the following definition:
It is not clear to me how $$\frac{\partial U}{\partial \mathbf{x}_i}$$ is defined, since $U$ is a function $\mathbb{R}^{3n}\to\mathbb{R}$, yet $\mathbf{x}_i$ belongs to $\mathbb{R}^3$ (not to $\mathbb{R}^{3n}$). How is $(4)$ defined?


The short answer is $\left(\frac{\partial U}{\partial x_{i,1}}, \frac{\partial U}{\partial x_{i,2}}, \frac{\partial U}{\partial x_{i,3}}\right)$.
Or, if you want to look at it coordinate-free, then in general if $V_1,\dots, V_k$ are (say finite-dimensional… and in your case $\Bbb{R}^3$) Hilbert spaces and $V:=V_1\times\cdots\times V_k$ then for any open set $\Omega\subset V$ and differentiable map $f:\Omega\to \Bbb{R}$, and a point $a=(a_1,\dots, a_k)\in \Omega$ we can consider the Frechet derivative $Df_a$. This is a linear map $V\to\Bbb{R}$. We can now restrict this linear map to the subspace corresponding to $V_i$, i.e to $\{0\}\times\cdots\times V_i\cdots\times \{0\}$. Then, (by trivially ignoring the zeros) we get a linear map $V_i\to\Bbb{R}$. This is actually nothing but the $i^{th}$ partial Frechet derivative, which I shall denote here as $(D_if)_a:V_i\to\Bbb{R}$. Now, using the inner product, we can convert this element of $(V_i)^*$ into an element of $V_i$ (Riesz-representation theorem… though this is trivial in finite dimensions), and let us call this $\partial_if_a$, or $\frac{\partial f}{\partial x^i}(a)$. Now, more fancily, one can actually interpret the multiplication by the mass $m_i$ as being the inner product in disguise (but ignore this if it doesn’t make sense).
Anyway, one more thing which perhaps I should clarify is that on the LHS of the equation, you have $m_i\ddot{x}_i$, which is a map $I\subset\Bbb{R}\to V_i$, but on the right, you have a function $\Omega\to V_i$, so the really precise way to write the equality is \begin{align} m_i\ddot{\mathbf{x}_i}&=\frac{\partial U}{\partial \mathbf{x}_i}\circ\mathbf{x}, \end{align} where $\mathbf{x}=(\mathbf{x}_1,\dots,\mathbf{x}_k):I\to\Omega\subset V$.