
\begin{tikzpicture}

\def\ssep{0.9cm}
\def\bsep{2.0cm}

\tikzstyle{enode} = [minimum width=0.8cm,minimum height=0.8cm,inner sep=2pt];
\tikzstyle{tnode} = [minimum width=11cm,minimum height=3.6cm,inner sep=2pt,draw,thick];
\tikzstyle{bnode} = [minimum width=4.6cm,minimum height=0.6cm,inner sep=2pt];

\begin{scope}

\node [enode,anchor=center] (x0) at (0,0) {\footnotesize{...}};
\node [enode,anchor=center] (x1) at ([xshift=\ssep]x0.center) {\scriptsize{Translate}};
\node [enode,anchor=center] (x2) at ([xshift=\ssep]x1.center) {\footnotesize{this}};
\node [enode,anchor=center] (x3) at ([xshift=\ssep]x2.center) {\footnotesize{into}};
\node [enode,anchor=center] (x4) at ([xshift=\ssep]x3.center) {\footnotesize{Chinese}};
\node [enode,anchor=center] (x5) at ([xshift=\ssep]x4.center) {\footnotesize{.}};
\node [enode,anchor=center] (x6) at ([xshift=\ssep]x5.center) {\footnotesize{I}};
\node [enode,anchor=center] (x7) at ([xshift=\ssep]x6.center) {\footnotesize{have}};
\node [enode,anchor=center] (x8) at ([xshift=\ssep]x7.center) {\footnotesize{a}};
\node [enode,anchor=center] (x9) at ([xshift=\ssep]x8.center) {\footnotesize{cat}};
\node [enode,anchor=center] (x10) at ([xshift=\ssep]x9.center) {\footnotesize{.}};
\node [enode,anchor=center] (x11) at ([xshift=\ssep]x10.center) {\footnotesize{...}};

\draw [->] ([yshift=0.2cm]x0.center) -- ([yshift=0.2cm+0.6*\ssep]x0.center);
\draw [->] ([yshift=0.2cm]x1.center) -- ([yshift=0.2cm+0.6*\ssep]x1.center);
\draw [->] ([yshift=0.2cm]x2.center) -- ([yshift=0.2cm+0.6*\ssep]x2.center);
\draw [->] ([yshift=0.2cm]x3.center) -- ([yshift=0.2cm+0.6*\ssep]x3.center);
\draw [->] ([yshift=0.2cm]x4.center) -- ([yshift=0.2cm+0.6*\ssep]x4.center);
\draw [->] ([yshift=0.2cm]x5.center) -- ([yshift=0.2cm+0.6*\ssep]x5.center);
\draw [->] ([yshift=0.2cm]x6.center) -- ([yshift=0.2cm+0.6*\ssep]x6.center);
\draw [->] ([yshift=0.2cm]x7.center) -- ([yshift=0.2cm+0.6*\ssep]x7.center);
\draw [->] ([yshift=0.2cm]x8.center) -- ([yshift=0.2cm+0.6*\ssep]x8.center);
\draw [->] ([yshift=0.2cm]x9.center) -- ([yshift=0.2cm+0.6*\ssep]x9.center);
\draw [->] ([yshift=0.2cm]x10.center) -- ([yshift=0.2cm+0.6*\ssep]x10.center);
\draw [->] ([yshift=0.2cm]x11.center) -- ([yshift=0.2cm+0.6*\ssep]x11.center);

\node [tnode,anchor=south west] (llm) at ([xshift=-0.2cm,yshift=0.60*\ssep]x0.north west) {};
\node [anchor=south] (llmlabel) at ([yshift=0.3cm]llm.south) {\LARGE{Transformer}};

\node [enode,anchor=center] (h0) at ([yshift=3cm]x0.center) {\footnotesize{...}};
\node [enode,anchor=center] (h1) at ([xshift=\ssep]h0.center) {\footnotesize{$\mathbf{h}_j$}};
\node [enode,anchor=center] (h2) at ([xshift=\ssep]h1.center) {\footnotesize{$\mathbf{h}_{j+1}$}};
\node [enode,anchor=center] (h3) at ([xshift=\ssep]h2.center) {\footnotesize{$\mathbf{h}_{j+2}$}};
\node [enode,anchor=center] (h4) at ([xshift=\ssep]h3.center) {\footnotesize{$\mathbf{h}_{j+3}$}};
\node [enode,anchor=center] (h5) at ([xshift=\ssep]h4.center) {\footnotesize{$\mathbf{h}_{j+4}$}};
\node [enode,anchor=center] (h6) at ([xshift=\ssep]h5.center) {\footnotesize{$\mathbf{h}_{j+5}$}};
\node [enode,anchor=center] (h7) at ([xshift=\ssep]h6.center) {\footnotesize{$\mathbf{h}_{j+6}$}};
\node [enode,anchor=center] (h8) at ([xshift=\ssep]h7.center) {\footnotesize{$\mathbf{h}_{j+7}$}};
\node [enode,anchor=center] (h9) at ([xshift=\ssep]h8.center) {\footnotesize{$\mathbf{h}_{j+8}$}};
\node [enode,anchor=center] (h10) at ([xshift=\ssep]h9.center) {\footnotesize{$\mathbf{h}_{j+9}$}};
\node [enode,anchor=center] (h11) at ([xshift=\ssep]h10.center) {\footnotesize{...}};

\node [enode,anchor=center] (a0) at ([yshift=1.3*\ssep]h0.center) {\footnotesize{...}};
\node [enode,anchor=center] (a1) at ([yshift=1.3*\ssep]h1.center) {\footnotesize{...}};
\node [enode,anchor=center] (a2) at ([yshift=1.3*\ssep]h2.center) {\footnotesize{...}};
\node [enode,anchor=center] (a3) at ([yshift=1.3*\ssep]h3.center) {\footnotesize{...}};
\node [enode,anchor=center] (a4) at ([yshift=1.3*\ssep]h4.center) {\footnotesize{...}};
\node [enode,anchor=center] (a5) at ([yshift=1.3*\ssep]h5.center) {\footnotesize{...}};
\node [enode,anchor=center] (a6) at ([yshift=1.3*\ssep]h6.center) {\footnotesize{...}};
\node [enode,anchor=center] (a7) at ([yshift=1.3*\ssep]h7.center) {\footnotesize{...}};
\node [enode,anchor=center] (a8) at ([yshift=1.3*\ssep]h8.center) {\footnotesize{...}};
\node [enode,anchor=center] (a9) at ([yshift=1.3*\ssep]h9.center) {\footnotesize{...}};
\node [enode,anchor=center] (a10) at ([yshift=1.3*\ssep]h10.center) {\footnotesize{...}};
\node [enode,anchor=center] (a11) at ([yshift=1.3*\ssep]h11.center) {\footnotesize{...}};

\draw [->] ([yshift=-0.5*\ssep-0.4cm]h0.center) -- ([yshift=-0.4cm]h0.center);
\draw [->] ([yshift=-0.5*\ssep-0.4cm]h1.center) -- ([yshift=-0.4cm]h1.center);
\draw [->] ([yshift=-0.5*\ssep-0.4cm]h2.center) -- ([yshift=-0.4cm]h2.center);
\draw [->] ([yshift=-0.5*\ssep-0.4cm]h3.center) -- ([yshift=-0.4cm]h3.center);
\draw [->] ([yshift=-0.5*\ssep-0.4cm]h4.center) -- ([yshift=-0.4cm]h4.center);
\draw [->] ([yshift=-0.5*\ssep-0.4cm]h5.center) -- ([yshift=-0.4cm]h5.center);
\draw [->] ([yshift=-0.5*\ssep-0.4cm]h6.center) -- ([yshift=-0.4cm]h6.center);
\draw [->] ([yshift=-0.5*\ssep-0.4cm]h7.center) -- ([yshift=-0.4cm]h7.center);
\draw [->] ([yshift=-0.5*\ssep-0.4cm]h8.center) -- ([yshift=-0.4cm]h8.center);
\draw [->] ([yshift=-0.5*\ssep-0.4cm]h9.center) -- ([yshift=-0.4cm]h9.center);
\draw [->] ([yshift=-0.5*\ssep-0.4cm]h10.center) -- ([yshift=-0.4cm]h10.center);
\draw [->] ([yshift=-0.5*\ssep-0.4cm]h11.center) -- ([yshift=-0.4cm]h11.center);

\draw [<-] ([yshift=0.5*\ssep+0.4cm]h0.center) -- ([yshift=0.4cm]h0.center);
\draw [<-] ([yshift=0.5*\ssep+0.4cm]h1.center) -- ([yshift=0.4cm]h1.center);
\draw [<-] ([yshift=0.5*\ssep+0.4cm]h2.center) -- ([yshift=0.4cm]h2.center);
\draw [<-] ([yshift=0.5*\ssep+0.4cm]h3.center) -- ([yshift=0.4cm]h3.center);
\draw [<-] ([yshift=0.5*\ssep+0.4cm]h4.center) -- ([yshift=0.4cm]h4.center);
\draw [<-] ([yshift=0.5*\ssep+0.4cm]h5.center) -- ([yshift=0.4cm]h5.center);
\draw [<-] ([yshift=0.5*\ssep+0.4cm]h6.center) -- ([yshift=0.4cm]h6.center);
\draw [<-] ([yshift=0.5*\ssep+0.4cm]h7.center) -- ([yshift=0.4cm]h7.center);
\draw [<-] ([yshift=0.5*\ssep+0.4cm]h8.center) -- ([yshift=0.4cm]h8.center);
\draw [<-] ([yshift=0.5*\ssep+0.4cm]h9.center) -- ([yshift=0.4cm]h9.center);
\draw [<-] ([yshift=0.5*\ssep+0.4cm]h10.center) -- ([yshift=0.4cm]h10.center);
\draw [<-] ([yshift=0.5*\ssep+0.4cm]h11.center) -- ([yshift=0.4cm]h11.center);

\begin{pgfonlayer}{background}
\node [bnode,anchor=west,fill=blue!20] (hardbox) at (x1.west) {};
\node [bnode,anchor=center,fill=red!20] (softbox) at ([yshift=3cm]hardbox.center) {};
\end{pgfonlayer}

\node [anchor=north] (hardlabel) at ([yshift=-0.1cm]hardbox.south) {\small{Hard Prompt (Instruction)}};
\node [anchor=east] (softlabel) at ([yshift=1.2cm,xshift=-0.4cm]llm.west) {\small{Soft Prompt}};

\draw [->] (softlabel.east) .. controls +(east:0.9cm) and +(west:0.9cm) .. ([yshift=0.2cm,xshift=-2pt]softbox.west);

\end{scope}

\end{tikzpicture}
