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={
draw, \begin{tikzpicture}[
fill=white, box/.style={
drop shadow={shadow xshift=0.08cm, shadow yshift=-0.08cm}, draw,
font=\small, fill=white,
align=center drop shadow={shadow xshift=0.08cm, shadow yshift=-0.08cm},
}, align=center,
smallmsg/.style={ rounded corners,
draw, },
fill=white, smallmsg/.style={
font=\small, draw,
align=left, fill=white,
minimum height=0.9cm, font=\scriptsize,
text width=4.2cm align=left,
}, text width=3cm,
memitem/.style={ rounded corners=4pt,
draw, minimum height=0.5cm,
fill=white, },
font=\small, memitem/.style={
align=left, draw,
minimum height=0.7cm, fill=white,
text width=3.2cm font=\scriptsize,
}, align=left,
opseg/.style={ minimum height=0.5cm,
draw, text width=3.8cm,
fill=white, rounded corners
font=\small\bfseries, },
align=center, opseg/.style={
minimum height=1.1cm, draw,
minimum width=2.5cm fill=white,
}, font=\scriptsize\bfseries,
arrow/.style={ align=center,
->, minimum height=0.6cm,
thick text width=1.3cm,
} rounded corners,
] },
arrow/.style={
% ======================= ->,
% Conversation container thick
% ======================= }
\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[box, minimum width=5.6cm, minimum height=5.6cm] (conv) at (0,0) {};
\node[smallmsg, anchor=north] (usermsg) at ($(conv.north)+(0,-0.8)$) { \node[font=\scriptsize\bfseries, rotate=90,anchor=north east] at (conv.north east) {Conversation};
\textbf{User message:}\\
Plan a trip to Kyoto next week. \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]}};
\node[smallmsg, anchor=north] (assistantmsg) at ($(usermsg.south)+(0,-0.65)$) {
\textbf{Assistant:}\\ \path
I will check your travel preferences and past choices. ([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] (usedmem) at ($(assistantmsg.south)+(0,-0.95)$) { \path
\textbf{Used memories:}\\ ([yshift=-0.3cm]usermsg.south-|conv.west) node [anchor=north west,text width=0.4cm] (roboticon) {\faIcon{robot}}
$\bullet$ prefers window seat\\ (roboticon.north east) node[smallmsg, anchor=north west] (robotmsg0) {I will check your travel preferences and past choices.};
$\bullet$ vegetarian meals\\
$\bullet$ budget hotel \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};
% Memory bank
% ======================= \path
\node[box, minimum width=4.8cm, minimum height=4.1cm] (memory) at (8.2,-0.3) {}; ([yshift=-0.3cm]infomsg.south-|conv.west) node [anchor=north west,text width=0.4cm] (roboticon) {\faIcon{robot}}
\node[font=\small\bfseries] at ($(memory.north)+(0,-0.35)$) {Memory Bank}; (roboticon.north east) node[smallmsg, anchor=north west] (robotmsg) {...};
\node[memitem, anchor=north] (m1) at ($(memory.north)+(0,-0.9)$) {Key 1: prefers vegetarian meals}; \node[box, minimum width=5cm, minimum height=4.8cm] (memory) at ([xshift=8cm]conv) {};
\node[memitem, anchor=north] (m2) at ($(m1.south)+(0,-0.15)$) {Key 2: prefers window seat}; \node[font=\small\bfseries] at ($(memory.north)+(0,-0.35)$) {Memory Bank};
\node[memitem, anchor=north] (m3) at ($(m2.south)+(0,-0.15)$) {Key 3: usually books budget hotels};
\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};
% Operation box \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 ...}\\ ...};
\node[opseg] (add) at (1.4,-5.0) {ADD};
\node[opseg, right=0cm of add] (update) {UPDATE}; \draw[arrow] (conv.east|-robotmsg0.east) -- node[above, font=\scriptsize,align=center] {retrieve \\ relevant memories} (memory.west|-robotmsg0.east);
\node[opseg, right=0cm of update] (delete) {DELETE}; \draw[arrow] (memory.west|-infomsg.east) -- node[above, font=\scriptsize,align=center] {useful memories} (conv.east|-infomsg.east);
\node[opseg, right=0cm of delete] (noop) {NOOP};
\scriptsize
% outer frame for the operation bar \node[box, text width=4cm, minimum height=2cm,anchor=north west,align=left] (memext) at ([yshift=-.5cm]conv.south west)
\draw[thick] {\centering\textbf{\small Extract Memories} \\[.2cm] Integrate the newly extracted information with existing memories};
($(add.north west)+(-0.08,0.08)$) rectangle
($(noop.south east)+(0.08,-0.08)$); \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}};
% =======================
% Arrows and labels \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};
% retrieval: conversation -> memory \node[opseg, right=.3cm of delete] (noop) {NOOP};
\draw[arrow] ($(conv.east)+(0,-0.25)$) -- node[above, font=\small] {retrieve relevant memories} ($(memory.west)+(0,0.45)$);
\draw[] ([xshift=-.1cm,yshift=.1cm]add.north west) rectangle ([xshift=.1cm,yshift=-.1cm]noop.south east);
% use retrieved memory: memory -> conversation
\draw[arrow] ($(memory.west)+(0,-0.45)$) -- node[below, font=\small] {use memories} ($(conv.east)+(0,-1.1)$); \draw[arrow] (memext.center|-conv.south) -- node[right, font=\scriptsize] {new or updated memories} (memext.north);
\draw[arrow] (memext) -- (llmupdatemem);
% new / updated memory from conversation -> operations \draw[arrow] (memory.south|-llmupdatemem.north) -- node[right,font=\scriptsize] {operate} (memory.south);
\draw[arrow]
($(conv.south)+(-2.0,0)$) -- ++(0,-0.75) -- ++(0,-0.7) \end{tikzpicture}
-- node[above, font=\small] {new or updated memories} ($(add.west)+(-0.65,0)$);
\end{center}
% 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={
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 \begin{center}
\node[box, text width=2.8cm, right=2.0cm of manager] (agent) { \begin{tikzpicture}[
\textbf{Agent}\\[0.1cm] box/.style={
Downstream task solving 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 % Extracted memory
\node[box, text width=2.8cm, below=1.4cm of agent] (rewardbox) { \node[box, text width=3cm,align=left] (extracted)
\textbf{Task Feedback}\\[0.1cm] {\begin{center} \textbf{Extracted Memory} \end{center} \\[0.1cm]
Reward $R$ $\bullet$ prefers window seat\\ $\bullet$ vegetarian meals\\ $\bullet$ budget hotel};
};
% Dashed container for memory manager % Memory manager
\node[ \node[box, text width=3cm, right=1.5cm of extracted] (manager) {
draw, \textbf{Memory Manager}
dashed, };
rounded corners,
inner sep=0.35cm,
fit=(manager)(bank),
label={[font=\small]above:Learnable Memory Management}
] (managerbox) {};
% Arrows % Memory bank
\draw[arrow] (extracted) -- node[above,font=\small] {input} (manager); \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) % Reward
|- node[pos=0.25,above,font=\small] {retrieve} \node[box, text width=2.8cm, right=2.0cm of manager.east] (rewardbox) {
(agent.west); \textbf{Task Feedback}\\[0.1cm]
Reward $R$
};
\draw[arrow] (agent.west) -- ++(-0.8,0) % Dashed container for memory manager
|- node[pos=0.25,below,font=\small] {updated memory} \node[
(bank.east); draw,
dashed,
\draw[reward] (agent.south) -- node[right,font=\small] {feedback} (rewardbox.north); rounded corners,
inner sep=0.35cm,
fit=(manager)(bank),
label={[font=\scriptsize]above:Learnable Memory Management}
] (managerbox) {};
\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}
...@@ -566,4 +564,4 @@ It is worth noting that we can obtain feedback from either internal evaluation o ...@@ -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. 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}. 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
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论