\section{Scalar perturbations}

\section{Introduction}
Cosmological perturbations \cite{Kodama:1985bj} play a fundamental role in modeling the Universe, since they allow to study the origins of large structure, the anisotropies of the cosmic microwave background (CMB) radiation, and the propagation of gravitational waves on cosmological distances.

We derive a set of universal model  independent effective equations and Lagrangians which can describe the evolution of scalar and tensor perturbation of any system whose field equations can be written in an Einstein like form. This includes for example multi-fields systems \cite{Romano:2020oov}, or modified gravity theories such as Horndeski's theory\cite{Horndeski:1974wa}, once they have been transformed to the Einstein frame.
Given the generality of this effective description it is particularly suitable for model independent phenomenological analysis of observational data.

The approach predicts naturally that the speed of gravitational waves $c_{T,A}$ con depend on  frequency and polarization, due to the interactions of the graviton with itself or other fields.
This prediction allows to use gravitational waves observations to investigate the elusive nature of dark matter and dark energy.

The equation and Lagrangian for scalar and tensor perturbations has the same universal structure, and the effects of the interaction can be modeled at any order in perturbations by a single effective quantity, playing the role of effective propagation speed. This is particularly useful since it allows to compare different models in terms of the two effective quantities $c_s$ and $c_T$.
Combining different set of observational data such as cosmic microwave background radiation and gravitational waves, it will be possible to constrain $c_s$ and $c_{T,A}$, to determine possible deviations from general relativity and vanilla inflation.

The effective equations and Lagrangians are derived separately for scalar and tensor perturbations, both in physical and momentum space, and the consistency with previous results derived in the literature is checked in different cases. Other predictions are then considered, such as the frequency dependency of $c_s$ and $c_T$ in vanilla inflation due to the effects of higher order interaction terms.

\section{Scalar perturbations}

\subsection{Space dependent effective sound speed}
In this section we will show that it is possible to define a space dependent effective sound speed (SESS) in terms of which a model independent equation for comoving curvature perturbations $\zeta$ can be derived.
The SESS encodes the effects of the interaction of $\zeta$ with itself and other fields, at any order in perturbations.

\subsubsection{Effective Lagrangian approach}
In the action approach the EST on the r.h.s. of the Einstein's equations originates from the interaction of scalar perturbations with themselves or other fields. Based on this we can obtain an effective Lagrangian corresponding to the perturbed field equations by introducing  higher order   interaction terms as $\mathcal{L}_{int}(\zeta,\phi^i)$, where $\phi^i$ denotes abstractly all the other fields $\zeta$ is coupled to.

We will use conformal time, and adopt the following notation for the Lagrangian density $L$
\begin{equation}
S=\int d\eta dx \mathcal{L}=\int d\eta dx z^2 L \quad , \quad  \mathcal{L}=\ z^2 {L}  \quad , \quad
 z^2=\epsilon  a^2 \,,
\end{equation}
where we are assuming a Friedman background (FRW) background with scale factor $a(\eta)$, and $\epsilon$ denotes the first order slow-roll parameter, defined in terms of cosmic time $dt=a^{-1} d\eta$.

In general relativity the quadratic Lagrangian of the comoving curvature perturbations of a minimally coupled scalar field is
\begin{eqnarray}
\mathcal{L}^{(2)}_{\zeta}=z^2\Big[\zeta'^2-(\nabla \zeta)^2\Big] &,& z^2=\epsilon  a^2\label{vani}.
\end{eqnarray}
We will call the above model vanilla inflation.

Including higher order interaction and self interaction terms we can write a general model independent Lagrangian

\begin{eqnarray}
\mathcal{L}_{\zeta}=\mathcal{L}^{(2)}_{\zeta}+\mathcal{L}^{int}_{\zeta}= z^2\Big[\zeta'^2- (\nabla \zeta)^2+L^{int}_\zeta(\zeta,\phi^i)\Big]=z^2\Big[\zeta'^2\Big(1+\frac{L^{int}_\zeta}{\zeta'^2}\Big)- (\nabla \zeta)^2\Big] \label{LEint} \,,
\end{eqnarray}
where $\phi^i$ denotes collectively any other field.
From the above equation we can obtain the effective Lagrangian
\begin{eqnarray}
\mathcal{L}^{eff}_{\zeta}=\frac{z^2}{c_s^2}\Big[\zeta'^2- c^2_s(\nabla \zeta)^2\Big]=\alpha^2\Big[\zeta'^2- c^2_s(\nabla \zeta)^2\Big]
\label{Leffzeta} \quad &,& \quad
\alpha^2=\frac{z^2}{c^2_s}=\frac{\epsilon a^2}{c^2_s} \,,
\end{eqnarray}
where we have defined the space effective  sound speed (SESS) according to
\begin{eqnarray}
c_s^2(\eta,x^i)=\Big(1+\frac{L_{\zeta}^{int}}{\zeta'^2}\Big)^{-1} \label{ctS}  \,.
\end{eqnarray}

The variation of $\mathcal{L}^{eff}_{\zeta}$ gives the model independent equation
\begin{eqnarray}
\zeta''+2 \frac{\alpha'}{\alpha} \zeta'-c_s^2 \nabla^2 \zeta&=&0 \,,\label{zetaalphaA}
\end{eqnarray}
which can be also written as
\begin{eqnarray}
\zeta''+2  \Big(\frac{z'}{z}-\frac{c'_s}{ c_s}\Big) \zeta'-c^2_s \nabla^2 \zeta&=&0  \,\label{zetacs}\,.
\end{eqnarray}
Note that in deriving the equations of motion for $\zeta$ the SESS has been treated as a function independent of $\zeta$, since the SESS is an effective quantity determined by substituting the solutions of the full theory, including the effects of interaction, into the interaction Lagrangian $L^{int}$.
For any system with a well defined Lagrangian it should be always possible to solve the  equations of motions, and then use the solutions to define the SESS.

Eq.(\ref{zetaalphaA})  and eq.(\ref{Leffzeta}) show that $\alpha(\eta,x^i)$ can be interpreted as an effective space dependent scale factor, while eq.(\ref{zetacs}) shows explicitly the modification of the friction term induced by the SESS.
Since  these equations are model independent, we can immediately conclude that the friction terms cannot be modified if $c_s'=0$.

The effective Lagrangian can be obtained from the vanilla case in eq.(\ref{vani})
\begin{equation}
\mathcal{L}^{(2)}_{\zeta}=z^2\Big[\zeta'^2-c^2(\nabla \zeta)^2\Big] \,\label{vani}.
\end{equation}
by the transformation
\begin{equation}
z^2 \rightarrow \alpha=\frac{z^2}{c^2_s} \quad,\quad c\rightarrow c_s \,,\label{transk}
\end{equation}
where we are denoting with $c$ the unity sound speed, to avoid ambiguity.
This is in agreement with eq.(\ref{zetaalphaA}), which shows that $\alpha$ can be regarded as an effective scale factor.

The main advantage of using eq.(\ref{zetaalphaA}) is that it is completely  model independent, allowing to study in a systematic way deviations from general relativity or the effects of the interaction with different fields using a single function.
Note that since $\mathcal{L}_{int}$ can be space dependent, also $c_s(\eta,x^i)$ depends on space, with the exception of $\mathcal{L}_{int}\propto f(\eta)\zeta'^2$, when it is only time dependent, which corresponds to K-inflation \cite{Garriga:1999vw}.

In presence of multiple scalar fields the space dependence is manifested already in the quadratic Lagrangian \cite{Vallejo-Pena:2019hgv},  while the effects of anisotropic perturbations requires at least a cubic Lagrangian, because scalar fields anisotropies appear at second order in the EST.

Note that even in vanilla inflation the sound speed can be space dependent when including the cubic and higher order Lagrangians \cite{Maldacena:2002vr}, as we will show explicitly later.
This is consistent with the EST approach, since a scalar field EST is anisotropic at second order, leading to source terms in the perturbed field equations.
\subsubsection{Interpretation of the space dependency of the SESS}
The space dependency of the SESS is a natural manifestation of the interaction and self-interaction of scalar perturbations, and of the coupling of tensor and scalar perturbations.
In multiple scalar fields systems these effects are already present in the quadratic Lagrangian, and are associated to entropy perturbations, while for a single scalar field they manifest only starting from the cubic Lagrangian.

\subsubsection{Effective stress-energy tensor approach}

Scalar perturbations of the metric and of the Effective stress-energy tensor (EST) can be written as
\begin{eqnarray}
ds^2 = -(1+2A)dt^2+2a\partial_iB dx^idt + a^2\left\{\delta_{ij}(1+2C)+2\partial_i\partial_jE\right\}dx^idx^j \, , \label{pmetric} \\
T^0{}_0 = - (\rho+\delta\rho) \quad \,, \quad  T^0{}_i = (\rho+P) \partial_i(v+B) \,, \nonumber \\ T^i{}_j = (P+\delta P)\delta^i{}_j + \delta^{ik}
\partial_{k}\partial_{j}\Pi
-\frac{1}{3} \delta^{i}{}_{j} \SPD \Pi  \, . \label{psem}
\end{eqnarray}
where $v$ is the velocity potential and $\SPD \equiv \delta^{kl}\partial_k\partial_l$.
Note that any metric and EST can always be written in the above form, making all the results obtained from it completely model independent.
The comoving slices gauge is defined by the condition $(T^{0}{}_{i})_c=0$, and we  denote with a subscript $c$ quantities evaluated on comoving slices.
In multiple fields systems the EST is the sum of  the stress-energy tensors of each field, which in the comoving gauge is associated to entropy perturbations \cite{Romano:2018frb}.

In the comoving gauge entropy perturbations $\Gamma$ are introduced \cite{Kodama:1985bj} by
\begin{align}
\delta P_c(\eta,x^i) &= c_a(\eta)^2 \delta\rho_c(\eta,x^i) + \Gamma(\eta,x^i) \, , \label{entropy} \end{align}
where $c_a$ is interpreted as the adiabatic sound speed, and is by definition a function of time only.
Note that this definition can be ambiguous \cite{Romano:2018frb}.

The manipulation of the perturbed Einstein's equation in the comoving gauge gives

\begin{eqnarray}
\R''+\frac{\partial_\eta z_a^2}{z_a^2}\R'-c_a^2\SPD\R = a^2\mathcal{S} \,, \label{zetaS} \\
\mathcal{S} =-\frac{c_a^2}{\epsilon}\SPD \Pi- \frac{1}{ 2 a^2 z_a^2 } \left[ \frac{a^3}{c_a^2 H} \left(\Gamma + \frac{2}{3}\SPD \Pi \right) \right]' \label{RS} &,& z_a^2= \frac{\epsilon a^2}{c^2_a} \,,
\end{eqnarray}
where we are denoting derivatives with respect to conformal time with a prime.
The source term in the above equation can be absorbed into the definition of the space effective sound speed (SESS) following a similar approach to the one adopted for gravitational waves \cite{Romano:2022jeh}.

We can first re-write eq.(\ref{RS}) as
\begin{equation}
\frac{(\R' z_a^2)'}{z_a^2}-\frac{(g z_a^2)'}{z_a^2}- c_a^2\nabla^2 \R=\frac{\Big[\R' z_a^2(1-g/\R')\Big]'}{z_a^2}- c_a^2\nabla^2 \R=0 \label{gh} \,,
\end{equation}
where we have defined
\begin{equation}
g=\frac{1}{z_a^2}\int z_a^2 a^2 \mathcal{S}\,d\eta\,.
\end{equation}
After introducing the quantities
\begin{eqnarray}
1+\delta(\eta,x^i)=\Big(1-\frac{g}{\R'}\Big)^{-1/2} \quad &,& \quad \alpha^2=\frac{z_a^2}{(1+\delta)^2}=\frac{\epsilon a^2}{c^2_a(1+\delta)^2} \,, \label{vs}
\end{eqnarray}
we can rewrite eq.(\ref{gh}) as
\begin{equation}
\frac{1}{z_a^2}(\alpha^2 \R')'-c_a^2\nabla^2 \R=0\,. \label{zh}
\end{equation}
Defining the space effective sound speed (SESS) as
\begin{equation}
c_s(\eta,x^i)=c_a(\eta)\Big[1+\delta(\eta,x^i)\Big] \,, \label{sess}
\end{equation}
and re-writing $\alpha$ in terms of $c_s$ as
\begin{eqnarray}
\alpha^2=\frac{\epsilon a^2}{c^2_s} \,,
\end{eqnarray}
we finally obtain the model independent effective equation
\begin{eqnarray}
\zeta''+2 \frac{\alpha'}{\alpha} \zeta'-c_s^2 \nabla^2 \zeta&=&0 \label{zetaalpha} \,,
\end{eqnarray}
which shows that $c_s$ is the correct definition of effective sound speed.
Eq.(\ref{zetaalpha}) is in agreement with eq.(\ref{zetaalphaA}), obtained using the effective Lagrangian approach, is completely general, and it can be applied to study multi-fields models, modified gravity, dark energy or dark matter.

Note that the SESS definition given in eq.(\ref{sess}) is more general that the one given in \cite{Romano:2018frb}, which is including the effects of entropy, but not of anisotropy.
Using an effective Langrangian approach there is no distinction between entropy and anisotropy,  since they are both associated to interaction terms, and the effective description is more transparent than using the EST approach, but both methods lead to the same conclusions, since the source terms in the field equations are obtained from the variation of the interaction Lagrangian.

The SVT decomposition of the EST is valid at any order in perturbations, so eq.(\ref{zetaalpha}) is including the effects of interaction at any order in perturbations, including self-interaction, and for this reason is in agreement with eq.(\ref{zetaalphaA}), obtained by encoding in $c_s$ the effects of all higher order interaction terms.

\subsection{Momentum effective sound speed}
In this section we will show that it is possible to define a momentum dependent effective sound speed (MESS) in terms of which a model independent equation for comoving curvature perturbations $\zeta$ can be derived.
The MESS encodes the effects of the interaction of $\zeta$ with itself and other fields, at any order in perturbations.
The MESS is not the Fourier transform of the SESS, but it is mathematically convenient, since it allows to obtain a model independent equation involving minimal changes of the vanilla case.

\subsubsection{Effective Lagrangian approach}
A model independent effective equation and Lagrangian can also be derived in momentum space, using the two different methods adopted previously, the field equations and action approach.
The Lagrangian in momentum space can be written as

\begin{eqnarray}
\mathcal{L}_{\zeta_k}=\mathcal{L}^{(2)}_{\zeta_k}+\mathcal{L}^{int}_{\zeta_k}= z^2\Big[\zeta'^2_k+k^2 \zeta_k^2+L^{int}_{\zeta_k}(\zeta_k,\phi_k^i)\Big] \label{Lintk} \,.\\
\end{eqnarray}
The effective Lagrangian is
\begin{eqnarray}
\mathcal{L}^{eff}_{\zeta_k}=\tilde{\alpha}^2\Big[\zeta_k'^2+\tilde{c}^2_s k^2 \zeta^2_k\Big]
 &,&
\tilde{\alpha}^2(\eta,k)=\frac{z^2}{\tilde{c}_s^2}=\frac{\epsilon a^2}{\tilde{c}_s^2}\,, \label{Leffzetak}
\end{eqnarray}
where we have defined the momentum effective sound speed (MESS) $\tilde{c}_s$ and effective scalar factor as
\begin{eqnarray}
\tilde{c}_s^2(\eta,k)=\Big(1+\frac{L^{int}_k}{\zeta'^2_k}\Big)^{-1} \label{csk} &,&
\tilde{\alpha}^2(\eta,k)=\frac{\epsilon a^2}{\tilde{c}_s^2}=\frac{z^2}{\tilde{c}_s^2} \,.
\end{eqnarray}
which gives the equation
\begin{eqnarray}
\zeta_k''+2 \frac{\tilde{\alpha}'}{\tilde{\alpha}} \zeta_k'+\tilde{c}_s^2 k^2 \zeta_k&=&0 \,,  \label{zetaalphak}
\end{eqnarray}
which can be also be written as
\begin{eqnarray}
\zeta_k''+2 \Big(\frac{z'}{z}-\frac{\tilde{c_s}'}{\tilde{c}_s}\Big) \zeta_k'+\tilde{c}_s^2 k^2 \zeta_k&=&0 \,. \label{zetacsk}
\end{eqnarray}
Eq.(\ref{zetaalphak})  and eq.(\ref{Leffzetak}) show that $\tilde{\alpha}(\eta,k)$ can be interpreted as an effective momentum dependent scale factor, while eq.(\ref{zetacsk}) shows explicitly the modification of the friction term induced the MESS.
Since  these equations are model independent, we can immediately conclude that the friction terms cannot be modified if $\tilde{c}_s'=0$.

The effective Lagrangian can be obtained from the vanilla inflation action
\begin{equation}
\mathcal{L}^{(2)}_{\zeta_k}=z^2\Big[\zeta'^2_k+c^2 k^2\zeta^2_k\Big] \,,
\end{equation}
by the transformation
\begin{equation}
z^2 \rightarrow \tilde{\alpha}=\frac{z^2}{\tilde{c}^2_s} \quad,\quad c\rightarrow \tilde{c}_s \,,\label{transk}
\end{equation}
where we are denoting with $c$ the unity sound speed, to avoid ambiguity.

This is in agreement with eq.(\ref{zetaalphak}), which shows that $\tilde{\alpha}$ can be regarded as a momentum dependent effective scale factor.
Note that the quantities $\tilde{c_s}$ and $\tilde{\alpha}$ are not the Fourier transform of $c_s$ and $\alpha$.

\subsubsection{Field equations approach}
Taking the Fourier transform of eq.(\ref{RS}) we get
\begin{eqnarray}
\R_k''+\frac{\partial_\eta z^2}{z^2}\R_k'+c_a^2 k^2 \R_k = a^2\mathcal{S}_k \,,\label{zetaS} \\
\mathcal{S}_k =\frac{c_a^2}{\epsilon}k^2 \Pi_k- \frac{1}{2 z_a^2 a} \left[ \frac{a^3}{c_a^2 H} \left(\Gamma_k - \frac{2}{3}k^2 \Pi_k \right) \right]' \label{RSk} &,& z_a^2= \epsilon a^2/c^2_a \,,
\end{eqnarray}
After introducing the quantities
\begin{eqnarray}
g_k=\frac{1}{z_a^2}\int z_a^2 a^2\mathcal{S}_k\,d\eta \quad , \quad
1+\delta_k(\eta)=\Big(1-\frac{g_k}{\R_k'}\Big)^{-1/2} \quad , \quad \tilde{\alpha}^2=\frac{z^2}{(1+\delta_k)^2}=\frac{\epsilon a^2}{c^2_a(1+\delta_k)^2}\,, \label{vs}
\end{eqnarray}
we can rewrite eq.(\ref{RSk}) as
\begin{equation}
\frac{1}{z^2}(\tilde{\alpha}^2 \R_k')'+c_a^2 k^2 \R_k=0\,. \label{zh}
\end{equation}
Defining the momentum effective sound speed (MESS) as
\begin{equation}
\tilde{c}_s(\eta,k)=c_a(\eta)\Big[1+\delta_k(\eta)\Big] \,, \label{messa}
\end{equation}
and re-writing $\tilde{\alpha}$ in terms of $\tilde{c}_s$ as
\begin{eqnarray}
\tilde{\alpha}^2=\frac{\epsilon a^2}{\tilde{c}^2_s} \,,
\end{eqnarray}
we finally obtain the model independent effective equation
\begin{eqnarray}
\zeta_k''+2 \frac{\tilde{\alpha}'}{\tilde{\alpha}} \zeta_k'+\tilde{c}_s^2 k^2 \zeta_k&=&0 \label{zetaalphak2} \,,
\end{eqnarray}
which shows that $\tilde{c}_s$ is the correct definition of momentum effective sound speed, in agreement with eq.(\ref{zetaalphak}).

\subsection{Effective metric description}
In terms of the effective metric
\begin{equation}
ds_{eff}^2=\epsilon a^2\Big[c_s d\eta^2-\frac{\delta_{ij}}{c_s}dx^idx^j\Big] \label{geff} \,,
\end{equation}
the effective Lagrangian can be written as
\begin{equation}
\mathcal{L}^{eff}_{\zeta}=\sqrt{-g}(\partial_{\mu}\zeta \partial^{\mu}\zeta)=g^{\zeta}_{\mu\nu}dx^{\mu}dx^{\nu} \,.
\end{equation}
for which the equation of motion is simply given by the convariant D'Alembert operator

\begin{equation}
\square \zeta=\frac{1}{\sqrt{-g^{\zeta}}}\partial_{\mu}(\sqrt{-g^{\zeta}}\partial^{\mu}\zeta)=0 \,.
\end{equation}
In this geometrical description the perturbations propagate in an empty curved space, whose geometry is determined by the interaction of the perturbations.
This is conceptually analogous to the general relativistic geometrical interpretation of the effects of gravity in terms of geodesics in a curved space, whose geometry is determined by the EST.
More about this geometrical interpretation will be discussed in a future work.

\subsection{Consistency with previous calculations}
\subsubsection{Minimally coupled scalar field in general relativity}
The vanilla scenario corresponds to $\mathcal{L}^{int}=0$, leading to $\delta=0$, $c_s=c_a=1$.
The quantity $c_w=P'/\rho'$ does not give the correct definition of sound speed, since it does not coincide with  \cite{Romano:2015vxz} the SESS  $c_s=1\neq c_w$.

\subsubsection{K-inflation}
When the interaction Lagrangian is of the form $\mathcal{L}^{int} \propto f(\eta)\zeta'^2$ the SESS is just a function of time $c_s(\eta)=c_a(\eta)$ and $\delta=0$.
In this case the effective action in eq.(\ref{Leffzeta}) and effective eq.(\ref{zetaalphaA}) are in agreement with \cite{Garriga:1999vw}

\begin{equation}
\mathcal{L}^{eff}_{\zeta}=\frac{z^2}{c_s(\eta)}\Big[\zeta'^2- c^2_s(\eta)(\nabla \zeta)^2\Big]\,.
\label{LeffzetaK}
\end{equation}

\subsubsection{Ultra-slow roll inflation and its generalizations}
Ultra-slow roll inflation (USR) is a particular case of globally adiabatic system, in general characterized by  the vanishing of $\delta P_{nad}=\delta P_{ud}=\delta P-c_w\delta\rho$ on any scale \cite{Romano:2015vxz}, where $c_w=P'/\rho'$, and the subscript "ud" stands for uniform density gauge, defined by the condition $\delta\rho=0$. In USR models the quantity $c_w=P/\rho'$ coincides with  \cite{Romano:2015vxz} the SESS  $c_s=c_w=1$. In other globally adiabatic models such as generalized USR and Lambert inflation \cite{Romano:2016gop} $c_s=c_w\neq1$.
\subsubsection{MESS with multiple scalar fields}
The momentum dependency of the sound speed has been found in some specific multi-fields systems \cite{Achucarro:2012sm} where entropy modes can be integrated out analytically. This was generalized in a model independent framework in\cite{Romano:2018frb,Romano:2020oov}, defining the MESS for an arbitrary multi-field system, including those in which entropy modes cannot be easily integrated out analytically, and for an arbitrary field space metric.

\subsubsection{MESS in modified gravity}
In modified gravity theories an effective entropy and anisotropy can arise in the comoving gauge perturbed field equations, leading to a MESS depending on the specific gravity theory \cite{Vallejo-Pena:2019hgv}.
An equivalent definition can be obtained from the Lagrangian describing the perturbations, using the effective action approach outlined in the previous section.

\subsubsection{Effective sound speed and entropy perturbations}

The SESS was introduced for the first time in a model independent way in \cite{Romano:2018frb} as $c_s=\delta P_c/\delta \rho_c$, but that definition is only valid for systems with entropy perturbations, but no anisotropy, while the correct generalization including anisotropy was given in this paper in eq.(\ref{sess}).

It is easy to check   that in absence of anisotropy eq.(\ref{sess}) is in agreement with eq.(29) in \cite{Romano:2018frb}. From the perturbations equation we can in fact obtain $\mathcal{S}$, and the corresponding interaction Lagrangian $L_{int}$

\begin{eqnarray}
\mathcal{S}&=&-\frac{1}{ 2 a^2 z_a^2 }  \Big(\frac{a^3}{c_a^2 H} \Gamma\Big)'\,,\\
\L_{int}&=&z_a^2 L_{int}=z_a^2 \frac{a\Gamma}{2\epsilon H}\R'=\frac{a^3\Gamma}{2c^2_a H}\R' \,, \\
g&=&\frac{1}{z_a^2}\int z_a^2 a^2 \mathcal{S}\,d\eta\,=-\frac{a\Gamma}{2\epsilon H} \,,\\
c_s^2&=&c_a^2 \Big(1-\frac{g}{\R'}\Big)^{-1}=c_a^2 \Big(1+\frac{L_{int}}{\R'^2}\Big)^{-1}=\Big(1+\frac{a\Gamma}{2\epsilon H \R'}\Big)^{-1} \,,
\end{eqnarray}
which shows explicitly that entropy and curvature perturbations are coupled already at second order in the term $L_{int} \propto \Gamma\R'$, explaining why a momentum dependent $c_s$ arises already from the quadratic action, while the calculation of the momentum dependency due to the anisotropy require the cubic action.

\subsection{New predictions and applications}

\subsubsection{MESS in vanilla inflation due to self interaction}
Even in the vanilla scenario higher order interaction terms are expected to induce a momentum dependency of the effective sound speed, associated to cubic and higher order terms.
These effects are ignored in leading order calculations, but arise naturally at higher order.

For example, for the scalar perturbations we have the interaction Lagrangian \cite{Maldacena:2002vr}
\begin{align}
\mathcal{L}^{(3)}_{int} =  ~a^4 \left[ \frac{\epsilon^2}{a^2}  \zeta'^2 \zeta + \frac{1}{a^2} \epsilon^2 (\partial_i \zeta)^2 \zeta   \right.
\left. - 2 \frac{\epsilon}{a}  \zeta' \partial_i \zeta \partial_i \chi -\frac{1}{2} \frac{\epsilon^3}{a^2} \zeta'^2 \zeta + \frac{1}{2} \epsilon  \zeta (\partial_i \partial_j \chi)^2 + \frac{1}{2} \frac{\epsilon}{a^2} \eta' \zeta' \zeta^2 \right], \label{S3}
\end{align}
where $\partial^2\chi=\zeta' \epsilon/a $.
In momentum space we can compute the  MESS
\begin{equation}
\tilde{c}_s^2(\eta,k)=\Big(1+\frac{L^{(3)}_{k,int}}{\zeta'^2_k}\Big)^{-1} \,,
\end{equation}
where $\mathcal{L}^{(3)}_{k,int}=z^2 L^{(3)}_{k,int}$ is the Fourier transform of $\mathcal{L}^{(3)}_{int}$.
The MESS encodes the effects of self-interaction on $\zeta$, which are associated to loop corrections of the power spectrum \cite{Kristiano:2022maq}, which can become large when slow-roll is violated \cite{Romano:2016gop}.

\subsubsection{MESS in modified gravity}
For a specific case of Horndeski theory \cite{Vallejo-Pena:2019hgv} the MESS was computed in the comoving gauge, showing explicitly that it is momentum dependent, as expected.
The same result can be extended to other modified gravity theories once the cubic and higher order actions have been computed.
For example for Horndeski theory the cubic action was computed in \cite{Gao:2012ib}, including the coupling of tensor and scalar perturbations.

The model independent approach we have derived does not require any definition of entropy perturbations, and it includes the effects of anisotropy, since they are both related to interactions terms.
\subsubsection{f(R) theories}
In the Einstein's frame  $f(R)$ theories are mathematically equivalent to general relativity with a minimally coupled scalar field. The anisotropic part of the EST of the scalar field arises only at second order in scalar perturbations, is proportional to the space derivatives $\delta\phi_{,i},\delta\phi_{,j}$ \cite{Antusch:2016con}, and is associated to cubic terms in the action \cite{Gao:2012ib}, coupling also tensor and scalar perturbations, which are not included in the quadratic actions

Cubic order calculations are expected to show the momentum dependency predicted by the MESS approach, which can be interpreted as the effects of the anisotropy of the EST, which corresponds to cubic self-interaction terms in the Lagrangian, and of the coupling of scalar and tensor perturbations.
\subsubsection{MESS in axion inflation}
The coupling of scalar perturbations with a gauge field induces a momentum dependency of the MESS, which should arise already in the quadratic Lagrangian.
For example the quadratic interaction Lagrangian can contain terms of the form
\begin{equation}
L^{(2)int}_\zeta \propto \delta A_{\mu}\partial^{\mu}\zeta \, , \, \delta A_{\mu}\partial^{\mu}h
\end{equation}
where $\delta A_{\mu}$ denotes perturbations of the gauge field $A_{\mu}$, while at higher order other terms can appear such as for example

\begin{equation}
L^{(3)int}_\zeta \supset  \,\partial_{\nu}(\delta A_{\mu})\partial^{\mu}\zeta\partial^{\nu}\zeta  \quad , \quad \delta A_{\mu}\delta A^{\mu}\zeta \quad , \quad \delta F_{\mu\nu}\partial^{\mu}\zeta\partial^{\nu}\zeta \,,
\end{equation}
where $F_{\mu\nu}$ denoted the perturbations of the Faraday tensor $F_{\mu\nu}=\partial_{\mu}A_{\nu}-\partial_{\nu}A_{\mu}$.
The effects of these interaction terms are often ignored in the literature, but a priori there is no no general argument to justify that they can be always neglected. These interaction terms give rise to effects similar to those associated to entropy in multi-fields scalar systems, which can be dominant \cite{Romano:2020oov}, and are worth being studied systematically.

\section{Gravitational waves}
\subsection{Space effective gravitational wave speed}
Adopting an approach similar to the one used for scalar perturbations, we derive an effective action and propagation equation for gravitational waves.
\subsubsection{Effective Lagrangian approach}
The effective Lagrangian for gravitational waves can be obtained with a  method analogous to the one used for scalar perturbations.
In this section we will use a slightly different notation for the Lagrangian density

\begin{equation}
S=\int d\eta dx \mathcal{L}=\int d\eta dx \sqrt{-g} L=\int d\eta dx \,a^2{L} \quad , \quad  \mathcal{L}=\ a^2 {L} \,.
\end{equation}

The Lagrangian for the polarization mode $h_A$ in general relativity is
\begin{equation}
\mathcal{L}^{GR}_h=a^2\Big[h'^2_A-(\nabla h_A)^2\Big] \label{LEint} \,,\,\\
\end{equation}
and adding interaction terms we have
\begin{equation}
\mathcal{L}_h=\mathcal{L}^{GR}_h+\mathcal{L}^{int}_h= a^2\Big[h'^2_A-(\nabla h_A)^2+L_h^{int}(h_A,\phi^i)\Big]=a^2\Big[h'^2_A\Big(1+\frac{L_h^{int}}{h'^2_A}\Big)-(\nabla h_A)^2\Big] \label{LEint} \,,\,\\
\end{equation}
where $\phi^i$ denotes abstractly all the other fields the graviton is coupled to, including itself, or another polarization.
We can then obtain the effective Lagrangian \cite{Romano:2022jeh}
\begin{equation}
\mathcal{L}^{eff}_h=\frac{a^2}{c_{T,A}^2}\Big[ h'^2_A-c_{T,A}^2 (\nabla h_A)^2\Big]=\alpha^2\Big[ h'^2_A-c_{T,A}^2 (\nabla h_A)^2\Big],\label{Lheff}
\end{equation}
by defining the space effective GW speed (SEGS) as
\begin{equation}
c^2_{T,A}(\eta,x^i)=\Big(1+\frac{L_h^{int}}{h'^2_A}\Big)^{-1} \label{cteff}\,.
\end{equation}

The effective Lagrangian for gravitational waves has the same structure of that for comoving curvature perturbations in eq.(\ref{Leffzeta}), and one can in fact be obtained from the other by the transformation
\begin{equation}
z \longleftrightarrow a \quad,\quad c_s \longleftrightarrow c_{T,A} \,,\label{transk} \quad,\quad \zeta \longleftrightarrow h_A \,.
\end{equation}

The effective description in terms of SESS and SEGS is the same, i.e. the effective action and equation are universal, and can be used for both scalar and tensor perturbations.
It is convenient to organize the equations for scalar and tensor perturbations in a table, to show the universality of the effective approach.

\begin{tabular}{ | m{1.5cm} | m{7cm}| m{8cm} | }
\hline
  & Gravitational waves & Curvature perturbations   \\ \hline
 Speed  & $c^2_{T,A}(\eta,x^i)=\Big(1+\frac{L_h^{int}}{h'^2_A}\Big)^{-1} =\Big(1-\frac{g_A}{h'_A}\Big)^{-1}$  & $c_s^2(\eta,x^i)=\Big(1+\frac{L_{\zeta}^{int}}{\zeta'^2}\Big)^{-1}=c_a^2(\eta)\Big(1-\frac{g}{\R'}\Big)^{-1}$  \\ \hline
 $\mathcal{L}^{eff}$ , $\alpha$  & $\frac{a^2}{c_{T,A}^2}\Big[ h'^2_A-c_{T,A}^2 (\nabla h_A)^2\Big]$ \,,\, $\alpha_A=\frac{a^2}{c_{T,A}^2}$& $ \frac{z^2}{c_s^2}\Big[\zeta'^2- c^2_s(\nabla \zeta)^2\Big]$ \,,\, $ \alpha=\frac{\epsilon a^2}{c_s^2}=\frac{z^2}{c_s^2}$ \\ \hline

 Eq. & $h_A''+2 \frac{\alpha_A'}{\alpha_A} h'_A-c_{T,A}^2 \nabla^2 h_A=0$ & $\zeta''+2 \frac{\alpha'}{\alpha} \zeta'-c_s^2 \nabla^2 \zeta=0$ \\ \hline
 Eq. & $h_A''+2 \Big(\frac{a'}{a}-\frac{c'_{T,A}}{c_{T,A}}\Big) h'_A-c_{T,A}^2 \nabla^2 h_A=0$& $\zeta''+2  \Big(\frac{z'}{z}-\frac{c'_s}{ c_s}\Big) \zeta'-c^2_s \nabla^2 \zeta=0$ \\ \hline
\end{tabular}

\subsubsection{Effective stress-energy tensor approach}

The perturbed field equations \cite{Kodama:1985bj}
\begin{equation}
h_A''+2 \mathcal{H} h_A'+ \nabla^2 h_A= a^2 \Pi^{eff}_A\label{hEI} \,,
\end{equation}
can be manipulated to get the same model independent equation for gravitational waves that was obtained using the effective Lagrangian approach, but with the SEGS defined in terms of the EST as \cite{Romano:2022jeh}

\begin{equation}
c_{T,A}^2(\eta,x^i)=\Big(1-\frac{g_A}{h'_A}\Big)^{-1} \quad,\quad
g_A=\frac{1}{a^2}\int a^4 \Pi^{eff}_A\,d\eta\,.
\end{equation}

\subsection{Momentum effective gravitational wave speed}
Using a method similar to the one used in physical space, it is possible to derive a model independent effective action and equation in momentum space.
The  results are summarized in the table. We are denoting with $\tilde{h}$ the Fourier transform of $h$.

\vspace{1cm}

\begin{tabular}{ | m{1.5cm} | m{7cm}| m{8cm} | }
\hline

  & Gravitational waves & Curvature perturbations   \\ \hline
 Speed  & $\tilde{c}^2_{T,A}(\eta,k)=\Big(1+\frac{L_{\tilde{h}}^{int}}{\tilde{h}'^2_A}\Big)^{-1} =\Big(1-\frac{\tilde{g}_A}{\tilde{\tilde{h}}'_A}\Big)^{-1}$  & $\tilde{c}_s^2(\eta,k)=\Big(1+\frac{L_{\zeta_k}^{int}}{\zeta_k'^2}\Big)^{-1}=c_a(\eta)^2\Big(1-\frac{\tilde{g}}{\R_k'}\Big)^{-1}$  \\ \hline
 $\mathcal{L}^{eff}$ \,, $\alpha$  & $\frac{a^2}{\tilde{c}_{T,A}^2}\Big[ \tilde{h}'^2_A+k^2\tilde{c}_{T,A}^2  \tilde{h}_A^2\Big]$ \,,\, $\tilde{\alpha}_A=\frac{a^2}{\tilde{c}_{T,A}^2}$& $ \frac{z^2}{\tilde{c}_s^2}\Big[\zeta_k'^2+k^2 \tilde{c}_s^2 \zeta_k^2\Big]$ \,,\, $ \tilde{\alpha}=\frac{\epsilon a^2}{\tilde{c}_s^2}=\frac{z^2}{\tilde{c}_s^2}$ \\ \hline

 Eq. & $\tilde{h}_A''+2 \frac{\tilde{\alpha}_A'}{\tilde{\alpha}_A} \tilde{h}'_A+k^2 \tilde{c}_{T,A}^2 \tilde{h}^2_A=0$ & $\zeta_k''+2 \frac{\tilde{\alpha}'}{\tilde{\alpha}} \zeta_k'+k^2 \tilde{c}_s^2 \zeta_k^2=0$ \\ \hline
 Eq. & $\tilde{h}_A''+2 \Big(\frac{a'}{a}-\frac{\tilde{c}'_{T,A}}{\tilde{c}_{T,A}}\Big) \tilde{h}'_A+k^2 \tilde{c}_{T,A}^2 \tilde{h}^2_A=0$ & $\zeta_k''+2  \Big(\frac{z'}{z}-\frac{\tilde{c}'_s}{ \tilde{c}_s}\Big) \zeta_k'+k^2 \tilde{c}_s^2 \zeta_k^2=0$  \\ \hline
\end{tabular}

\subsection{Effective metric description}
Similarly to curvature perturbations, the effective Lagrangian for gravitational waves can be written as
\begin{equation}
\mathcal{L}^{eff}_h=\sqrt{-g_A}(\partial_{\mu}h_A \partial^{\mu}h_A) \,,
\end{equation}
in terms of the effective metric
    \begin{equation}
    ds^2_A=a^2\Big[c_{T,A}d\eta^2-\frac{\delta_{ij}}{{c_{T,A}}}dx^idx^j\Big] \label{geff} \,,
    \end{equation}
for which the GW propagation equation can be written in terms of the covariant d'Alembert operator
\begin{equation}
\square h_A=\frac{1}{\sqrt{-g_A}}\partial_{\mu}(\sqrt{-g_A}\partial^{\mu}h_A)=0 \,.
\end{equation}
As for scalar perturbations, the effects of the interaction of the graviton can be described as the propagation in a curved space whose metric depends on the SEGS. A similar result can be derived in momentum space.
\subsection{Consistency with previous calculations}

The model independent action and Lagrangian derived in the previous sections are consistent and extend previous calculation based on   quadratic action calculations.

\subsubsection{Effective field theory of inflation}
The quadratic order action for tensor modes obtained using the effective field theory of inflation \cite{Creminelli:2014wna} is in agreement with eq.(\ref{Lheff}), but the latter includes also higher order interaction terms neglected in the quadratic action, which induce the polarization and frequency dependency of the speed.

\subsubsection{Horndeski's theory}

The quadratic action for Horndeski's theory has been computed in \cite{Kobayashi:2011nu,DeFelice:2011bh}.
These calculations are in the Jordan frame,
while in the previous section we have used the Einstein frame. After performing the appropriate disformal transformation \cite{Romano:2022jeh} it can be shown that the tensor modes actions are in agreement at second order, while eq.(\ref{Lheff}) is including also the effects of higher order interaction terms \cite{Gao:2012ib}, associated to self interaction and tensor scalar coupling.

\subsection{New predictions and applications}
In this section we consider some examples of application of the effective approach derived previously.

\subsubsection{Scalar tensor feedback and effective speeds}

As an example, let's consider the interaction term

\begin{equation}
b \,\mathcal{L}^{(3)}_{\R\R h}=b \, a^2  h_{ij}\partial^i\R \partial^j\R= b \, a^2  L^{(3)}_{\R\R h}=z^2 \frac{b}{\epsilon}\, \Big[h_+(\partial^{x}\R \partial^{x}\R - \partial^{y}\R \partial^{y}\R)+ 2 h_{\times}(\partial^{x}\R \partial^{y}\R)\Big]=z^2 \frac{b}{\epsilon} \Big[h_+ \pi_+ + h_{\times} \pi_{\times}\Big] \,
\end{equation}
which arises at cubic order in general relativity \cite{Maldacena:2002vr} and modified gravity theories \cite{Gao:2012ib}.
The Langrange equations give
\begin{eqnarray}
h_A''+2 \mathcal{H} h_A'+ \nabla^2 h_A&=&  \, a^2 \,b \, \pi_A = a^2 \Pi_A \,, \\
\R''+2  \frac{z'}{z} \R'-c^2_s \nabla^2 \R&=&  \,a^2 \, b \, h^{ij}\partial_i\partial_j \R=a^2 \mathcal{S}\,.
\end{eqnarray}
Contrary to the linear regime,  tensor and scalar modes are coupled, and it is necessary to solve a system coupled differential equations to compute the effects of the interactions.
Using the field equations approach the effective sound speed for scalar and tensor modes could be computed, or we could also use the effective Lagrangian approach.

Using the notation introduced in the previous sections we have
\begin{eqnarray}
\L_{\zeta}&=&\L^{(2)}_{\zeta}+\L^{int}_{\zeta}=z^2\Big[\zeta'^2- (\nabla \zeta)^2+\frac{b}{\epsilon}L^{(3)}_{\R\R h} \Big]\,,\\
\L_{h}&=&\L^{(2)}_{h}+\L^{int}_{h}=a^2\Big[h'^2- (\nabla h)^2+b \,L^{(3)}_{\R\R h} \Big] \,,
\end{eqnarray}
from which we obtain the SEGS and SESS
\begin{eqnarray}
c^2_{T,A}(\eta,x^i)&=&\Big(1+\frac{L_h^{int}}{h'^2_A}\Big)^{-1}=\Big(1+\frac{b \,L^{(3)}_{\R\R h}}{ \, h'^2_A}\Big)^{-1} \,,\\
c_s^2(\eta,x^i)&=&\Big(1+\frac{L_{\zeta}^{int}}{\zeta'^2}\Big)^{-1}=\Big(1+\frac{b \,L^{(3)}_{\R\R h}}{ \epsilon\zeta'^2}\Big)^{-1}  \,.
\end{eqnarray}
In terms of the SESS and SEGS, the system of coupled differential equations with source terms reduces to three independent equations, without sources
\begin{eqnarray}
h_A''+2 \frac{\alpha_A'}{\alpha_A} h'_A-c_{T,A}^2 \nabla^2 h_A&=&0  \quad,\quad \alpha_A=\frac{a^2}{c^2_{T,A}} \,,\\
\zeta''+2 \frac{\alpha'}{\alpha} \zeta'-c_s^2 \nabla^2 \zeta&=&0 \quad,\quad \alpha=\frac{\epsilon a^2}{c_s^2}=\frac{z^2}{c_s^2} \,.
\end{eqnarray}

Note that
\begin{equation}
\L_{\zeta}+\L_h+\L^{int}\neq \L^{eff}_{\zeta}+\L^{eff}_h \,
\end{equation}
because the interaction Lagrangian $\L^{int}$ enters in the definition of both effective speeds, analogously to the fact it produces  different source terms $\mathcal{S}_{\R}$ and $\Pi_A$ in the equations of motions.
The effects of the interaction induce a modification of both speeds, since the interaction produces a source term in both equations, while in the literature often only the effects on gravitational waves are considered, ignoring those on scalar perturbations, and their possible back-reaction on tensor modes.

\section{Change of frame and physical relevance of the effective Planck mass}
All the result derived in the previous sections were in the Einstein frame, both using the effective Lagrangian and the EST approach.

It can be convenient to find the conformal transformation taking to the Jordan frame, in which many other calculations have been performed, especially in the context of modified gravity \cite{Kobayashi:2011nu,DeFelice:2011bh}.
\subsection{Curvature and tensor perturbations}
Let's start by writing the scalar and tensor quadratic Lagrangians in the Jordan frame  \cite{Tsujikawa:2014uza}
\begin{eqnarray}
\L^J&=&a^2 q_s[\zeta'^2- c_s^2(\nabla \zeta)^2\Big]+ a^2 q_t\Big[h'^2- c^2_T(\nabla h)^2 \Big] \,, \label{eqJJ}
\end{eqnarray}
where we are denoting with  $E$ and $J$ quantities in the Jordan and Einstein frame.

The Lagrangian of perturbations in a new frame obtained via disformal transformation, such that $\tilde{a}=\Omega a$, is of the form \cite{Tsujikawa:2014uza}
\begin{equation}
\tilde{\L}^J=\tilde{a}^2 \tilde{q}_s[\tilde{\zeta}'^2- \tilde{c}_s^2(\nabla \tilde{\zeta})^2\Big]+ a^2 \tilde{q}_t\Big[\tilde{h}'^2- \tilde{c}^2_T(\nabla \tilde{h})^2 \Big] \,, \,
\end{equation}
where we are denoting with a tilde quantities in the new frame, and we are just defining the conformal part of the disformal transformation, because this is the one relevant for the coefficients of the Lagrangians for curvature and tensor modes.

Since scalar and tensor perturbations are invariant under disformal transformations \cite{Tsujikawa:2014uza}, i.e. $\tilde{\R}=\R,\tilde{h}=h$, and $\L=\tilde{\L}$ by definition, by comparing the coefficients \cite{Tsujikawa:2014uza} in $\L$ and $\tilde{\L}$ we obtain the following  transformations

\begin{equation}
\tilde{a}=\Omega a\quad \rightarrow \quad \tilde{q_s}=\Omega^{-2} q_s \,,\,\tilde{q_t}=\Omega^{-2} q_t \,,\, c_s=\tilde{c}_s \,,\, c_T=\tilde{c}_T \,, \label{LJOmega}
\end{equation}
Note that these relations are consistent, but different, from those derived in \cite{Tsujikawa:2014uza}, due to the use of conformal time.

The corresponding effective quadratic Lagrangian in the Einstein frame is
\begin{eqnarray}
\L^{eff}_E&=&\tilde{\epsilon} \tilde{a}^2 \frac{1}{c^2_s}\Big[\zeta'^2- c_s^2(\nabla \zeta)^2\Big]+ \tilde{a}^2 \frac{1}{c^2_T}\Big[h'^2- c^2_T (\nabla h)^2 \Big]=\L^{eff}_{\zeta}+\L^{eff}_h \,,\label{LEhzeta}
\end{eqnarray}
where we are using the conformal invariance of $c_s,c_T,\R,h$, and we are denoting with $\tilde{\epsilon}$ the slow roll parameter in the Einstein frame, to distinguish it  from that in the Jordan frame. We use this notation only in this section, for consistency with the notation for conformal transformation  starting from the Jordan, while in other sections $\epsilon$ denotes the slow-roll parameter in the Einstein frame. Note that the Lagrangian above is consistent with the scalar perturbations action for  $K-$inflation in the Einstein frame \cite{Garriga:1999vw}, and with the tensor action in the effective field theory of inflation  \cite{Creminelli:2014wna}.
By comparing eq.(\ref{LEhzeta}) and eq.(\ref{LJOmega}) we find that the Einstein frame and Jordan frame are related by
\begin{eqnarray}
\tilde{q}_t&=&\frac{1}{c^2_T} \,, \\
\tilde{q}_s&=&\frac{\tilde{\epsilon}}{c^2_s} \,.
\end{eqnarray}
which imply
\begin{eqnarray}
\Omega&=&c_T\sqrt{q_t} \,,\\
\tilde{\epsilon}&=&\frac{q_s c^2_s}{q_t c^2_T} \,, \label{JET}
\end{eqnarray}
in agreement with \cite{Romano:2022jeh}.

The parameter $q_t$ is sometimes denoted at $M^2_*$, and interpreted as effective Planck mass \cite{Lagos:2019kds}.
The above equations show that in the Einstein frame the effective Planck mass is not independent from $c_T$, since  $\sqrt{\tilde{q}_t}=\tilde{M}_*=M_* \Omega^{-1}=1/c_T$, and its effects on scalar perturbations are encoded in Einstein frame slow-roll parameter $\tilde{\epsilon}$.

This is not surprising, since in the Einstein frame the only physically relevant quantities are $c_s,c_T,\tilde{\epsilon}$, i.e. the so called Jordan frame effective Planck mass $M_*$ emerges only in the definition of the conformal transformation taking to the Jordan frame, and as such does not really play any physical role, due to the invariance of scalar and tensor perturbations under disformal transformation \cite{Tsujikawa:2014uza}.

As explained earlier, the time dependency of the $c_s(\eta)$ and $c_T(\eta)$ is related to self interactions terms of the form $(1/c^2_s(\eta)-1)\R'^2$ and \cite{Creminelli:2014wna} $h'^2(1/c^2_T(\eta)-1)$, but in this case, since $\R$ and $h$ are not coupled to each other, but only self-coupled, we have
\begin{eqnarray}
\L^E=\L^E_{\zeta}+\L^E_h+\L^E_{int}=\tilde{\epsilon} \tilde{a}^2 \Big[\zeta'^2- (\nabla \zeta)^2\Big]&+& \tilde{a}^2 \Big[h'^2-  (\nabla h)^2 \Big]+\L_h^{int}+\L_{\R}^{int}=\L^{eff}_{\zeta}+\L^{eff}_h   \nonumber\,,\\
\L_h^{int}=\tilde{a}^2 h'^2\Big[\frac{1}{c^2_T(\eta)}-1\Big] &,& \L_{\R}^{int}=\tilde{\epsilon}\tilde{a}^2 \Big[\frac{1}{c^2_s(\eta)}-1\Big]\R'^2
\end{eqnarray}
which was used to find the relation between the quantities in different from
\begin{eqnarray}
\L^J=\L^E&=&\L^{eff}_{\zeta}+\L^{eff}_h\,.
\end{eqnarray}
The first equality in the above equation just comes from the fact that Lagrangian densities in different frames are equal, because they are obtained by simply re-writing the same object in different ways.

The conformal transformation defined in eq.(\ref{JET}) can also be applied to the Lagrangians including higher order interactions terms \cite{Romano:2022jeh}, and is consistent with the invariance of the coefficients of the perturbations equations expected from the invariance of $\R,h$, i.e. the invariance of the solutions implies  the invariance of the equations and of the Lagrangians. In other words the equations and Lagrangians in the Jordan frame look different because of the conformal transformation, but the coefficients of the equations and of the Lagrangians as functions of space and time are the same, just written in a different way in terms of $\Omega$. In the Einstein frame the real number of independent degrees of freedom is more transparent.

Note we are assuming that the coupling to gravity is properly transformed from one frame to the other.
This implies that theories in which matter fields are minimally coupled to gravity by the metric in the Einstein vs Jordan frame are different, i.e. they have different Lagrangians, which cannot be  simply related by a conformal transformation.
\subsection{Effective gravitational coupling}

The perturbed Einstein equations give the useful equation
\begin{eqnarray}
\frac{k^2}{\tilde{a}^2} \tilde{\psi}_B=\frac{1}{2} \delta \tilde{\rho}_c \label{PoissonE}
\end{eqnarray}
where $\tilde{\psi}_B$ is one of the Bardeen potentials,  and $\tilde{\delta} \rho_c$ is the comoving energy density perturbation \cite{Kodama:1985bj}, and the tilde denotes quantities in the Einstein frame.
The above equation is also valid for a modified gravity theory, once it has been transformed to the Einstein frame, in which the full Lagrangian takes the Hilbert form
\begin{eqnarray}
\tilde{\L}=\sqrt{-\tilde{g}}\mathcal{\tilde{R}}+\tilde{\L}_{tot}&=&\sqrt{-\tilde{g}}\mathcal{\tilde{R}}+\tilde{\L}_m+\tilde{\L}_{\phi}+\tilde{\L}_{m \phi} \,, \\
\frac{k^2}{\tilde{a}^2} \tilde{\psi}_B=\frac{1}{2} \delta \tilde{\rho}^{tot}_c &,& \delta \tilde{\rho}^{tot}_c= \delta \tilde{\rho}^{m}_c+\delta \tilde{\rho}^{\phi}_c+\delta \tilde{\rho}^{m \phi}_c \,, \label{PoissonTot}
\end{eqnarray}
where $\tilde{\L}_{tot}$ contains terms associated to matter and the modification of gravity in a single object, and $\tilde{\L}_{\phi},\tilde{\L}_m,\tilde{\L}_{m \phi}$ are respectively the Einstein frame Lagrangians related to the gravity modification, matter, and the non minimal coupling of gravity to matter, and a similar notation is adopted for the comoving energy density.

In the Jordan frame the Poisson equation takes the form \cite{DeFelice:2011hq}.
\begin{eqnarray}
\frac{k^2}{a^2} \psi_B=\frac{1}{2} G_J \delta \rho_c \label{PoissonJ}
\end{eqnarray}
The difference  between the gravitational couplings in the two frames is expected, since in in our units in  the Einstein frame we have by definition $8 \pi G^{tot}_E=1$, and the effects of the modification of gravity are encoded in the total effective energy density $\delta \tilde{\rho}^{tot}_c$, which includes contributions from $\tilde{\L}_{\phi},\tilde{\L}_m,\tilde{\L}_{m \phi}$, not just from $\tilde{\L}_m$.
The relation between the gravitational coupling $G^{m}_E$ for matter comoving energy density $\delta \tilde{\rho}_c^{m}$ will be investigated in more details in a future work, but we can anticipate that by appropriately manipulating eq.(\ref{PoissonTot}) we can write an equation of the form

\begin{eqnarray}
\frac{k^2}{\tilde{a}^2} \tilde{\psi}_B=\frac{1}{2} G^{m}_E \delta \tilde{\rho}^{m}_c \label{PoissonEm} \,.
\end{eqnarray}

Note that, contrary to curvature and tensor perturbations, the Bardeen potential and the comoving density perturbations are not invariant under disformal transformations \cite{Ghosh:2022ppn}, and for this reason we use a tilde to distinguish between them.

\section{Relation to other effective approaches}
The effective approach  formulated in this paper is completely general, and as such includes all the effects of interaction at any order in a single effective quantity, and for an arbitrary number fields.
We can compare this with previous results to see how it includes and extend them.

\subsection{Effective field theory of inflation}

The effective approach we have derived can describe the evolution of curvature  not only for single field models, but also for multi-fields models \cite{Romano:2020oov}, while in the  EFT of inflation \cite{Cheung:2007st} approach it is assumed only one scalar degree of freedom, i.e. entropy perturbations are ignored, and no general effective action  for curvature perturbations is derived for multi-fields systems \cite{Senatore:2010wk}.
The MESS approach  allows to compute the effects of entropy and anisotropy on curvature perturbations for a generic system, including any number of fields, and predicts naturally the momentum dependence of the effective sound speed of curvature perturbations.

\subsection{Effective field theory of dark energy}

The effective field theory of dark energy \cite{Gubitosi:2012hu} applies the same symmetry breaking idea of the EFT of inflation to dark energy, but in the Jordan frame.
The action is expanded to quadratic order, and for this reason is missing the frequency and polarization dependence of the effective speed which arises naturally in  the MESS and SEGS approach, due to the higher order interactions terms.
The general relation between Jordan and Einstein frame was derived in the previous section.

\section{Quantum field theory implications}
The effective Lagrangians we have derived are based on classical calculations, but  they can  be related \cite{Bonifacio:2022vwa} to  the wavefunction of the scalar and tensor fields by the path integral

\begin{equation}
\Psi[\varphi] \ =  \hspace{-0.4cm} \int\limits_{\substack{\phi(t) \,=\,\varphi\\ \hspace{-0.45cm}\phi(-\infty)\,=\,0}}
\hspace{-0.5cm} \raisebox{-.05cm}{ ${\cal D} \phi\, e^{iS[\phi]}\,.$ }
\end{equation}
where $\phi$ is a generic field, which in our case could be $\R$ or $h$, and $S$ denotes the action.
At tree level the path integral can be approximated by the action evaluated on the classical solution, which is the way in which we define the effective Lagrangian.

From the wavefunction we can  compute the equal-time correlators as
\begin{equation}
\langle\phi_1 \cdots \phi_N\rangle = \int{\cal D}\phi\, \phi_1\cdots\phi_N\left\lvert\Psi[\phi]\right\rvert^2\,.
\end{equation}
The above method should give the same result obtained by using canonical quantization in the  in-in formalism \cite{Maldacena:2002vr}.
Following this method we can for example compute corrections to the spectrum, arising from higher order interaction terms in the Lagrangian, in terms of the effective speed we have defined previously. More details about this approach will be given in a separate work.

\section{Conclusions}

We have derived a set of universal model  independent effective equations and Lagrangians which can describe the evolution of scalar and tensor perturbation of any system whose field equations can be written in an Einstein like form. This includes for example multi-fields systems, or modified gravity, once they have been transformed to the Einstein frame.
Given the generality of this effective description it is particularly suitable for model independent phenomenological analysis of observational data.

This approach predicts naturally that the speed of gravitational waves con depend on  frequency and polarization, due to the interactions of the graviton with itself or other fields.
This prediction allows to use gravitational waves observations to investigate the elusive nature of dark matter and dark energy.

The equation and Lagrangian for scalar and tensor perturbations has the same universal structure, and the effects of the interaction can be modeled at any order in perturbations by a single effective quantity, playing the role of effective propagation speed. This is particularly useful since it allows to compare different models in terms of the two quantities $c_s$ and $c_T$.
Combining different set of observational data such as cosmic microwave background radiation and gravitational waves, it will be possible to constrain the $c_s$ and $c_{T,A}$, to determine possible deviations from general relativity and vanilla inflation. If a deviation is found, the theoretical research can be focused on those models able to predict the $c_s$ and $c_T$ supported by observations.

In order to test specific models it will be important to perform higher order perturbations calculations for different models, in order to compute the effects which are not included in the quadratic action, and in the EST approach are treated as effective model independent phenomenological quantities.

\begin{acknowledgments}
I thank Misao Sasaki, Tessa Baker, Sergio Vallejo, Riccardo Sturani, Rogerio Rosenfeld, Nicola Tamanini and Suvodip Mukherjee  for interesting discussions. I thank the ICTP-SAIFR for the kind hospitality during the preparation of this paper.
\end{acknowledgments}


\section{Introduction}

Representing the meanings of words using low-dimensional vector embeddings has become a standard technique in NLP.
\emph{Static word embeddings}~\cite{mikolov2013distributed,pennington2014glove} represent words at the \emph{form} level by assigning a single vector for all occurrences of a word irrespective of its \emph{senses}.
However, representing ambiguous words such as \emph{bass}, which could mean either a \emph{musical instrument} or a type of \emph{fish}, using a single embedding is problematic.

To address this problem, \emph{sense-specific static word embedding} methods~\cite{reisinger2010multi,neelakantan2014efficient,huang2012improving} assign multiple embeddings to a single polysemous word corresponding to its multiple senses.
However, these embeddings are context-insensitive and we must resort to different heuristics such as selecting the sense embedding of the ambiguous word that is most similar to the context, to determine which embedding should be selected to represent the word.

\begin{figure}[t]
\centering
\includegraphics[width=0.5\textwidth]{outline.png}
\caption{Outline of CDES. Given a sense-tagged sentence $t$, we compute a sense embedding for the ambiguous word \emph{bank} by multiplying its static word embedding, $\vec{g}(\textit{bank})$, by a sense-specific projection matrix, $\mat{A}_{\textit{bank\%00}}$, corresponding to the correct sense of the word. Projection matrices are learnt by minimising the squared $\ell_2$ loss between the linearly transformed (via a matrix $\mat{W}$) contextualised embedding, $\vec{c}(t, \textit{bank})$, and of the (nonlinearly transformed via function $f$) sense embedding of \emph{bank}.}
\label{fig:outline}
\end{figure}

On the other hand, \emph{contextualised word embeddings} generated from NLMs~\cite{Elmo,devlin2019bert,liu2019roberta} represent a word in a given context by an embedding that considers both the meaning of the word itself as well as its context.
Different types of information such as word sense, dependency, and numeracy have shown to be encoded in contextualised word embeddings, providing rich, context-sensitive input representations for numerous downstream NLP applications.
More recently, \newcite{loureiro2019language} and \newcite{scarlini2020sensembert} showed that contextualised embeddings such as BERT~\cite{devlin2019bert} and ELMo~\cite{Elmo} can be used to create sense embeddings by means of external semantic networks, such as WordNet~\cite{miller1998wordnet} and BabelNet~\cite{navigli2010babelnet}.
Moreover, \newcite{levine-etal-2020-sensebert} showed that BERT can be fine-tuned using WordNet's supersenses to learn contextualised sense embeddings.

Inspired by these prior successes, we ask and affirmatively answer the question -- \emph{can we extract sense-related information from contextualised word embeddings to create sense-specific versions of (pretrained) sense-agnostic static embeddings?}
To this end, we propose, Context Derived Embeddings of Senses (\textbf{CDES})
a method to extract sense-related information encoded in contextualised word embeddings and inject it into pretrained sense-agnostic static word embeddings to create sense-specific static embeddings.
Given a contextualised embedding, a static word embedding and a sense-annotated corpus, CDES learns sense-specific projection matrices that can be used to predict the sense embeddings of words from their word embeddings.
Following the distributional hypothesis~\cite{DS}, we require that the predicted sense embedding of a word must align (possibly nonlinearly) with the meaning of the context of the word, represented using a contextualised embedding as outlined in Figure~\ref{fig:outline}.

At a more conceptual level, CDES can be seen as using contextualised language models as a proxy for extracting information relevant to a particular task, without learning it directly from text corpora.
In particular, prior work probing language models has shown that rich information about languages is compactly and accurately encoded within contextualised representations produced by NLMs~\cite{klafka-ettinger-2020-spying}.
Moreover, CDES can also be seen as an instance of \emph{model distillation}~\cite{Furlanello:2018aa}, where a complex teacher model (i.e. a contextualsied word embedding) is used to train a simpler student model (i.e. a sense-sensitive static embedding).

There are several advantages in CDES for learning sense-specific static embeddings.
CDES is computationally relatively lightweight because it uses \emph{pretrained} static embeddings as well as contextualised embeddings from a \emph{pretrained} NLM and does not require training these resources from scratch.
CDES static sense embeddings can be precomputed because of their independence on the context.
Therefore, CDES embeddings are attractive to NLP applications that must run on limited hardware resources.
Because subtokenisation methods, such as Byte Pair Encoding (BPE), must be used to limit the vocabulary sizes, one must post-process subtoken embeddings (e.g. by mean pooling) to create word embeddings with contextualised embeddings, whereas static embeddings can directly learn word embeddings.
To increase the coverage of sense embeddings, in addition to the sense related information extracted from contextualised embeddings, CDES incorporates contextual information from external corpora and knowledge bases.

We evaluate CDES on Word Sense Disambiguation~\cite[WSD]{navigli2009word} (Section~\ref{sec:WSD}) and Words in Context~\cite[WiC]{Pilehvar:2019} (Section~\ref{sec:wic}) tasks.
In both tasks, CDES learns accurate sense embeddings and outperforms many existing static sense embeddings.
In particular, on the WSD framework~\cite{raganato2017word}, CDES reports the best performance in 4 out of 6 benchmarks,
and on WiC reports competitive results to the current state-of-the-art without any fine-tuning of on task data.

\section{Context-Derived Embedding of Senses}
\label{sec:method}

Given (a) pretrained static word embeddings, (b) contextualised word embeddings from a pretrained NLM, and (c) a sense-annotated corpus, CDES  learns a sense-specific version of (a), representing each sense of a word by a different vector.
To describe CDES in detail, let us denote the sense-agnostic static embedding of a word  $u \in \cV$ in a vocabulary $\cV$, by $\vec{g}(u) \in \R^{p}$.
Moreover, let us denote the contextualised embedding model $c$, from which we can obtain a context-sensitive representation $\vec{c}(u, t) \in \R^{q}$ corresponding to $u$ in some context $t \in \cC(u)$.
Here, $\cC(u)$ is the set of contexts in which $u$ occurs.
An ambiguous word $u$ is likely to take different senses in different contexts $t$, and our goal is to learn a sense-specific embedding of $u$ that captures the different senses of $u$.

Let us denote by $\cS$ the set of word senses taken by all words in $\cV$.
An ambiguous word $u$ will belong to a subset $\cS(u)$ of senses in $\cS$.
Let us denote the sense-specific embedding of $u$ corresponding to the $i$-th sense $s_{i} \in \cS(u)$ by $\vec{s}_{i}(u) \in \R^{p}$.
We model the process of creating sense-specific embeddings from static embeddings as a projection learning task, where we multiply the static embedding, $\vec{g}(u)$, by a sense-specific projection matrix, $\mat{A}_{i}$, to produce $\vec{s}_{i}(u)$ as in \eqref{eq:proj}.
\begin{align}
 \label{eq:proj}
 \vec{s}_{i}(u) = \mat{A}_{i} \vec{g}(u)
\end{align}
Here, \eqref{eq:proj} decouples a sense embedding into a sense-agnostic static lexical semantic component given by $\vec{g}(u)$ and
a word-independent sense-specific component $\mat{A}_{i}$, enabling efficient sense-specific embedding learning using pretrained embeddings.
The projection matrices can be seen as linear operators that produce different sense-specific embeddings from the same static word (lemma) embedding, corresponding to the different senses of the lemma.

On the other hand $\vec{c}(u,t)$ encodes both sense related information for $u$ as well as information not related to $u$ such as the grammatical gender or number in the context $t$.
Therefore, we apply a linear filter parameterised by a matrix $\mat{W} \in \R^{q \times p}$, to extract sense related information from $\vec{c}(u,t)$.

Given a sense tagged corpus, we jointly learn $\mat{W}$ and $\mat{A}_{i}$s by minimising the objective given by \eqref{eq:loss}.
\par\nobreak
{\small
\begin{align}
\label{eq:loss}

L(\mat{W}, \{\mat{A}_i\}_{i=1}^{|\cS|}) =  \sum_{\substack{u \in \cV \\  t \in \cC(u) \\ s_i \in \cS(u)}} \norm{\mat{W} \vec{c}(u,t) - f(\mat{A}_i\vec{g}(u))}_2^2
\end{align}
}%

Here, $f$ is an elementwise nonlinear function that enables us to consider nonlinear associations between contextualised and static word embeddings.
In our experiments, we consider linear, ReLU and GELU activations as $f$.
After training, we can compute the sense embeddings $\vec{s}_{i}(u)$ using \eqref{eq:proj} with the pretrained static word embeddings $\vec{g}(u)$.

Eq.~\eqref{eq:loss} can be seen as aligning the contextualised and static word embeddings under a nonlinear transformation.
The only learnable parameters in our proposed method are $\mat{W}$ and sense-specific projections $\mat{A}_{1}, \ldots, \mat{A}_{|\cS|}$.
In particular, we \emph{do not} require re-training or fine-tuning static or contextualised embeddings
and can be seen as a post-processing method applied to pretrained embeddings, similar to retrofitting~\cite{shi-etal-2019-retrofitting}.
We limit the sense-specific projection matrices to diagonal matrices in our experiments because in our preliminary investigations we did not find any significant advantage in using full matrices compared to the extra storage.
Moreover, a diagonal matrix can be compactly represented by storing only its diagonal elements as a vector, which reduces the number of parameters to learn (thus less likely to overfit) and speeds up matrix-vector multiplications.

\subsection{Context Aggregation}
\label{sec:context}
An important limitation of the above-mentioned setting is that it requires sense-annotated corpora.
Manually annotating word senses in large text corpora is expensive and time consuming.
Moreover, such resources might not be available for low resource languages.
Even if such sense-annotated corpora are available for a particular language, they might not cover all different senses of all of the words in that language, resulting in an inadequate sense coverage.
For example, SemCor~\cite{SemCor}, one of the largest manually-annotated corpora for English word senses including more than 220K words tagged with 25K distinct WordNet meanings, covers only 15\% of all synsets in the WordNet.
To address this sense-coverage problem, we follow prior proposals~\cite{scarlini2020more} to extract additional contexts for a word from (a) \textbf{the dictionary definitions of synsets}, and (b) \textbf{an external corpus}.

\paragraph{Gloss-based Sense Embeddings:}
To create sense embeddings from dictionary definitions, we use the glosses of synsets in the WordNet.
Given a word $u$, we create a gloss-based sense embedding, $\vec{\psi}(u)_i \in \R^q$, represented by the sentence embedding, $\vec{c}(t_i)$, computed from the gloss $t_i$ corresponding to the synset $s_i$ of $u$.
Here, $\vec{c}(t_i)$ is computed by averaging the contextualised embeddings for the tokens in the gloss $t_i$ as given in \eqref{eq:context}.
\begin{align}
    \label{eq:context}
    \vec{c}(t_i) = \avg_{w \in t_i}\vec{c}(w,t_i)
\end{align}
Here, $\mathrm{avg}$ denotes mean pooling over the tokens $w$ in $t_i$.
Following \newcite{loureiro2019language} and \newcite{scarlini2020more}, in our experiments, we use BERT as the contextualised embedding model and use the sum of the final four layers as token embeddings.

\paragraph{Corpus-based Sense Embeddings:}
To extract contexts from an external corpus for given a word $u$, we retrieve all sentences as contexts $t \in \cC(u)$ from the corpus where $u$ occurs.
We then cluster the extracted sentences (represented by the sentence embeddings computed using \eqref{eq:context}) using the $k$-means algorithm.
We assume each cluster to contain similar sentences and that $u$ will be used in the same sense in all sentences in a cluster.
We use UKB\footnote{\url{http://ixa2.si.ehu.eus/ukb/}}~\cite{agirre-etal-2014-random}, a knowledge-based approach to WSD that uses the Personalised PageRank algorithm~\cite{Haveliwala_2002}, to disambiguate the clusters.

To increase the coverage of senses represented by the clusters, we consider collocations of $u$ available in SyntagNet~\cite{maru-etal-2019-syntagnet}\footnote{\url{http://syntagnet.org/}} following \newcite{scarlini2020more}.
Specifically, for each word $u$, we find words $v$ that forms a collocation with $u$ in SyntagNet, and extract sentences $t$ that contain both $u$ and $v$ within a co-occurrence window.
The synset id $s_i$ assigned to the $(u,v)$ pair in SyntagNet is used as the sense id for all extracted sentences for $u$.
Finally, we compute a corpus-based sense embedding $\vec{\phi}_i(u) \in \R^q$ as the cluster centroid, where sentence embeddings are computed using \eqref{eq:context}.

\subsection{Sense Embedding and Disambiguation}
\label{sec:sense}

The final CDES static sense embedding, $\mathbf{cdes}_i(u) \in \R^{p+2q}$ of the $i$-th sense of $u$ is computed as the concatenation of
$\vec{s}_i(u)$ (given by \eqref{eq:proj}), gloss-based sense embedding $\vec{\psi}_i(u)$ and corpus-based sense embedding $\vec{\phi}_i(u)$ as given by \eqref{eq:cdes}, where $\oplus$ denotes vector concatenation.
\begin{align}
    \label{eq:cdes}
    \mathbf{cdes}_i(u) = \vec{s}_i(u) \oplus \vec{\psi}_i(u) \oplus \vec{\phi}_i(u)
\end{align}

In order to disambiguate a word $u$ in a given context $t'$, we first compute a contextualised embedding $\vec{\zeta}(u,t') \in \R^{p+2q}$ by concatenating three vectors as give by \eqref{eq:wsd}
\begin{align}
    \label{eq:wsd}
    \vec{\zeta}(u,t') = \vec{g}(u) \oplus \vec{c}(u,t') \oplus \vec{c}(u,t')
\end{align}
We then compute the cosine similarity between $\vec{\zeta}(u,t')$ and $\mathbf{cdes}_i(u)$ for each sense $s_i$ of $u$.
We limit the candidate senses based on the lemma and part-of-speech of $u$ in $t'$, and select the most similar (1-NN) sense of $u$ as its disambiguated sense in context $t'$.

\section{Experiments}

\subsection{Experimental Setup}

In our experiments, we use the pretained GloVe\footnote{\url{nlp.stanford.edu/projects/glove/}} embeddings (Common Crawl with 840B tokens and 2.2M vocabulary) as the static word embeddings $\vec{g}(u)$ with $p = 300$.
We use pretrained BERT (\texttt{large-bert-cased}\footnote{\url{https://bit.ly/33Nsmou}}) as the contextualised embedding model, $\vec{c}(u,t)$ with $q = 1024$.
Following prior work~\cite{luo2018leveraging,luo2018incorporating,loureiro2019language,scarlini2020more}, we use sense annotations from SemCor $3.0$~\cite{SemCor} as the sense-tagged corpus, which is the largest corpus annotated with WordNet sense ids.
As the external corpus for extracting contexts as described in Section~\ref{sec:context}, we use the English Wikpedia.
The number of clusters in $k$-means is set to the number of distinct senses for the lexeme according to the WordNet.
The number of words given to UKB is set to 5 and the number of sentences extracted from Wikipedia per lemma is set to 150 following \newcite{scarlini2020more}.
The co-occurrence window size for considering collocations extracted from SyntagNet is set to 3 according to \newcite{maru-etal-2019-syntagnet}.
We evaluate the learnt sense embeddings in two downstream tasks: WSD (Section~\ref{sec:WSD}) and WiC (Section~\ref{sec:wic}).
The statistics of SemCor, all-words English WSD and WiC datasets are showed in Table~\ref{tbl:statistics}.

\begin{table}[t]
\centering
\resizebox{0.48\textwidth}{!}{
\begin{tabular}{lccccc}
\toprule
Dataset &Total &Nouns &Vebs &Adj &Adv \\
\midrule
SemCor &226,036 &87,002 &88,334 &31,753 &18,947 \\
\midrule
\textbf{WSD}& & & & & \\
SE2 &2,282 &1,066 &517 &445 &254 \\
SE3 &1,850 &900 &588 &350 &12 \\
SE07 &455 &159 &296 &- &- \\
SE13 &1,644 &1,644 &- &- &- \\
SE15 &1,022 &531 &251 &160 &80 \\
ALL &7,253 &4,300 &1,652 &955 &346 \\
\midrule
\midrule
\textbf{WiC} &Instances &Nouns &Vebs &\multicolumn{2}{c}{Unique Words} \\
\midrule
Training &5,428 &2,660 &2,768 &\multicolumn{2}{c}{1,256} \\
Dev &638 &396 &242 &\multicolumn{2}{c}{599} \\
Test &1,400 &826 &574 &\multicolumn{2}{c}{1,184} \\
\bottomrule
\end{tabular}}
    \caption{The statistics of the training and evaluation datasets. SemCor  is used for training. SemEval (SE07, SE13, SE15) and Senseval (SE2, SE3) datasets are used for the WSD task, whereas the WiC dataset is used for sense discrimination task.}
\label{tbl:statistics}
\vspace{-5mm}
\end{table}

To project contextualised and static word embeddings to a common space, we set $\mat{W} \in \R^{300 \times 1024}$.
To reduce the memory footprint, number of trainable parameters and thereby overfitting, we constrain the sense-specific matrices $\mat{A}_i \in \R^{300 \times 300}$ to be diagonal.
We initialise all elements of $\mat{W}$ and $\mat{A}_i$s uniformly at random in $[0,1]$.
We use Adam as the SGD optimiser and set the minibatch size to $64$ with an initial learning rate of 1E-4.
All hyperparameter values were tuned using a randomly selected subset of training data set aside as a validation dataset.
The t-SNE visualisations in the paper are produced with \texttt{sklearn.manifold.TSNE} using n\_components=2, init=\emph{pca}, perplexity=3, n\_iter=1500 and metric=\emph{cosine}.

All experiments were conducted on a machine with a single Titan V GPU (12 GB RAM), Intel Xeon 2.60 GHz CPU (16 cores) and 64 GB of RAM.
Overall, training time is less than 3 days on this machine,

\subsection{Word Sense Disambiguation (WSD)}
\label{sec:WSD}

WSD is a fundamental task in NLP, which aims to identify the exact sense of an ambiguous word in a given context~\cite{navigli2009word}.
To evaluate the proposed sense embeddings, we conduct a WSD task using the evaluation framework proposed by~\newcite{raganato2017word}, which includes all-words English WSD datasets: Senseval-2 (SE2), Senseval-3 task 1 (SE3), SemEval-07 task 17 (SE07), SemEval-13 task 12 (SE13) and SemEval-15 task 13 (SE15).
We used the framework's official scoring scripts to avoid any discrepancies in the scoring methodology.
As described in Section~\ref{sec:sense}, the sense of a word in a context is predicted by the 1-NN method.

Table~\ref{tbl:wsd} shows the WSD results.
Most Frequent Sense (MFS) baseline selects the most frequent sense of a word in the training corpus and has proven to be a strong baseline~\cite{McCarthy:2007}.
\newcite{scarlini2020more} use \newcite{Elmo}'s method with BERT on SemCor+OMSTI~\cite{taghipour2015one} to propose SemCor+OMSTI$_{BERT}$ baseline.
ELMo $k$-NN uses ELMo embeddings to predict the sense of a word following the nearest neighbour strategy.
Specifically, they first obtain ELMo embeddings for all words in SemCor sentences, and average the embeddings for each sense.
At test time, they run ELMo on the given test sentence containing the ambiguous word and select the sense with the highest cosine similarity.
\newcite{loureiro2019language} repeated this method using BERT~\cite{devlin2019bert} embeddings to propose the BERT $k$-NN baseline.
EWISE$_{ConvE}$~\cite{kumar2019zero} learns a sentence encoder for sense definition by using WordNet relations as well as ConvE~\cite{dettmers2018convolutional}.
\newcite{scarlini2020more} report the performance of using BERT base-multilingual-cased (mBERT) instead of BERT large with MFS fallback.
\newcite{hadiwinoto2019improved} integrating pretrained BERT model with gated linear unit (GLU) and layer weighted (LW).

GlossBERT~\cite{huang2019glossbert} fine tunes the pretrained BERT model by jointly encoding contexts and glosses.
LMMS~\cite{loureiro2019language} learns sense embeddings using BERT to generate contextualised embeddings from semantic networks and sense definitions.
To perform WSD, they use the $1$-NN method and compare sense embeddings against contextualised embeddings generated by BERT.
\newcite{scarlini2020more} augment UKB with SyntagNet’s relations~\cite{scozzafava2020personalized} and obtain UKB$_{+Syn}$.
SensEmBERT is a knowledge-based approach, which produces sense embeddings by means of BabelNet and Wikipedia.
Although SensEmBERT is effective in modelling nominal meanings, it only consists of nouns due to the limitation of its underlying resources.
SensEmBERT$_{sup}$ is the supervised version of SensEmBERT.
ARES~\cite{scarlini2020more} is a semi-supervised approach for learning sense embeddings by incorporating sense annotated datasets, unlabelled corpora and knowledge bases.

\begin{table}[t]
\centering
\resizebox{0.5\textwidth}{!}{
\begin{tabular}{lcccccc}
\toprule
Models &SE2 &SE3 &SE07 &SE13 &SE15 &ALL \\
\midrule
MFS &65.6 &66.0 &54.5 &63.8 &67.1 &65.6\\
SemCor+OMSTI$_{BERT}$ &74.0 &70.6 &63.1 &72.4 &75.0 &72.2\\
ELMo $k$-NN &71.5 &67.5 &57.1 &65.3 &69.9 &67.9\\
BERT $k$-NN &76.3 &73.2 &66.2 &71.7 &74.1 &73.5\\
EWISE$_{ConvE}$ &73.8 &71.1 &67.3 &69.4 &74.5 &71.8\\
mBERT $k$-NN + MFS &72.7 &70.1 &62.4 &69.0 &72.0 &70.5\\
BERT$_{GLU+LW}$ &75.5 &73.4 &68.5 &71.0 &76.2 &74.0\\
GlossBERT &77.7 &75.2 &\pmb{76.1} &72.5 &80.4 &77.0 \\
LMMS &76.3 &75.6 &68.1 & 75.1 &77.0 &75.4\\
UKB$_{+Syn}$ &71.2 &71.6 &59.6 &72.4 &75.6 &71.5\\
SensEmBERT &70.8 &65.4 &58.0 &74.8 &75.0 &70.1 \\
SenseEmBERT$_{sup}$ &72.2 &69.9 &60.2 &\pmb{78.7} &75.0 &72.8\\
ARES & 78.0 &\underline{77.1} &71.0 &77.3 &\pmb{83.2} &77.9 \\
\midrule
\textit{Proposed Method} \\
CDES$_{linear}$ &\pmb{78.4} & 76.9 &71.0 &77.6 & \underline{83.1} &\underline{78.0}\\
CDES$_{ReLU}$ &\underline{78.1} &\underline{77.1} &71.0 &77.5 &\underline{83.1} &\underline{78.0} \\
CDES$_{GELU}$ &\underline{78.1} &\pmb{77.3} &\underline{71.4} &\underline{77.7} &\pmb{83.2} &\pmb{78.1} \\
\bottomrule
\end{tabular}
}
\caption{F1 scores (\%) for English all-words WSD on the test sets of \protect\newcite{raganato2017word}. Bold and underline indicate the best and the second best results, respectively.}
\label{tbl:wsd}
\end{table}

To study the effect of using a nonlinear mapping $f$ between static and contextualised embedding spaces in \eqref{eq:loss}, we train CDES with linear, ReLU and GELU activations to create respectively CDES$_{linear}$, CDES$_{ReLU}$ and CDES$_{GELU}$ versions.
From Table~\ref{tbl:wsd} we see that among these versions, CDES$_{GELU}$ outperforms the linear and ReLU versions in all datasets, except on SE2 where CDES$_{linear}$ performs best.
This result shows that nonlinear mapping (GELU) to be more appropriate for extracting sense-related information from contextualised embeddings.
Moreover, we see that CDES versions consistently outperform all previously proposed sense embeddings, except on SE07 and SE13 where GlossBERT and SenseBERT$_{sup}$ performs best respectively.
On SE15, the performance of CDES$_{GELU}$ is equal to that of ARES.

Overall, CDES$_{linear}$ obtains the best performance on SE2, while CDES$_{GELU}$ performs best on SE3, SE15 and ALL.
This result provides empirical support to our working hypothesis that contextualised embeddings produced by NLMs encode much more information beyond sense related information, which must be filtered out using $\mat{W}$.
CDES is able to accurately extract the sense-specific information from contextualised embeddings generated by a pretrained NLM to create sense-specific versions of pretrained sense-agnostic static embeddings.

\subsection{Words in Context (WiC)}
\label{sec:wic}

\newcite{Pilehvar:2019} introduced the WiC dataset for evaluating sense embedding methods.
For a particular word $u$, WiC contains pairs of sentences, ($t_{1}$, $t_{2}$) where the same (\emph{positive}) or different (\emph{negative}) senses of $u$ can occur.
An accurate sense embedding method must be able to discriminate the different senses of an ambiguous word.
The problem is formalised as a binary classification task and classification accuracy is reported as the evaluation metric.
A method that assigns the same vector to all of the senses of a word would report a chance-level (i.e. $50\%$) accuracy on WiC.

Similar to Section~\ref{sec:WSD}, we first determine the sense-specific embeddings of $u$, $\vec{s}_{i}(u)$ and $\vec{s}_{j}(u)$ for the senses of $u$ used in respectively $t_{1}$ and $t_{2}$.
We then train a binary logistic regression classifier using the train split of WiC, where we use the cosine similarities between the two vectors in the following six pairs as features, comparing sense and contextualised embeddings in the two sentences.: ($\vec{s}_{i}(u)$, $\vec{s}_{j}(u)$), ($\vec{\zeta}(u,t_{1})$, $\vec{\zeta}(u,t_{2})$), ($\vec{s}_{i}(u)$, $\vec{\zeta}(u,t_{1})$), ($\vec{s}_{j}(u)$, $\vec{\zeta}(u,t_{2})$), ($\vec{s}_{i}(u)$, $\vec{\zeta}(u,t_{2})$) and ($\vec{s}_{j}(u)$, $\vec{\zeta}(u,t_{1})$).
We train this classifier using the official train split in WiC.
In particular, we do not fine-tune the static or contextualised embeddings that are used as inputs by CDES on WiC because our goal is to extract sense-related information already present in the pretrained embeddings.

\begin{table}[t]
\centering
\small
\begin{tabular}{lc}
\toprule
Models &Accuracy \% \\
\midrule
\textit{Static Embeddings} \\

GloVe~\cite{pennington2014glove} & 50.9\\
\midrule
\textit{Contextualised Embeddings} \\
ElMo~\cite{peters2018deep} &57.7\\
ELMo-weighted~\cite{ansell2019elmo} &61.2\\
BERT-large~\cite{devlin2019bert} &65.5\\
RoBERTa~\cite{liu2019roberta} &69.9\\
KnowBERT-W+W~\cite{peters2019knowledge} &70.9\\
SenseBERT-large~\cite{levine-etal-2020-sensebert} &\underline{72.1} \\
BERT$_{ARES}$~\cite{scarlini2020more} &\pmb{72.2} \\
\midrule
\textit{Static Sense Embeddings} \\
MUSE~\cite{lee2017muse} &48.4 \\
LMMS~\cite{Loureiro2019LIAADAS} &67.7\\
LessLex~\cite{colla-etal-2020-lesslex} &59.2 \\
CDES$_{linear}$ &69.0 \\
CDES$_{ReLu}$ &68.6 \\
CDES$_{GELU}$ &68.8\\

\bottomrule
\end{tabular}
\caption{Performance on WiC. Bold and underline respectively indicate the best and the second best results.}
\label{tbl:wic-dev}
\end{table}

\begin{figure*}[t]
\centering
\begin{minipage}[t]{0.33\linewidth}
\centering
\includegraphics[width=2.0in, height=2.0in]{figures/bank_sense_glove.png}
\label{fig:side:a}
\end{minipage}%
\begin{minipage}[t]{0.33\linewidth}
\centering
\includegraphics[width=2.0in, height=2.0in]{figures/bank_sense_ares.png}
\end{minipage}
\begin{minipage}[t]{0.33\linewidth}
\centering
\includegraphics[width=2.0in, height=2.0in]{figures/bank_sense_linear_CDES.png}
\end{minipage}
\caption{t-SNE visualisations of the nearest neighbours of \emph{bank} corresponding to the two senses  \emph{financial institution} (in red) and \emph{sloping land} (in blue) are shown for GloVe, ARES and CDES embeddings. Sense labels of synonyms are omitted to avoid cluttering.}
\label{fig:tsne_bank}
\end{figure*}

In Table~\ref{tbl:wic-dev}, we report the classification accuracies on WiC  for different types of embeddings such as
static word embeddings (GloVe), contextualised embeddings generated by NLMs (ELMo, ElMo-weighted, BERT-large, RoBERTa and KnowBERT), and sense-specific embeddings (MUSE, LMMS, LessLex, SenseBERT-large and BERT$_{ARES}$).
Due to space limitations we omit the details of these embeddings.

From Table~\ref{tbl:wic-dev} we see that SenseBERT-large and BERT$_{ARES}$ obtain better performance than other embeddings.
All the CDES variants outperform previous static sense embeddings learning methods.
However,  MUSE\footnote{\url{https://github.com/MiuLab/MUSE}} do not assign sense labels to sense embeddings as done by LMMS, LessLex and CDES.
Among CDES variants, CDES$_{linear}$ performs best and is closely followed by GELU and ReLU variants.
Although, CDES variants do not surpass the current SoTA methods such as SenseBERT-large and BERT$_{ARES}$ on WiC, unlike CDES these methods fine-tune on WiC train data and/or use more complex classifiers with multiple projection layers compared to the single logistic regression over six features used by CDES.\footnote{BERT$_{ARES}$ and SenseBERT use respectively 2048 and 1024 features for sense prediction in WiC.}
More importantly, results from both WSD and WiC experiments support our claim that contextualised embeddings encode word sense related information that can be extracted and injected into sense-insensitive static word embeddings via (non)linear projections to create sense-sensitive versions of the sense-insensitive static embeddings.

\subsection{Visualisation of Sense Embeddings}
\label{sec:nonlinear}

To visualise the embeddings corresponding to the different senses of an ambiguous word, we consider \emph{bank}, which has the two distinct senses: \emph{financial institution} and \emph{sloping land}.
We randomly select $5$ synonyms for each sense of \emph{bank} from the WordNet and project their sense/word embeddings using  t-SNE in Figure~\ref{fig:tsne_bank}.
Compared to GloVe, we see that words with related meanings are projected onto coherent clusters by ARES and CDES.
This indicates that sense embeddings are able to distinguish polysemy correctly compared to static word embeddings.
Overall, we see that CDES produces better separated clusters than both GloVe and ARES.

\subsection{Nearest Neighbours of Sense Embeddings}
\label{sec:NN}

\begin{table*}[t!]
\centering
\small
\begin{tabular}{p{2.7cm}p{2.7cm}p{2.7cm}p{2.7cm}p{2.7cm}}
\toprule
\multicolumn{5}{p{16cm}}{\textbf{Sentence 1:} The \colorbox{cyan}{banks} which held the mortgage on the old church declared that the interest was considerably in arrears, and the real estate people said flatly that the land across the river was being held for an eventual development for white working people who were coming in, and that none would be sold to colored folk.} \\
\midrule
GloVe & BERT & LMMS & SenseBERT & CDES\\
\midrule
mortgage & mortgage & mortgage & mortgage & mortgage \\
interest & interest & church & real & real estate \\
estate & held & sell & old & sell \\
river & church & interest & land & interest \\
real & river & real estate & interest & church \\
\midrule \midrule
\multicolumn{5}{p{16cm}}{\textbf{Sentence 2:} Through the splash of the rising waters, they could hear the roar of the river as it raged through its canyon, gnashing big chunks out of the \colorbox{red}{banks}.} \\
\midrule
GloVe & BERT & LMMS & SenseBERT & CDES\\
\midrule
mortgage & river & river & splash & river \\
interest & waters & canyon & land & water \\
estate & chunks & land & out & rise \\
river & splash & folk & through & canyon \\
real & canyon & church & chunks & folk \\
\bottomrule
\end{tabular}
\caption{Nearest neighbours computed using the word/sense embeddings of \emph{bank} in two sentences.}
\label{tbl:NN}
\end{table*}

\iffalse
\begin{table*}[t!]
\centering
\small
\begin{tabular}{p{2.7cm}p{2.7cm}p{2.7cm}p{2.7cm}p{2.7cm}}
\toprule
\multicolumn{5}{p{16cm}}{The \colorbox{cyan}{banks} which held the mortgage on the old church declared that the interest was considerably in arrears, and the real estate people said flatly that the land across the river was being held for an eventual development for white working people who were coming in, and that none would be sold to colored folk.} \\
\midrule
GloVe & BERT & LMMS & SenseBERT & CDES \\
\midrule
mortgage(0.64) & mortgage(0.54) & bank\%01(0.83) & mortgage(0.88) & working\%00(0.50) \\
interest(0.48) & interest(0.45) & mortgage\%00(0.70) & real(0.86) & say\%00(0.41) \\
estate(0.46) & held(0.37) &  river\%00(0.67) & old(0.86) & real\_estate\%00(0.36) \\
river(0.42) & church(0.35) & church\%00(0.64) & land(0.86) & interest\%00(0.29) \\
real(0.39) & river(0.34) & real\_estate\%00(0.62) & interest(0.86) & water\%00(0.26) \\
through(0.36) & people(0.34) & water\%00(0.60) & it(0.84) & church\%00(0.25) \\
arrears(0.36) & real(0.32) & land\%01(0.60) & splash(0.81) & hear\%00(0.21) \\
big(0.34) & old(0.31) & sell\%00(0.60) &through (0.78) & considerably\%01 (0.20) \\
they(0.34) & estate(0.31) & interest\%00(0.59) & hear(0.77) & chunk\%00(0.15) \\
land(0.34) & waters(0.27) & folk\%00(0.58)  & river(0.76) & big\%01(0.11) \\
\midrule \midrule
\multicolumn{5}{p{16cm}}{Through the splash of the rising waters, they could hear the roar of the river as it raged through its canyon, gnashing big chunks out of the \colorbox{red}{banks}.} \\
\midrule
GloVe & BERT & LMMS & SenseBERT & CDES \\
\midrule
mortgage(0.64) & river(0.51) & bank\%00(0.83) & splash(0.52) & canyon\%00(0.12) \\
interest(0.49) & waters(0.44) & river\%00(0.76) & land(0.52) & river\%00(0.11) \\
estate(0.46) & chunks(0.43) & mortgage\%00(0.65) & out(0.50) & old\%01(0.09) \\
river(0.42) & it(0.40) & land\%01(0.63) & through(0.49) & be\%03(0.08) \\
real(0.39) & canyon(0.36) & church\%00(0.63) & chunks(0.48) & roar\%00(0.08) \\
through(0.36) & splash(0.35) & canyon\%00(0.63) & interest(0.48) & gnash\%00(0.06) \\
arrears(0.36) & gnashing(0.35) & water\%00(0.61) & old(0.48) & interest\%00(0.05) \\
big(0.34) & through(0.31) & folk\%00(0.60) & mortgage(0.48) & chunk\%00(0.05) \\
they(0.34) & mortgage(0.31) & real\_estate\%00(0.58) & its(0.48) & water\%00(0.04) \\
land(0.34) & rising(0.31) & people\%00(0.58) & river(0.47) & hold\%04(0.04) \\
\bottomrule
\end{tabular}
\caption{Nearest neighbours computed using the word/sense embeddings of \emph{bank} in two sentences.}
\label{tbl:NN}
\end{table*}
\fi

An accurate sense embedding method must be able to represent an ambiguous word with different embeddings considering the senses expressed by that word in different contexts.
To understand how sense embedding of a word vary in different contexts, we compute the nearest neighbours of an ambiguous word using its sense embedding.
Table~\ref{tbl:NN} shows two sentences from SemCor containing \emph{bank}, where in Sentence 1, \emph{bank} takes the \emph{financial institution} sense, and in Sentence 2 the \emph{sloping land (especially the slope beside a body of water)} sense.
We compute the sense embedding of \emph{bank}, given each sentence as the context, using different methods and compute the top 5 nearest neighbours, shown in the descending order of their cosine similarity scores with the sense embedding of \emph{bank} in each sentence.

GloVe, which is sense and context insensitive uses the same vector to represent \emph{bank} in both sentences, resulting in the same set of nearest neighbours, which is a mixture of finance and riverbank related words.
On the other hand, BERT, which is context-sensitive but not sense-specific, returns different sets of nearest neighbours in the two cases.
In particular, we see that finance-related nearest neighbours such as \emph{mortgage} and \emph{interest} are selected for the first sentence, whereas riverbank-related nearest neighbours such as \emph{water} and \emph{canyon} for the second.
However, BERT does not provide sense embeddings and some neighbours such as \emph{river} appear in both sets, because it appears in the first sentence, although not related to \emph{bank} there.

SenseBERT~\cite{levine-etal-2020-sensebert} disambiguates word senses at a coarse-grained WordNet's supersense level.
We see that SenseBERT correctly detects words such as \emph{mortgage} and \emph{interest} as neighbours of \emph{bank} in the first sentence, and \emph{splash} and \emph{land} in the second.
We see that \emph{land} appears as a nearest neighbour in both sentences, although it is more related to the \emph{sloping land} sense than the \emph{financial institution} sense of \emph{bank}.

LMMS selects \emph{church} as a nearest neighbour for both sentences, despite being irrelevant to the second.
On the other hand, CDES correctly detects \emph{church} for the first sentence and not for the second.
Overall, CDES correctly lists financial institution sense related words such as \emph{mortgage}, \emph{real estate} and \emph{interest} for the first sentence, and sloping land sense related words such as \emph{river}, \emph{water} and \emph{canyon} in the second sentence.

\section{Related Work}

\newcite{reisinger2010multi} proposed multi-prototype embeddings to represent word senses, which was extended by \newcite{huang2012improving} combining both local and global contexts.
Both methods use clustering to group contexts of a word related to the same sense.
Although the number of senses depends on the word, these methods assign a fixed number of senses to all words.
To overcome this limitation, \newcite{neelakantan2014efficient} proposed a non-parametric model, which estimates the number of senses dynamically per word.

Even though clustering-based methods are able to assign multi-prototype embeddings for a word, they still suffer from the fact that the trained embeddings are not associated with any sense inventories~\cite{Camacho_Collados_2018}.
In contrast, knowledge-based approaches learn sense embeddings by extracting sense-specific information from external sense inventories, such as WordNet and BabelNet.
\newcite{chen2014unified} extended word2vec~\cite{mikolov2013distributed} to learn sense-specific embeddings associated with the WordNet~\cite{miller1998wordnet} \emph{synsets}.
\newcite{rothe2015autoextend} used the semantic relations in WordNet to embed words and their senses into a common vector space.
\newcite{iacobacci2015sensembed} use the sense definitions from BabelNet and perform word sense disambiguation (WSD) to obtain sense-specific contexts.

Recently, contextualised embeddings generated by NLMs have been used to create sense embeddings.
\newcite{loureiro2019language} construct sense embeddings by taking the average over the contextualised embeddings of the sense annotated tokens from SemCor.
\newcite{scarlini2020sensembert} propose a knowledge-based approach for constructing BERT-based embeddings of senses by means of the lexical-semantic information in BabelNet and Wikipedia.
CDES proposed in this paper extends this line of work, where we extract sense-related information from an NLM and inject into a static word embedding to create a sense-specific version of the latter.
Moreover, we follow prior work~\cite{scarlini2020more,loureiro2019language} and incorporate contexts from external resources such as Wikipedia, WordNet and SyntagNet representing different senses of a word to enhance sense embeddings learnt using sense-labelled corpora.

\section{Conclusion}
We proposed CDES, a method which is able to generate sense embeddings by extracting the sense-related information from contextualised embeddings.
CDES integrates the gloss information from a semantic network as well as the information from an external corpus to tackle the sense-coverage problem.
Evaluations on multiple benchmark datasets related to WSD and WiC tasks show that CDES learns accurate sense emebddings,
and report comparable results to the current SoTA.
All experiments reported in the paper are limited to English language and we plan to extend the proposed method to learn multilingual sense embeddings in our future work.

\section{Experimental Settings and Hyperparameters}

We use Adam~\cite{Kingma:ICLR:2015} as the optimiser and set the minibatch size to $64$ with an initial learning rate of 1E-4.
GloVe is used as the pre-trained static word embedding and contain $300$ dimensional embeddings, whereas BERT-large model is used as the pre-trained contextualised word embeddings and $1024$ dimensional.
In order to map the contextualised embeddings and static embeddings in to a common vector space, we set $\mat{W} \in \R^{300 \times 1024}$.
To reduce the memory footprint, number of trainable parameters and thereby overfitting, we constrain the sense-specific matrices $\mat{A}_i \in \R^{300 \times 300}$ to be diagonal matrices.
$\mat{W}$ and $\mat{A}_{i}$ matrices are randomly initialised following Xavier initialisation~\cite{Glorot:AISTAT:2010}.
Following the work of~\newcite{wiedemann2019does}, we set $k=3$ for the WSD task, which means that we consider three potential senses when conducting WSD task.
For WiC task we set $k=1$ for all comparisons.
All the above hyperparameter values were tuned using a randomly selected subset of training data as validation data.

In terms of visualisation, we use \texttt{sklearn.manifold.TSNE} to perform t-SNE visualisation.
We set the n\_components=2, init=`pca', perplexity=3, n\_iter=1500 and metric=`cosine'.