\documentclass[tikz,border=1pt]{standalone}
\usepackage{times}
\usepackage{pgfplots}
\usepgfplotslibrary{groupplots}
\pgfplotsset{compat=1.18}

\definecolor{hubred}{RGB}{232,28,33}
\definecolor{fastblue}{RGB}{107,174,214}
\definecolor{snaporange}{RGB}{242,176,39}

\begin{document}
\begin{tikzpicture}
\begin{groupplot}[
    group style={
        group size=1 by 2,
        vertical sep=0.34cm
    },
    width=3.28in,
    height=1.42in,
    xmin=0.82,
    xmax=4.18,
    xtick={1,2,3,4},
    xticklabels={1024,2048,4096,6144},
    tick label style={font=\scriptsize},
    label style={font=\scriptsize},
    grid=major,
    major grid style={dotted, gray!55, line width=0.45pt},
    axis line style={black, line width=0.5pt},
    tick style={black, line width=0.5pt},
    ylabel={Accuracy (\%)},
    ylabel style={yshift=-0.3ex},
    legend columns=3,
    legend style={
        font=\scriptsize,
        draw=black,
        fill=white,
        line width=0.35pt,
        inner xsep=2.4pt,
        inner ysep=1.5pt,
        cells={anchor=west},
        /tikz/every even column/.append style={column sep=0.12cm}
    }
]

\nextgroupplot[
    ymin=5,
    ymax=22.5,
    ytick={5,10,15,20},
    xticklabels=\empty,
    legend to name=decodinglegend
]
\node[anchor=north west, font=\bfseries\small, fill=white, inner sep=1pt] at (rel axis cs:0.03,0.97) {AIME25};
\addplot[hubred, very thick, mark=*, mark size=1.65pt,
    mark options={solid, fill=hubred, draw=hubred}]
    coordinates {(1,13.33) (2,20.00) (3,20.00) (4,20.00)};
\addlegendentry{HubKV}
\addplot[fastblue, thick, dashed, mark=o, mark size=1.7pt,
    mark options={solid, fill=white, line width=0.6pt}]
    coordinates {(1,6.67) (2,16.67) (3,16.67) (4,16.67)};
\addlegendentry{FastKVZip}
\addplot[snaporange, thick, mark=triangle*, mark size=2.0pt,
    mark options={solid, fill=snaporange!35, draw=snaporange, line width=0.5pt}]
    coordinates {(1,6.67) (2,6.67) (3,13.33) (4,13.33)};
\addlegendentry{SnapKV}

\nextgroupplot[
    ymin=48,
    ymax=60.5,
    ytick={50,55,60},
    xlabel={Target KV length}
]
\node[anchor=north west, font=\bfseries\small, fill=white, inner sep=1pt] at (rel axis cs:0.03,0.97) {MATH};
\addplot[hubred, very thick, mark=*, mark size=1.65pt,
    mark options={solid, fill=hubred, draw=hubred}, forget plot]
    coordinates {(1,56.2) (2,58.0) (3,59.3) (4,59.3)};
\addplot[fastblue, thick, dashed, mark=o, mark size=1.7pt,
    mark options={solid, fill=white, line width=0.6pt}, forget plot]
    coordinates {(1,52.2) (2,56.6) (3,58.2) (4,58.2)};
\addplot[snaporange, thick, mark=triangle*, mark size=2.0pt,
    mark options={solid, fill=snaporange!35, draw=snaporange, line width=0.5pt}, forget plot]
    coordinates {(1,49.2) (2,51.8) (3,51.8) (4,52.2)};

\end{groupplot}
\node[anchor=south, yshift=0.12cm] at (group c1r1.north) {\pgfplotslegendfromname{decodinglegend}};
\end{tikzpicture}
\end{document}
