Commit 2960fdf8 by 周航

Update figures in section6

parent d849274f
% Required:
% \usetikzlibrary{positioning,calc,shadows}
\begin{tikzpicture}[
box/.style={
draw,
fill=white,
drop shadow={shadow xshift=0.08cm, shadow yshift=-0.08cm},
font=\small,
align=center
},
smallmsg/.style={
draw,
fill=white,
font=\small,
align=left,
minimum height=0.9cm,
text width=4.2cm
},
memitem/.style={
draw,
fill=white,
font=\small,
align=left,
minimum height=0.7cm,
text width=3.2cm
},
opseg/.style={
draw,
fill=white,
font=\small\bfseries,
align=center,
minimum height=1.1cm,
minimum width=2.5cm
},
arrow/.style={
->,
thick
}
]
% =======================
% Conversation container
% =======================
\node[box, minimum width=7.6cm, minimum height=6.5cm] (conv) at (0,0) {};
\node[font=\small\bfseries, rotate=90] at ($(conv.east)+(0.35,0)$) {Conversation};
\node[smallmsg, anchor=north] (usermsg) at ($(conv.north)+(0,-0.8)$) {
\textbf{User message:}\\
Plan a trip to Kyoto next week.
};
\node[smallmsg, anchor=north] (assistantmsg) at ($(usermsg.south)+(0,-0.65)$) {
\textbf{Assistant:}\\
I will check your travel preferences and past choices.
};
\node[smallmsg, anchor=north] (usedmem) at ($(assistantmsg.south)+(0,-0.95)$) {
\textbf{Used memories:}\\
$\bullet$ prefers window seat\\
$\bullet$ vegetarian meals\\
$\bullet$ budget hotel
};
% =======================
% 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] (m1) at ($(memory.north)+(0,-0.9)$) {Key 1: prefers vegetarian meals};
\node[memitem, anchor=north] (m2) at ($(m1.south)+(0,-0.15)$) {Key 2: prefers window seat};
\node[memitem, anchor=north] (m3) at ($(m2.south)+(0,-0.15)$) {Key 3: usually books budget hotels};
% =======================
% Operation box
% =======================
\node[opseg] (add) at (1.4,-5.0) {ADD};
\node[opseg, right=0cm of add] (update) {UPDATE};
\node[opseg, right=0cm of update] (delete) {DELETE};
\node[opseg, right=0cm of delete] (noop) {NOOP};
% outer frame for the operation bar
\draw[thick]
($(add.north west)+(-0.08,0.08)$) rectangle
($(noop.south east)+(0.08,-0.08)$);
% =======================
% Arrows and labels
% =======================
% retrieval: conversation -> memory
\draw[arrow] ($(conv.east)+(0,-0.25)$) -- node[above, font=\small] {retrieve relevant memories} ($(memory.west)+(0,0.45)$);
% use retrieved memory: memory -> conversation
\draw[arrow] ($(memory.west)+(0,-0.45)$) -- node[below, font=\small] {use memories} ($(conv.east)+(0,-1.1)$);
% 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{center}
\begin{tikzpicture}[
box/.style={
draw,
fill=white,
drop shadow={shadow xshift=0.08cm, shadow yshift=-0.08cm},
align=center,
rounded corners,
},
smallmsg/.style={
draw,
fill=white,
font=\scriptsize,
align=left,
text width=3cm,
rounded corners=4pt,
minimum height=0.5cm,
},
memitem/.style={
draw,
fill=white,
font=\scriptsize,
align=left,
minimum height=0.5cm,
text width=3.8cm,
rounded corners
},
opseg/.style={
draw,
fill=white,
font=\scriptsize\bfseries,
align=center,
minimum height=0.6cm,
text width=1.3cm,
rounded corners,
},
arrow/.style={
->,
thick
}
]
\node[box, minimum width=5.6cm, minimum height=5.6cm] (conv) at (0,0) {};
\node[font=\scriptsize\bfseries, rotate=90,anchor=north east] at (conv.north east) {Conversation};
\path
([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]}};
\path
([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.};
\path
([yshift=-0.3cm]usermsg.south-|conv.west) node [anchor=north west,text width=0.4cm] (roboticon) {\faIcon{robot}}
(roboticon.north east) node[smallmsg, anchor=north west] (robotmsg0) {I will check your travel preferences and past choices.};
\path
([yshift=-0.3cm]robotmsg0.south-|conv.east) node [anchor=north east,text width=0.4cm,align=right] (infoicon) {\faIcon{info-circle}}
(infoicon.north west) node[smallmsg, anchor=north east] (infomsg)
{$\bullet$ prefers window seat\\ $\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) {...};
\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[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,align=center] (m3) at ([yshift=-0.2cm]m2.south) {\textbf{Key 3}\\ usually books budget hotels};
\node[memitem, anchor=north,align=center] (m4) at ([yshift=-0.2cm]m3.south) {\textbf{Key ...}\\ ...};
\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);
\scriptsize
\node[box, text width=4cm, minimum height=2cm,anchor=north west,align=left] (memext) at ([yshift=-.5cm]conv.south west)
{\centering\textbf{\small Extract Memories} \\[.2cm] Integrate the newly extracted information with existing memories};
\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}};
\node[opseg,anchor=south west] (add) at ([xshift=.35cm,yshift=.3cm]llmupdatemem.south west) {ADD};
\node[opseg, right=.3cm of add] (update) {UPDATE};
\node[opseg, right=.3cm of update] (delete) {DELETE};
\node[opseg, right=.3cm of delete] (noop) {NOOP};
\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);
\draw[arrow] (memext) -- (llmupdatemem);
\draw[arrow] (memory.south|-llmupdatemem.north) -- node[right,font=\scriptsize] {operate} (memory.south);
\end{tikzpicture}
\end{center}
\begin{tikzpicture}[
box/.style={
draw,
fill=white,
drop shadow={shadow xshift=0.08cm, shadow yshift=-0.08cm},
font=\small,
align=center,
minimum height=1.2cm
},
arrow/.style={
->,
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
\node[box, text width=3.2cm, below=0.8cm of manager] (bank) {
\textbf{Memory Bank}\\[0.1cm]
$\mathcal{M}_{old}
\rightarrow
\mathcal{M}_{new}$
};
% Agent
\node[box, text width=2.8cm, right=2.0cm of manager] (agent) {
\textbf{Agent}\\[0.1cm]
Downstream task solving
};
\begin{center}
\begin{tikzpicture}[
box/.style={
draw,
fill=white,
drop shadow={shadow xshift=0.08cm, shadow yshift=-0.08cm},
font=\scriptsize,
align=center,
minimum height=1.2cm
},
arrow/.style={
->,
thick
}
]
% Reward
\node[box, text width=2.8cm, below=1.4cm of agent] (rewardbox) {
\textbf{Task Feedback}\\[0.1cm]
Reward $R$
};
% Extracted memory
\node[box, text width=3cm,align=left] (extracted)
{\begin{center} \textbf{Extracted Memory} \end{center} \\[0.1cm]
$\bullet$ prefers window seat\\ $\bullet$ vegetarian meals\\ $\bullet$ budget hotel};
% Dashed container for memory manager
\node[
draw,
dashed,
rounded corners,
inner sep=0.35cm,
fit=(manager)(bank),
label={[font=\small]above:Learnable Memory Management}
] (managerbox) {};
% Memory manager
\node[box, text width=3cm, right=1.5cm of extracted] (manager) {
\textbf{Memory Manager}
};
% Arrows
\draw[arrow] (extracted) -- node[above,font=\small] {input} (manager);
% Memory bank
\node[box, text width=3cm, below=0.8cm of manager] (bank) {
\textbf{Memory Bank}\\[0.1cm]
$\mathcal{M}_{old}
\rightarrow
\mathcal{M}_{new}$
};
\draw[arrow] (manager) -- node[right,font=\small] {operation} (bank);
% Agent
\node[box, text width=2.8cm, right=2.0cm of bank.east] (agent) {
\textbf{Agent}\\[0.1cm]
Downstream task solving
};
\draw[arrow] (bank.east) -- ++(0.8,0)
|- node[pos=0.25,above,font=\small] {retrieve}
(agent.west);
% Reward
\node[box, text width=2.8cm, right=2.0cm of manager.east] (rewardbox) {
\textbf{Task Feedback}\\[0.1cm]
Reward $R$
};
\draw[arrow] (agent.west) -- ++(-0.8,0)
|- node[pos=0.25,below,font=\small] {updated memory}
(bank.east);
\draw[reward] (agent.south) -- node[right,font=\small] {feedback} (rewardbox.north);
% Dashed container for memory manager
\node[
draw,
dashed,
rounded corners,
inner sep=0.35cm,
fit=(manager)(bank),
label={[font=\scriptsize]above:Learnable Memory Management}
] (managerbox) {};
\draw[reward] (rewardbox.west) -- ++(-1.5,0)
|- node[pos=0.25,left,font=\small] {RL optimization}
(manager.south);
% Arrows
\draw[arrow] (extracted) -- node[xshift=-.2cm,above,font=\scriptsize] {input} (manager);
\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}
\ No newline at end of file
\end{tikzpicture}
\end{center}
......@@ -340,8 +340,7 @@ Memory management is a direct way for agents to learn from agentic experience. D
\begin{figure}[!t]
\centering
\resizebox{\linewidth}{!}{
\input{section6/Figures/memory-and-retrieval.tex}}
\input{section6/Figures/memory-and-retrieval.tex}
\caption{
An overview of the memory system.
}
......@@ -354,8 +353,7 @@ In learning from experience, it is easy to observe that the performance of memor
\begin{figure}[!t]
\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.}
\label{fig:reinforced-memory}
\end{figure}
......@@ -566,4 +564,4 @@ It is worth noting that we can obtain feedback from either internal evaluation o
The above approaches mainly rely on prompting to enable trajectory refinement. Such approaches still face several limitations. First, their performance is bounded by the intrinsic refinement ability of the LLM. A pre-trained LLM may not naturally know how to interpret feedback and effectively revise its trajectory without additional optimization. Second, prompt-based refinement mainly improves the current trajectory at inference time, which limits its ability to accumulate and transfer experience across tasks. As discussed in Sections~\ref{sec:memory-management} and~\ref{sec:skill-optimization}, failed trajectories contain valuable experiences about agent weaknesses and can provide useful learning signals for improving future behaviors. However, prompting-based approaches only leverage these experiences within the current interaction context. To address these limitations, recent studies explore training agents to acquire trajectory refinement abilities \citep{fu-etal:agentrefine}, either by updating model parameters or optimizing refinement behaviors based on collected experiences \citep{song-etal:trial}. Interested readers can refer to these works for more information.
Although trajectory refinement does not explicitly update model parameters like traditional RL, it shares the fundamental principle of RL: improving agent behaviors based on feedback collected from interactions. From the perspective of in-context learning, the feedback obtained during trajectory refinement can be viewed as a temporary reward signal that modifies the agent's subsequent decision-making process. Instead of updating policy parameters, the agent updates its context with reflections, which potentially modifies the policy used for future actions within the current interaction. Therefore, trajectory refinement can be regarded as an in-context form of policy improvement. This perspective is closely related to the emerging research direction of \textit{in-context RL} (namely ICRL), which studies how agents can adapt their behaviors through interaction feedback without explicit parameter updates \citep{monea-etal:llms}.
\ No newline at end of file
Although trajectory refinement does not explicitly update model parameters like traditional RL, it shares the fundamental principle of RL: improving agent behaviors based on feedback collected from interactions. From the perspective of in-context learning, the feedback obtained during trajectory refinement can be viewed as a temporary reward signal that modifies the agent's subsequent decision-making process. Instead of updating policy parameters, the agent updates its context with reflections, which potentially modifies the policy used for future actions within the current interaction. Therefore, trajectory refinement can be regarded as an in-context form of policy improvement. This perspective is closely related to the emerging research direction of \textit{in-context RL} (namely ICRL), which studies how agents can adapt their behaviors through interaction feedback without explicit parameter updates \citep{monea-etal:llms}.
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论