Let $0 < n, \ell$ be natural numbers with $n < \ell$. We will define a function $F_{n\ell}(\kappa)$ on infinite cardinals indexed by $n$ and $\ell$.
To compute $F_{n\ell}(\kappa)$ let $A$ be a set of cardinality $\kappa$. $F_{n\ell}(\kappa)$ will be the supremum of cardinalities of sets $B$ such that there exists a relation $R \subseteq A\times B^{n}$ with the property that for any ordered sequence $b_1,b_2,\dots,b_\ell$ of elements of $B$, if $\overline{b}$ is 'indiscernible with respect to $R$ over $A$', then $b_i=b_j$ for some $i<j$.
By indiscernible with respect to $R$ over $A$, I mean that for any two increasing sequences $i_1<i_2 <\dots < i_{n} \leq \ell$ and $j_1<j_2 <\dots < j_{n} \leq \ell$, for any $a\in A$ we have $R(a,b_{i_1},\dots,b_{i_n})$ if and only if $R(a,b_{j_1},\dots,b_{j_n})$.
First an easy observation, if $\ell_0 \leq \ell_1$, then $F_{n\ell_0}(\kappa) \leq F_{n\ell_1}(\kappa)$, since any witnessing lower bound of the value of $F_{n\ell_0}(\kappa)$ is also a witnessing lower bound of the value of $F_{n\ell_1}(\kappa)$. Also if $\kappa \leq \lambda$, then $F_{n\ell}(\kappa)\leq F_{n\ell}(\lambda)$, since we can always pad $A$ out with more elements and let $R$ be false on any new element. Another easy obersvation is that $F_{1\ell}(\kappa)=\beth(\kappa)$ for any $\ell>1$.
Now finally the relevance of Erdős–Rado is not too surprising:
Proposition: $F_{n\ell}(\kappa) \leq \beth_n(\kappa)$
Proof: Assume that you have $A$ and $B$ with $|A|=\kappa$ and $B > \beth_n(\kappa)$ and a relation $R$ with the relevant properties. Pick a linear ordering on $B$ and color the collection of $n$-tuples in $B$ by giving an ordered tuple $\overline{b}$ the function $a\mapsto R(a,\overline{b})$ as a color. Note that this is a collection of $\beth(\kappa)$ many possible colors. We can apply the Erdős–Rado partition relation $\beth_{n-1}(\beth(\kappa))^+\rightarrow(\beth(\kappa)^+)^n_{\beth(\kappa)}$ to get that there is a homogeneous set of size $\beth(\kappa)^+$, which is in particular larger than $\ell$. This is a contradiction, so we have that $|B|\leq \beth_n(\kappa)$. $\square$
I heavily suspect that $\mathsf{ZFC} + \mathsf{GCH} \vdash F_{n\ell}(\kappa) = \beth_n(\kappa)$ and I'm guessing that you don't need $\mathsf{GCH}$, but that step in the proof were we go from $\beth(\kappa)^+$ to $\ell$ seems really inefficient, so I would like to know for sure:
Question: Is it consistent that $F_{n\ell}(\kappa) < \beth_n(\kappa)$ for some $n,$ $\ell,$ and $\kappa$? Is it consistent that $F_{n\ell_0}(\kappa) < F_{n\ell_1}(\kappa)$ for some $n,$ $\ell_0,$ $\ell_1,$ and $\kappa$?