\begin{center}
  \def\tgtwidth{0.5\textwidth}
  \begin{tikzpicture}
    \tikzstyle{ynode} = [draw,rounded corners=4pt, minimum width=\tgtwidth,inner sep=4pt,align=left,text width=\tgtwidth]
    \begin{scope}
      \node (input) at (0,0) {$\mathbf{x}$};
      \node [ynode, anchor=west] (note) at ([xshift=.2cm]input.east) {
        \begin{varwidth}{\textwidth}
          \scriptsize{Give me three tips to improve my accuracy in solving math problems.}
        \end{varwidth}
      };
      \node [ynode,anchor=north west] (output1) at ([yshift=-.2cm]note.south west) {
        \scriptsize{Improving accuracy in math problem-solving is crucial for success. Here are three tips to help you enhance your accuracy: \\
          1. Focus on Understanding Concepts: Before diving into solving problems, ensure you have a solid understanding of the underlying concepts. Break down the problem into smaller parts and relate each part to the concepts you've learned. Understanding the theory behind the problem will help you choose the right approach to solve it accurately. \\
          2. Practice Regularly: Like any other skill, math proficiency improves with practice. Work on a variety of problems regularly to build your problem-solving skills and increase your accuracy. Start with easier problems and gradually move on to more challenging ones. Consider using resources like textbooks, online problem sets, or math apps to practice. \\
          3. Check and Review Your Work: After solving a problem, always double-check your work for any errors. Pay attention to details such as signs, decimal points, and units. If time permits, try solving the problem using a different method to verify your initial answer. By reviewing your work, you can catch and correct any mistakes, improving your overall accuracy.}\\};
      \node [anchor=east](y1) at ([xshift=-.2cm]output1.west) {$\mathbf{y}_a$};
      \node [ynode,anchor=north] (output2) at ([yshift=-.2cm]output1.south) {
        \scriptsize{There are three tips for improving accuracy in solving math problems: \\
          1.Practice regularly. \\
          2.Understand the concepts. \\
          3.Double-check your work.\\}
      };
      \node [anchor=east](y2) at ([xshift=-.2cm]output2.west) {$\mathbf{y}_b$};

      \begin{axis}[
        compat=1.3,
        anchor=north west,
        at={(note.north east)},
        axis x line=bottom,axis y line=left,
        xshift=1.4cm,
        yshift=-.5cm,
        xtick={0,1,2,3,4},
        xticklabels={$\mathbf{y}_a$,$\mathbf{y}_1$,$\mathbf{y}_b$,$\mathbf{y}_2$,$\cdots$},
        every tick label/.append style={font=\footnotesize},
        every axis label/.append style={font=\footnotesize},
        xtick distance=.1cm,
        ymin=0,
        ymax=.6,
        ylabel=$\mathrm{Pr}_{\theta}(\mathbf{y}|\mathbf{x})$,
        ylabel shift=-.1cm,
        enlarge x limits=0.3,
        width=5cm,
        height=4cm,
        ybar,
        bar shift=0pt,]
        \addplot[fill=lolred,draw=none] coordinates {
          (2, .34)
          (3, .24)
        };
        \addplot[fill=lolblue,draw=none] coordinates {
          (0, .19)
          (1, .15)
        };
        \addplot[fill=lightgray,draw=none] coordinates {
          (4, .08)
        };
      \end{axis}

      \begin{axis}[
        compat=1.3,
        anchor=south west,
        at={(output2.south east)},
        axis x line=bottom,axis y line=left,
        xshift=1.4cm,
        yshift=.5cm,
        xtick={0,1,2,3,4},
        xticklabels={$\mathbf{y}_a$,$\mathbf{y}_1$,$\mathbf{y}_b$,$\mathbf{y}_2$,$\cdots$},
        every tick label/.append style={font=\footnotesize},
        every axis label/.append style={font=\footnotesize},
        xtick distance=.1cm,
        ymin=0,
        ymax=.6,
        ylabel=$\mathrm{Pr}_{\theta}(\mathbf{y}|\mathbf{x})$,
        ylabel shift=-.1cm,
        enlarge x limits=0.3,
        width=5cm,
        height=4cm,
        ybar,
        bar shift=0pt,]
        \addplot[fill=lolred,draw=none] coordinates {
          (2, .14)
          (3, .04)
        };
        \addplot[fill=lolblue,draw=none] coordinates {
          (0, .39)
          (1, .35)
        };
        \addplot[fill=lightgray,draw=none] coordinates {
          (4, .08)
        };
      \end{axis}

      \node at ([xshift=2.35cm,yshift=-2.00cm]note.north east) {\scriptsize{Preferred}};
      \node at ([xshift=3.45cm,yshift=-1.4cm]note.north east) {\scriptsize{Dispreferred}};
      \node at ([xshift=2.35cm,yshift=2.25cm]output2.south east) {\scriptsize{Preferred}};
      \node at ([xshift=3.45cm,yshift=1.22cm]output2.south east) {\scriptsize{Dispreferred}};
      \draw [->,thick] ([xshift=3cm,yshift=-2.8cm]output1.north east) -- node [align=center,fill=white,text width=5.5cm,inner sep=2pt] {
        \scriptsize{Minizing the negative probability: \\
        $- \log\mathrm{Sigmoid} \big( \beta \log \frac{\mathrm{Pr}_{\theta}(\mathbf{y}_{a}|\mathbf{\mathbf{x}})}{\mathrm{Pr}_{\theta_\mathrm{ref}}(\mathbf{y}_{a}|\mathbf{\mathbf{x}})} - \beta \log \frac{\mathrm{Pr}_{\theta}(\mathbf{y}_{b}|\mathbf{\mathbf{x}})}{\mathrm{Pr}_{\theta_\mathrm{ref}}(\mathbf{y}_{b}|\mathbf{\mathbf{x}})} \big)$}
      }([xshift=3cm,yshift=3.2cm]output2.south east);

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