TReMu: Towards Neuro-Symbolic Temporal Reasoning for LLM-Agents with Memory in Multi-Session Dialogues

Yubin Ge, Salvatore Romeo, Jason Cai, Raphael Shu, Monica Sunkara, Yassine Benajiba, Yi Zhang

TL;DR

Large Language Models (LLMs) frequently stumble when tracking time across long, multi-session conversations due to shifting relative time expressions (like "last week") and complex cross-session dependencies. To solve this, researchers have introduced TReMu, a framework that combines time-aware timeline summarization with neuro-symbolic reasoning by prompting LLMs to generate and execute Python code for precise temporal calculations. Tested on a newly augmented multi-session dialogue benchmark, TReMu boosts GPT-4o's temporal reasoning accuracy from a baseline of 29.83% to an impressive 77.67%.

What Problem Does This Paper Address?

While LLMs have advanced significantly in general reasoning, their ability to track time over long-term, multi-session interactions remains a major bottleneck. Existing temporal benchmarks typically focus on short, static texts like Wikipedia articles or brief stories with explicit dates.

Real-world human conversations are much messier. They span weeks or months and exhibit two tricky characteristics:

  1. Relative Time Expressions: Speakers rarely use exact dates; they say things like "last Friday" or "three days ago," requiring the agent to anchor these phrases to the specific session date.
  2. Cross-Session Dependencies: Conversations evolve over time. An entity or event mentioned in Session 1 might change or be recalled in Session 10, creating long-range contextual dependencies that get buried under "historical noise" or exceed the LLM's context window.
Examples of relative time and cross-session dependency challenges in multi-session dialogues.

Methods

The authors introduce TReMu (Temporal Reasoning for LLM-Agents in Multi-Session Dialogues), a framework consisting of two core components:

  1. Time-Aware Memorization: Instead of summarizing an entire dialogue session holistically, TReMu extracts fine-grained memory pieces and explicitly associates each event with an inferred absolute date. These events are organized into a structured timeline format. This decouples when an event occurred from when it was mentioned, significantly reducing temporal ambiguity during memory retrieval.
  2. Neuro-Symbolic Temporal Reasoning: When faced with a temporal question, the agent retrieves the relevant timeline memories and generates Python code rather than attempting to compute dates using natural language. By leveraging robust libraries like datetime and dateutil.relativedelta, the LLM offloads complex date math (e.g., calculating durations or determining event precedence) to a deterministic Python interpreter. The executed code output serves as a highly precise intermediate rationale to select the final answer.

Datasets

Because existing benchmarks do not adequately test these specific multi-session temporal dynamics, the authors constructed a new evaluation dataset by augmenting LoCoMo, a dataset characterized by exceptionally long dialogues (averaging 600 turns and 16,000 tokens across up to 32 sessions).

The resulting benchmark contains 600 multiple-choice questions split across three distinct reasoning types:

  • Temporal Anchoring: Determining the exact date of a single event described in relative terms.
  • Temporal Precedence: Figuring out which of two events occurred first.
  • Temporal Interval: Calculating the duration between two events.
  • Unanswerable Questions: 112 of the questions are intentionally unanswerable from the text to rigorously test the model's overconfidence and validation capabilities.
Table 1: Statistics of the chosen multi-session dialogue dataset, LoCoMo, compared to others.

Key Insights and Ideas

  • Memory Structure Matters: Standard conversational memory methods (like MemoChat) summarize by topic, which strips out crucial temporal context. Indexing memories explicitly by inferred timesteps is vital for long-term consistency.
  • Code as the Ultimate Chain-of-Thought: Traditional Chain-of-Thought (CoT) prompting helps LLMs break down problems, but LLMs are notoriously bad at arithmetic and calendar math in natural language. Treating the intermediate reasoning step as a executable Python script bypasses the LLM's mathematical limitations entirely.
  • Context Length Isn't a Cure-All: Interestingly, for advanced models with massive context windows (like GPT-4o), simply stuffing the entire raw dialogue history into the prompt (Standard Prompting) yielded terrible results (29.83% accuracy). The models get overwhelmed by historical noise, proving that smart memory retrieval mechanisms remain essential regardless of context window size.

Key Results

The framework was evaluated using three prominent closed-source models: GPT-4o, GPT-4o-mini, and GPT-3.5-Turbo.

  • GPT-4o Performance: Standard Prompting achieved only 29.83% accuracy, and Chain-of-Thought improved it to 61.67%. TReMu achieved the highest overall accuracy at 77.67%.
  • Ablation Success: Replacing standard memory with time-aware timeline memory (Timeline + CoT) brought accuracy up to 71.50%, while adding the symbolic Python execution layer (TReMu) provided the final crucial performance bump to 77.67%.
  • Code Reliability: The approach proved highly reliable in practice. The percentage of code execution failures during inference was remarkably low: just 1.80% for GPT-4o and 7.83% for GPT-4o-mini.
Figure 2: The percentage of execution failures.

Limitations and Future Work

The authors note two primary limitations:

  • Multiple-Choice Constraint: The benchmark relies on a multiple-choice format to ensure reliable, automated evaluation metrics. Extending this framework to evaluate open-ended, generative dialogue settings remains an open challenge.
  • Open-Source LLM Constraints: The experiments focused on closed-source models because current open-source models (such as Llama-3-70B) struggled to handle the long dialogue inputs or failed to consistently follow the complex formatting instructions required for the neuro-symbolic pipeline. Adapting TReMu to open-source architectures is a key direction for future research.

Summary updated

BibTeX
@inproceedings{ge2025tremu,
  author = {Yubin Ge and Salvatore Romeo and Jason Cai and Raphael Shu and Monica Sunkara and Yassine Benajiba and Yi Zhang},
  title = {{TReMu: Towards Neuro-Symbolic Temporal Reasoning for LLM-Agents with Memory in Multi-Session Dialogues}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure