SwitchMem · GUI Agent Memory

Learning How to Remember:
Memory Modality Selection for GUI Agents

Taeyun Roh1, Suhyeong Park1, Gijin Kim1, Wonjune Jang2, Jaewoo Kang1,3

1Korea University · 2Myongji University · 3AIGEN Sciences

nrbsld@korea.ac.kr · kangj@korea.ac.kr

The same experience can help an agent differently when presented as text or an image. SwitchMem learns to select the memory modality that fits each interaction step, giving a frozen GUI agent the right representation of its past experience.

Offline training contrasts the actor's Text and Image hidden states to create a preference target. At inference, a shared pairwise MLP selects one memory modality for the frozen actor.
Learn a preference signal offline. Select one memory modality at each step. Figure 5 in the paper.

Problem

One memory modality cannot fit every step.

GUI agents reuse demonstrations to navigate unfamiliar interfaces and avoid repeated errors. Most memory systems commit to a fixed representation: text, screenshots, or both together.

Text offers a compact semantic abstraction, while images preserve layout and appearance. Their usefulness changes with the current interface and the action the agent needs to take. SwitchMem treats this choice as part of the interaction loop.

Motivating Observation

Neither text nor images consistently dominate.

With the retrieved demonstration held fixed, Text and Image each win on substantial subsets of interaction steps. A step-wise oracle reveals the headroom left by a fixed memory policy.

A nearly even split

Share of non-tied steps by preferred modality.

AITW
LearnGUI

Text memory Image memory

Figure 2 in the paper.

The cost of a fixed choice

Action score (%), best fixed modality → step-wise oracle.

AITW
49.355.9
LearnGUI
37.443.4

Figure 3 in the paper. The oracle uses ground-truth scores to choose between two generated actions; it is an analysis reference.

Method

From hidden-state shifts to a memory router.

SwitchMem uses the actor's internal response to memory modality as supervision. A lightweight pairwise router then predicts this preference from the current GUI state and the retrieved memory candidates.

01 · Observe

Directional CoE

Run the frozen actor with Text and Image versions of the same retrieved demonstration. Keep the signed hidden-state shift hI − hT at the final prompt token. Deeper layers expose a stronger modality-preference signal.

02 · Learn

Preference supervision

Standardize the final-layer shift, reduce it to 64 dimensions with PCA, and fit a logistic probe on sampled action preferences. Its continuous decision value becomes the target for training a shared MLP scorer.

03 · Select

Step-wise routing

Score both memory candidates against the current-state representation. Select Image when the score difference reaches the calibrated threshold; otherwise select Text. Pass the chosen memory to the frozen actor to generate its next action.

Routing Rule

r = qI − qTr ≥ Ï„: Image memory   /   otherwise: Text memory

The main experiments use a frozen Qwen3.5-9B actor and Qwen3-VL-Embedding-2B for retrieval and memory embeddings. Both candidates represent the same top-1 retrieved demonstration.

Main Results

Strongest performance across three GUI benchmarks.

SwitchMem improves over every fixed memory condition and the evaluated memory-augmentation baselines with the same frozen Qwen3.5-9B actor.

51.420%AITW action score

+2.120 points over Image

38.131%LearnGUI action score

+0.690 points over Image

63.043%MobileMiniWoB++ task success

+2.173 points over Both

Table 1 in the paper. All rows below use Qwen3.5-9B. Scores are percentages; higher is better.

Qwen3.5-9B performance on AITW, LearnGUI, and MobileMiniWoB++.
MethodAITWLearnGUIMobileMiniWoB++
No memory41.92023.48558.696
RAG-GUI18.30024.1869.783
M3A17.20020.89941.304
AppAgent14.78031.10425.000
Text memory48.76035.63853.261
Image memory49.30037.44157.609
Both modalities47.08026.91960.870
EchoTrail45.90027.28655.435
AGMem45.38028.36652.174
SwitchMem (Ours)51.42038.13163.043

AITW and LearnGUI use benchmark-specific step-level action scores. MobileMiniWoB++ measures closed-loop task success (58/92 tasks). Its router weights are transferred from LearnGUI; the threshold is calibrated without actions, rewards, or task-success labels.

Routing Behavior

The choice changes within a trajectory.

SwitchMem frequently uses both modalities over the course of a task, while retaining a chosen modality for consecutive steps. Its policy adapts to interface state rather than assigning one modality to the entire task.

Table 2 in the paper. Dual-modality trajectories use Text on some steps and Image on others.

Within-trajectory memory routing behavior.
BenchmarkDual-modality
trajectories (%)
Image-routed
steps (%)
Mean switches
per trajectory
Mean run
length (steps)
AITW83.836.51.722.42
LearnGUI90.881.31.794.95
MobileMiniWoB++57.876.31.564.50

Analysis

Useful routing depends on which step gets which memory.

Actor-derived preference supervision outperforms simpler routing targets. SwitchMem also beats ratio-matched random selection at every evaluated intermediate Image-use rate on LearnGUI: gains come from assigning modalities to appropriate steps.

LearnGUI analysis: SwitchMem scores 38.131 versus 37.441 for Image memory, exceeds ratio-matched random routing, and attains the highest action score in the latency comparison.
Routing supervision, modality budgets, and the latency–performance trade-off on LearnGUI. Figure 7 in the paper.
UI Density

Visually dense screens

Image memory becomes more useful when fine-grained layouts contain dense UI elements. SwitchMem increases Image selection in these states.

Action Context

Function-oriented actions

The Image-over-Text utility gap grows for actions governing interface functionality, task status, or system navigation.

Trajectory Progress

Evolving interfaces

Image memory becomes more useful after the initial state, as interface changes introduce visual details that textual abstraction may lose.

At inference, SwitchMem obtains a current-state hidden representation for routing and then generates an action with the selected memory. It avoids evaluating both memory-conditioned action prompts online. The latency comparison uses the same RTX PRO 6000 GPU for all methods.

Generalization

The routing formulation works with a GUI-specialized actor.

Applying the preference-construction and routing protocol to UI-TARS-7B-SFT also produces the best scores across all three benchmarks, exceeding its strongest fixed memory condition.

Table 3 in the paper. UI-TARS-7B-SFT scores (%).

SwitchMem with the UI-TARS-7B-SFT actor.
MemoryAITWLearnGUIMobileMiniWoB++
No memory29.98025.70523.913
Text32.64038.23032.609
Image30.44040.99733.696
SwitchMem (Ours)33.68041.05536.957

Takeaway

How an agent remembers is part of how it acts.

Retrieving a relevant experience is only part of the problem. Choosing its representation matters too. Memory modality preference varies across steps and is reflected in the actor's internal representations.

SwitchMem turns that signal into a practical routing policy, combining the complementary strengths of text and image memory while providing a single memory modality for each action.

Resources

Follow the project.

Learning How to Remember: Memory Modality Selection for GUI Agents
Taeyun Roh, Suhyeong Park, Gijin Kim, Wonjune Jang, and Jaewoo Kang.