% !Mode:: "TeX:UTF-8"
% !TEX encoding = UTF-8 Unicode

\begin{center}
  \begin{tikzpicture}
    \tikzset{
      block/.style = {
        minimum width=3.5cm,minimum height=1.5cm,
        draw=#1,fill=white,line width=2pt,
        drop shadow={fill=gray,shadow xshift=.6ex,shadow yshift=-.6ex}
      },
      block/.default=black
    }
    \def\sep{1.5cm}
    \def\textwid{7.0cm}
    \begin{scope}
      \node [anchor=east] at (0,0) {\large{$\cdots$}};
      \node [anchor=west, block=lolred] (llm) at (\sep/2,0) {Reference Policy (LLM)};
      \draw [->] (0,0) -- (\sep/2,0);
      \node [anchor=north] (x) at ([yshift=-.5cm]llm.south) {\large{$\mathbf{x}$}};
      \node [draw, dashed, rounded corners=2pt,anchor=south, align=left, text width=\textwid, minimum height=2.6cm] (output) at ([yshift=.5cm]llm.north) {\footnotesize{There are three tips }\footnotesize{\sethlcolor{red!20}\hl{for improving for improving for improving} \footnotesize{accuracy in solving math problems:}} \\
        \footnotesize{1.Practice regularly. \\
          2.Understand the concepts. \\
          3.Double-check your work.}};
      \node [draw, dashed, rounded corners=2pt,anchor=north, align=left, text width=\textwid] (input) at ([yshift=0cm]x.south) {\footnotesize{Give me three tips to improve my accuracy in solving math problems.}};
      \node [anchor=south] (y) at ([yshift=0cm]output.north) {\large{$\mathbf{y}$}};
      
      \node [align=left] (step) at ([yshift=-.5cm]input.south) {\footnotesize{sampling in a terrible step}};
      \draw [->] (x.north) -- ([yshift=-.1cm]llm.south);
      \draw [<-] ([yshift=-.1cm]output.south) -- ([yshift=.1cm]llm.north);

      %% 
      \node [block=lolred,anchor=west] (llm1) at ([xshift=\sep*3]llm.east) {Reference Policy (LLM)};
      \node [anchor=north] (x) at ([yshift=-.5cm]llm1.south) {\large{$\mathbf{x}$}};
      \node [draw, dashed, rounded corners=2pt,anchor=south, align=left, text width=\textwid, minimum height=2.6cm] (output) at ([yshift=.5cm]llm1.north) {\footnotesize{There are three tips }\footnotesize{\sethlcolor{red!20}\hl{for improving improving improving improving improving improving improving improving } \footnotesize{accuracy in solving math problems:}} \\
        \footnotesize{1.Practice }\sethlcolor{red!20}\hl{regularly regularly regularly regularly regularly regularly regularly }. \footnotesize{...}\\};

      \node [draw, dashed, rounded corners=2pt,anchor=north, align=left, text width=\textwid] (input) at ([yshift=0cm]x.south) {\footnotesize{Give me three tips to improve my accuracy in solving math problems.}};
      \node [anchor=south] (y) at ([yshift=0cm]output.north) {\large{$\mathbf{y}$}};
      
      \node [align=left] (step) at ([yshift=-.5cm]input.south) {\footnotesize{sampling after a terrible step}};
      \draw [->] (x.north) -- ([yshift=-.1cm]llm1.south);
      \draw [<-] ([yshift=-.1cm]output.south) -- ([yshift=.1cm]llm1.north);
      
      % \node [anchor=north, align=left] (step) at (llm1.south |- step.north) {\footnotesize{xxxxxx}};

      \node [anchor=west] (llm2) at ([xshift=\sep/2]llm1.east) {\large{$\cdots$}};

      \draw [->] (llm.east) -- node [midway, align=center] {\footnotesize{resync the reference policy} \\\footnotesize{after a terrible step}} (llm1.west);
      \draw [->] (llm1.east) -- (llm2.west);

    \end{scope}
  \end{tikzpicture}
\end{center}
