GRAML: Dynamic Goal Recognition As Metric Learning

Matan Shamir, Reuth Mirsky · 2025

Read GRAML: Dynamic Goal Recognition As Metric Learning by Matan Shamir, Reuth Mirsky (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2505-03941.txt.

Introduction

Matan Shamir and Reuth Mirsky present a method for guessing an agent's goal from its actions in a 2025 paper. Learned methods avoid hand built domain models, but they can only handle a fixed goal list and need fresh training for new goals. Their method instead learns a distance over action traces.

A paired network learns to place traces that lead to the same goal close together and traces to other goals far apart. That distance then adapts to new goals from just one example trace each. Tests across varied settings show fast, flexible recognition that rivals leading methods at run time.

Catalog record

CREATORMatan Shamir, Reuth Mirsky
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE40 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2505-03941

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

GRAML: Dynamic Goal Recognition As Metric Learning Matan Shamir, Reuth Mirsky Abstract Goal Recognition (GR) is the problem of recognizing an agent’s objectives based on observed actions. Recent data-driven approaches for GR alleviate the need for costly, manually crafted domain models. However, these approaches can only reason about a pre-defined set of goals, and time-consuming training is needed for new emerging goals. To keep this model-learning automated while enabling quick adaptation to new goals, this paper introduces GRAML: Goal Recognition As Metric Learning. GRAML uses a Siamese network to treat GR as a deep metric learning task, employing an RNN that learns a metric over an embedding space, where the embeddings for observation traces leading to different goals are distant, and embeddings of traces leading to the same goals are close. This metric is especially useful when adapting to new goals, even if given just one example observation trace per goal. Evaluated on a versatile set of environments, GRAML shows speed, flexibility, and runtime improvements over the state-of-the-art GR while maintaining accurate recognition. 1 Introduction Goal Recognition (GR) involves deducing an agent’s objective based on observed actions. It plays a crucial role in various settings, including Human-Robot Interaction Massardi et al. (2020) ; Shvo et al. (2022) and Multi-Agent Systems Avrahami-Zilberbrand and Kaminka (2005) ; Freedman and Zilberstein (2017) ; Su et al. (2023) . GR problem formulations typically assume a fixed set of goals Asai et al. (2022) ; Mirsky et al. (2021) ; Ramirez and Geffner (2009) ; Amado et al. (2023) ; Ramırez and Geffner (2011) . However, consider a service robot recognizing which dish a person is making out of a recipe book with a finite set of recipes. If the robot finds that a recipe was added to the book, it will need to form a new GR problem containing the new recipe and adjust its internal state, a potentially costly process, as traditional GR methods assume a pre-defined set of goals. Adapting to the new goal and performing GR is part of a single problem named Online Dynamic Goal Recognition (ODGR). In ODGR, similar, consequent GR problems share identical or similar domain descriptions but vary in their set of goals Shamir et al. (2024) . The paper introduces a new ODGR framework called Goal Recognition as Metric Learning (GRAML) , which aims for a one-shot solution when a new set of goals emerges, supporting both discrete and continuous domains. In line with other learning-based GR approaches, GRAML involves a distinct learning phase where the domain theory is constructed and an inference phase where observations are given. In addition to these phases, GRAML addresses the potential shift in the set of potential goals between GR problems. It does so by incorporating an adaptation phase , during which the framework adjusts its internal state to align with the newly emerged goals. GRAML tackles the ODGR problem from a novel perspective. It learns a metric for comparing the observation traces leading to different goals by utilizing deep metric learning. As done in previous methods that measure similarity between different time-series Mueller and Thyagarajan (2016) , GRAML employs a Recurrent Neural Network (RNN) in a Siamese network architecture to embed sequences of observations. Its training aims that embeddings of sequences to the same goal would be closer to one another than embeddings of sequences to different goals. Upon receiving new goals, GRAML embeds any sequence to a new goal. These sequences can be received from a domain expert or be self-generated. Then, upon receiving an input sequence, its embedding is measured against the embeddings of sequences of all goals, and the closest goal is returned. This work introduces several enhancements beyond existing GR: First, GRAML offers a novel and robust model-free, self-supervised approach across continuous and discrete environments. It is aimed to improve recognition speed and applicability in complex domains, with little to no decrease in accuracy. Second, the suggested framework addresses challenges unique to ODGR, posed by environments with changing goals, a facet often overlooked by previous GR work. Third, this study presents a set of ODGR benchmark environments to test its components. These environments were designed to represent as realistic and applicative scenarios as possible by generating suboptimal and diverse goal-directed observations using a variety of agents. 2 Preliminaries We overview the definitions required for GR and provide background on Metric Learning and LSTM networks. 2.1 Goal Recognition (GR) A GR problem consists of an actor and an observer , and it is articulated through the observer’s perspective to infer the actor’s goal. We use a common definition for goal recognition Ramirez and Geffner (2009) ; Amado et al. (2023) : Definition 1 . A Goal Recognition problem is a tuple \langle T,G,O\rangle , such that T=\langle S,A\rangle is a domain theory where S is the state space and A the action space of the observed actor, G is a set of goals, and O is a sequence of observations, which are state-action tuples. The output of a GR problem is a goal g\in G that best explains O . Notice that this definition is very broad to enable different solution approaches. GR was often defined with G\subseteq S , but this work does not make this assumption regarding the nature of goals in the environment, and they can be any computable set as we see fit. For example G can be equal to S , its power set, or a set of labels. The definition assumes the actor is pursuing one goal exclusively, but there can be several different metrics to quantify the likelihood of one goal over another. On the other hand, some GR approaches can handle observations that are either a sequence of actions or states but do not require both. In this work, a Domain Theory T is modeled via an MDP: Definition 2 . A Markov Decision Process M is a tuple \langle S,A,T,r,\gamma,\rho_{0}\rangle , where S,A,\gamma and \rho_{0} denote the state space, action space, discount factor, and distribution of initial states, respectively. T:S\times A\times S\to[0,1] is the transition function, and r:S\times A\to\mathbb{R} is the reward function. In Reinforcement Learning (RL), the agent learns a stochastic policy \pi:S\times A\rightarrow[0,1] , that is aimed at maximizing the expected discounted cumulative return \mathbb{E}_{a_{t}\sim\pi(\cdot\mid s_{t}),\,s_{t+1}\sim\mathcal{T}(\cdot\mid s_{t},a_{t})}\left[\sum_{t}\gamma^{t}r(s_{t},a_{t})\right] This work focuses on infinite-horizon MDPs with a discount factor 0<\gamma<1 , where the state and action spaces can be either discrete or continuous. The RL tasks considered in this work are episodic, terminating upon task completion or after a maximum number of steps is reached. Additionally, this work utilizes Goal-conditioned RL (GCRL) Liu et al. (2022) , an approach where an agent is trained towards multiple possible goals in an episode. A GCRL agent learns a goal-conditioned policy \pi:G\times S\times A\rightarrow[0,1] , thus exhibiting different behaviors for different goals. Online Dynamic Goal Recognition Shamir et al. Shamir et al. (2024) decompose the GR process into iterated phases with distinct inputs and outputs such that each phase can occur once or more, thus shifting from a GR problem to an Online Dynamic Goal Recognition (ODGR): Definition 3 . An ODGR problem is a tuple \langle T,\langle G^{i},\{O\}^{i}\rangle_{i\in 1..n}\rangle , where T=\langle S,A\rangle is a domain theory, G^{i} is

Read the complete text