Commit 2960fdf8 by 周航

Update figures in section6

parent d849274f
% Required: % Required:
% \usetikzlibrary{positioning,calc,shadows} % \usetikzlibrary{positioning,calc,shadows}
\begin{tikzpicture}[ \begin{center}
box/.style={
\begin{tikzpicture}[
box/.style={
draw, draw,
fill=white, fill=white,
drop shadow={shadow xshift=0.08cm, shadow yshift=-0.08cm}, drop shadow={shadow xshift=0.08cm, shadow yshift=-0.08cm},
font=\small, align=center,
align=center rounded corners,
}, },
smallmsg/.style={ smallmsg/.style={
draw, draw,
fill=white, fill=white,
font=\small, font=\scriptsize,
align=left, align=left,
minimum height=0.9cm, text width=3cm,
text width=4.2cm rounded corners=4pt,
}, minimum height=0.5cm,
memitem/.style={ },
memitem/.style={
draw, draw,
fill=white, fill=white,
font=\small, font=\scriptsize,
align=left, align=left,
minimum height=0.7cm, minimum height=0.5cm,
text width=3.2cm text width=3.8cm,
}, rounded corners
opseg/.style={ },
opseg/.style={
draw, draw,
fill=white, fill=white,
font=\small\bfseries, font=\scriptsize\bfseries,
align=center, align=center,
minimum height=1.1cm, minimum height=0.6cm,
minimum width=2.5cm text width=1.3cm,
}, rounded corners,
arrow/.style={ },
arrow/.style={
->, ->,
thick thick
} }
] ]
% ======================= \node[box, minimum width=5.6cm, minimum height=5.6cm] (conv) at (0,0) {};
% Conversation container \node[font=\scriptsize\bfseries, rotate=90,anchor=north east] at (conv.north east) {Conversation};
% =======================
\node[box, minimum width=7.6cm, minimum height=6.5cm] (conv) at (0,0) {}; \path
\node[font=\small\bfseries, rotate=90] at ($(conv.east)+(0.35,0)$) {Conversation}; ([yshift=-0.3cm]conv.north west) node [anchor=north west,text width=0.4cm] (historyicon) {\faIcon{history}}
(historyicon.north east) node[smallmsg, anchor=north west,text width=] (histmsg) {\textbf{[History Messages]}};
\node[smallmsg, anchor=north] (usermsg) at ($(conv.north)+(0,-0.8)$) {
\textbf{User message:}\\ \path
Plan a trip to Kyoto next week. ([yshift=-0.3cm]histmsg.south-|conv.east) node [anchor=north east,text width=0.4cm,align=right] (usericon) {\faIcon{user}}
}; (usericon.north west) node[smallmsg, anchor=north east] (usermsg) {Plan a trip to Kyoto next week.};
\node[smallmsg, anchor=north] (assistantmsg) at ($(usermsg.south)+(0,-0.65)$) { \path
\textbf{Assistant:}\\ ([yshift=-0.3cm]usermsg.south-|conv.west) node [anchor=north west,text width=0.4cm] (roboticon) {\faIcon{robot}}
I will check your travel preferences and past choices. (roboticon.north east) node[smallmsg, anchor=north west] (robotmsg0) {I will check your travel preferences and past choices.};
};
\path
\node[smallmsg, anchor=north] (usedmem) at ($(assistantmsg.south)+(0,-0.95)$) { ([yshift=-0.3cm]robotmsg0.south-|conv.east) node [anchor=north east,text width=0.4cm,align=right] (infoicon) {\faIcon{info-circle}}
\textbf{Used memories:}\\ (infoicon.north west) node[smallmsg, anchor=north east] (infomsg)
$\bullet$ prefers window seat\\ {$\bullet$ prefers window seat\\ $\bullet$ vegetarian meals\\ $\bullet$ budget hotel};
$\bullet$ vegetarian meals\\
$\bullet$ budget hotel \path
}; ([yshift=-0.3cm]infomsg.south-|conv.west) node [anchor=north west,text width=0.4cm] (roboticon) {\faIcon{robot}}
(roboticon.north east) node[smallmsg, anchor=north west] (robotmsg) {...};
% =======================
% Memory bank \node[box, minimum width=5cm, minimum height=4.8cm] (memory) at ([xshift=8cm]conv) {};
% ======================= \node[font=\small\bfseries] at ($(memory.north)+(0,-0.35)$) {Memory Bank};
\node[box, minimum width=4.8cm, minimum height=4.1cm] (memory) at (8.2,-0.3) {};
\node[font=\small\bfseries] at ($(memory.north)+(0,-0.35)$) {Memory Bank}; \node[memitem, anchor=north,align=center] (m1) at ([yshift=-0.9cm]memory.north) {\textbf{Key 1}\\ prefers vegetarian meals};
\node[memitem, anchor=north,align=center] (m2) at ([yshift=-0.2cm]m1.south) {\textbf{Key 2}\\ prefers window seat};
\node[memitem, anchor=north] (m1) at ($(memory.north)+(0,-0.9)$) {Key 1: prefers vegetarian meals}; \node[memitem, anchor=north,align=center] (m3) at ([yshift=-0.2cm]m2.south) {\textbf{Key 3}\\ usually books budget hotels};
\node[memitem, anchor=north] (m2) at ($(m1.south)+(0,-0.15)$) {Key 2: prefers window seat}; \node[memitem, anchor=north,align=center] (m4) at ([yshift=-0.2cm]m3.south) {\textbf{Key ...}\\ ...};
\node[memitem, anchor=north] (m3) at ($(m2.south)+(0,-0.15)$) {Key 3: usually books budget hotels};
\draw[arrow] (conv.east|-robotmsg0.east) -- node[above, font=\scriptsize,align=center] {retrieve \\ relevant memories} (memory.west|-robotmsg0.east);
% ======================= \draw[arrow] (memory.west|-infomsg.east) -- node[above, font=\scriptsize,align=center] {useful memories} (conv.east|-infomsg.east);
% Operation box
% ======================= \scriptsize
\node[opseg] (add) at (1.4,-5.0) {ADD}; \node[box, text width=4cm, minimum height=2cm,anchor=north west,align=left] (memext) at ([yshift=-.5cm]conv.south west)
\node[opseg, right=0cm of add] (update) {UPDATE}; {\centering\textbf{\small Extract Memories} \\[.2cm] Integrate the newly extracted information with existing memories};
\node[opseg, right=0cm of update] (delete) {DELETE};
\node[opseg, right=0cm of delete] (noop) {NOOP}; \node[box, text width=7.5cm, minimum height=2cm,anchor=north east,align=center] (llmupdatemem) at ([yshift=-.5cm]conv.south-|memory.south east)
{\textbf{\small Memory Manager} \vspace{1.cm}};
% outer frame for the operation bar
\draw[thick] \node[opseg,anchor=south west] (add) at ([xshift=.35cm,yshift=.3cm]llmupdatemem.south west) {ADD};
($(add.north west)+(-0.08,0.08)$) rectangle \node[opseg, right=.3cm of add] (update) {UPDATE};
($(noop.south east)+(0.08,-0.08)$); \node[opseg, right=.3cm of update] (delete) {DELETE};
\node[opseg, right=.3cm of delete] (noop) {NOOP};
% =======================
% Arrows and labels \draw[] ([xshift=-.1cm,yshift=.1cm]add.north west) rectangle ([xshift=.1cm,yshift=-.1cm]noop.south east);
% =======================
\draw[arrow] (memext.center|-conv.south) -- node[right, font=\scriptsize] {new or updated memories} (memext.north);
% retrieval: conversation -> memory \draw[arrow] (memext) -- (llmupdatemem);
\draw[arrow] ($(conv.east)+(0,-0.25)$) -- node[above, font=\small] {retrieve relevant memories} ($(memory.west)+(0,0.45)$); \draw[arrow] (memory.south|-llmupdatemem.north) -- node[right,font=\scriptsize] {operate} (memory.south);
% use retrieved memory: memory -> conversation \end{tikzpicture}
\draw[arrow] ($(memory.west)+(0,-0.45)$) -- node[below, font=\small] {use memories} ($(conv.east)+(0,-1.1)$);
\end{center}
% new / updated memory from conversation -> operations
\draw[arrow]
($(conv.south)+(-2.0,0)$) -- ++(0,-0.75) -- ++(0,-0.7)
-- node[above, font=\small] {new or updated memories} ($(add.west)+(-0.65,0)$);
% operation -> memory
\draw[arrow]
($(update.north)+(0,0.08)$) -- ++(0,1.55)
-- node[right, font=\small] {update} ($(memory.south)+(0,-0.05)$);
\end{tikzpicture}
\ No newline at end of file
\begin{tikzpicture}[
box/.style={
\begin{center}
\begin{tikzpicture}[
box/.style={
draw, draw,
fill=white, fill=white,
drop shadow={shadow xshift=0.08cm, shadow yshift=-0.08cm}, drop shadow={shadow xshift=0.08cm, shadow yshift=-0.08cm},
font=\small, font=\scriptsize,
align=center, align=center,
minimum height=1.2cm minimum height=1.2cm
}, },
arrow/.style={ arrow/.style={
->, ->,
thick thick
}, }
reward/.style={ ]
<->,
thick,
dashed
}
]
% Extracted memory
\node[box, text width=2.8cm] (extracted) {
\textbf{Extracted Memory}\\[0.1cm]
$x^{\mathrm{mem}}$
};
% Memory manager
\node[box, text width=3.2cm, right=1.5cm of extracted] (manager) {
\textbf{Memory Manager}\\[0.1cm]
$\pi_\theta$\\
Select memory operation
};
% Memory bank % Extracted memory
\node[box, text width=3.2cm, below=0.8cm of manager] (bank) { \node[box, text width=3cm,align=left] (extracted)
\textbf{Memory Bank}\\[0.1cm] {\begin{center} \textbf{Extracted Memory} \end{center} \\[0.1cm]
$\mathcal{M}_{old} $\bullet$ prefers window seat\\ $\bullet$ vegetarian meals\\ $\bullet$ budget hotel};
\rightarrow
\mathcal{M}_{new}$
};
% Agent % Memory manager
\node[box, text width=2.8cm, right=2.0cm of manager] (agent) { \node[box, text width=3cm, right=1.5cm of extracted] (manager) {
\textbf{Agent}\\[0.1cm] \textbf{Memory Manager}
Downstream task solving };
};
% Reward % Memory bank
\node[box, text width=2.8cm, below=1.4cm of agent] (rewardbox) { \node[box, text width=3cm, below=0.8cm of manager] (bank) {
\textbf{Task Feedback}\\[0.1cm] \textbf{Memory Bank}\\[0.1cm]
Reward $R$ $\mathcal{M}_{old}
}; \rightarrow
\mathcal{M}_{new}$
};
% Dashed container for memory manager % Agent
\node[ \node[box, text width=2.8cm, right=2.0cm of bank.east] (agent) {
draw, \textbf{Agent}\\[0.1cm]
dashed, Downstream task solving
rounded corners, };
inner sep=0.35cm,
fit=(manager)(bank),
label={[font=\small]above:Learnable Memory Management}
] (managerbox) {};
% Arrows % Reward
\draw[arrow] (extracted) -- node[above,font=\small] {input} (manager); \node[box, text width=2.8cm, right=2.0cm of manager.east] (rewardbox) {
\textbf{Task Feedback}\\[0.1cm]
Reward $R$
};
\draw[arrow] (manager) -- node[right,font=\small] {operation} (bank); % Dashed container for memory manager
\node[
\draw[arrow] (bank.east) -- ++(0.8,0) draw,
|- node[pos=0.25,above,font=\small] {retrieve} dashed,
(agent.west); rounded corners,
inner sep=0.35cm,
\draw[arrow] (agent.west) -- ++(-0.8,0) fit=(manager)(bank),
|- node[pos=0.25,below,font=\small] {updated memory} label={[font=\scriptsize]above:Learnable Memory Management}
(bank.east); ] (managerbox) {};
\draw[reward] (agent.south) -- node[right,font=\small] {feedback} (rewardbox.north);
\draw[reward] (rewardbox.west) -- ++(-1.5,0) % Arrows
|- node[pos=0.25,left,font=\small] {RL optimization} \draw[arrow] (extracted) -- node[xshift=-.2cm,above,font=\scriptsize] {input} (manager);
(manager.south); \draw[arrow] (manager) -- node[xshift=0.1cm,center,font=\scriptsize] {sampling operations} (bank);
\draw[arrow] ([yshift=0.2cm]bank.east) -- node[above,font=\scriptsize] {retrieve} ([yshift=0.2cm]agent.west);
\draw[arrow] ([yshift=-0.2cm]agent.west) -- node[below,font=\scriptsize,align=right] {updated\\ memory} ([yshift=-0.2cm]bank.east);
\draw[arrow] (agent.north) -- node[right,font=\scriptsize] {feedback} (rewardbox.south);
\draw[arrow] (rewardbox.west) -- node[xshift=0.2cm,font=\scriptsize,align=center] {RL \\optimization} (manager.east);
\end{tikzpicture} \end{tikzpicture}
\ No newline at end of file \end{center}
...@@ -340,8 +340,7 @@ Memory management is a direct way for agents to learn from agentic experience. D ...@@ -340,8 +340,7 @@ Memory management is a direct way for agents to learn from agentic experience. D
\begin{figure}[!t] \begin{figure}[!t]
\centering \centering
\resizebox{\linewidth}{!}{ \input{section6/Figures/memory-and-retrieval.tex}
\input{section6/Figures/memory-and-retrieval.tex}}
\caption{ \caption{
An overview of the memory system. An overview of the memory system.
} }
...@@ -354,8 +353,7 @@ In learning from experience, it is easy to observe that the performance of memor ...@@ -354,8 +353,7 @@ In learning from experience, it is easy to observe that the performance of memor
\begin{figure}[!t] \begin{figure}[!t]
\centering \centering
\resizebox{\linewidth}{!}{ \input{section6/Figures/reinfroced-memory-manager.tex}
\input{section6/Figures/reinfroced-memory-manager.tex}}
\caption{Overview of training a memory manager with RL.} \caption{Overview of training a memory manager with RL.}
\label{fig:reinforced-memory} \label{fig:reinforced-memory}
\end{figure} \end{figure}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论