SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2607.23986 · 2026

MEMOIR: Temporal Behavioral Memory for Recommendation Across the Preference-Drift Spectrum

Younggue Bae

arXiv · PDF

Code that ran

11 of 13 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (8 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 10 have no contract verdict; 1 failure of our instrument; 2 no recorded run), measured 2026-11-23; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2607.23986.json · badge: /api/ran/2607.23986.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
louiezzang/MEMOIR community
Papers with Code archive
11 ran · 2 no recorded run
FunctionStatusWhere it lives
ANNRetriever Ran
ran on a synthesized input · constructed an object; no result was computed
louiezzang/MEMOIR/model/memoir.py
code served (permissive licence) · get_code("4abf7460f41e94f4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, ANNRetriever: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import torch.nn.functional as F

torch.manual_seed(0)

# Create small tensors for testing
batch_size = 2
embedding_dim = 4
num_items = 3

# Create user memory embeddings [B, D]
user_memory = torch.randn(batch_size, embedding_dim)

# Create item embeddings [M, D]
item_embeddings = torch.randn(num_items, embedding_dim)

# Create item IDs
item_ids = ["item_0", "item_1", "item_2"]

# Define ARGS dict with all parameters for ANNRetriever
ARGS = {
    "top_k": 50
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ANNRetriever — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ANNRetriever output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
EvolutionAwareAggregator Ran
ran on a synthesized input · constructed an object; no result was computed
louiezzang/MEMOIR/model/memoir.py
code served (permissive licence) · get_code("a32580c8a99af4b4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, EvolutionAwareAggregator: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

class EvolutionAwareAggregator(nn.Module):
    """Replaces simple recency-weighted mean with trajectory-aware aggregation.

    Concatenates [current_memory, direction_vector, predicted_next] and
    projects down to the embedding dimension.
    """

    def __init__(self, embed_dim: int=256):
        super().__init__()
        self.fuse = nn.Sequential(nn.Linear(embed_dim * 3, embed_dim * 2), nn.GELU(), nn.Linear(embed_dim * 2, embed_dim))

    def forward(self, current_memory: torch.Tensor, direction: torch.Tensor, predicted_next: torch.Tensor) -> torch.Tensor:
        """Fuse current state + direction + predicted future.

        Args:
            current_memory: [B, D] recency-weighted aggregate (baseline)
            direction: [B, D] evolution direction from TrajectoryPredictor
            predicted_next: [B, D] predicted next-step memory

        Returns:
            [B, D] evolution-aware aggregate memory
        """
        fused = torch.cat([current_memory, direction, predicted_next], dim=-1)
        return self.fuse(fused)


# Create tiny tensors with batch=2, embed_dim=4
embed_dim = 4
batch_size = 2

current_memory = torch.randn(batch_size, embed_dim)
direction = torch.randn(batch_size, embed_dim)
predicted_next = torch.randn(batch_size, embed_dim)

ARGS = {
    "embed_dim": embed_dim,
}

# Test instantiation and forward pass
model = EvolutionAwareAggregator(**ARGS)
output = model(current_memory, direction, predicted_next)
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EvolutionAwareAggregator — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a EvolutionAwareAggregator output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
EvolutionContrastive Ran
ran on a synthesized input · constructed an object; no result was computed
louiezzang/MEMOIR/model/memoir.py
code served (permissive licence) · get_code("64b0df8c98ff8dc9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, EvolutionContrastive: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import torch.nn.functional as F

torch.manual_seed(0)

# Define the EvolutionContrastive class
class EvolutionContrastive(nn.Module):
    """Contrastive learning over temporal behavioral memory windows."""

    def __init__(self, temperature: float=0.07, alpha_direction: float=0.2, margin: float=0.1):
        super().__init__()
        self.temperature = temperature
        self.alpha = alpha_direction
        self.margin = margin

    def forward(self, anchor_embeds: torch.Tensor, positive_embeds: torch.Tensor, negative_embeds: torch.Tensor, prev_anchor_embeds: torch.Tensor | None=None) -> dict[str, torch.Tensor]:
        """Compute evolution-preserving contrastive loss.

        Args:
            anchor_embeds: [N, D] - memory at time t
            positive_embeds: [N, D] - memory at time t+1 (same user)
            negative_embeds: [N, K, D] - memories from different users
            prev_anchor_embeds: [N, D] - memory at time t-1 (for directional loss)

        Returns:
            dict with 'loss', 'smoothness_loss', 'direction_loss' keys
        """
        anchor = F.normalize(anchor_embeds, dim=-1)
        positive = F.normalize(positive_embeds, dim=-1)
        negative = F.normalize(negative_embeds, dim=-1)
        pos_sim = (anchor * positive).sum(dim=-1) / self.temperature
        neg_sim = torch.bmm(negative, anchor.unsqueeze(-1)).squeeze(-1) / self.temperature
        logits = torch.cat([pos_sim.unsqueeze(-1), neg_sim], dim=-1)
        labels = torch.zeros(logits.shape[0], dtype=torch.long, device=logits.device)
        smoothness_loss = F.cross_entropy(logits, labels)
        direction_loss = torch.tensor(0.0, device=anchor.device)
        if prev_anchor_embeds is not None:
            prev_anchor = F.normalize(prev_anchor_embeds, dim=-1)
            d_prev = anchor - prev_anchor
            d_curr = positive - anchor
            min_norm = 0.001
            valid = (d_prev.norm(dim=-1) > min_norm) & (d_curr.norm(dim=-1) > min_norm)
            if valid.any():
                d_prev_norm = F.normalize(d_prev[valid], dim=-1)
                d_curr_norm = F.normalize(d_curr[valid], dim=-1)
                cosine_sim = (d_prev_norm * d_curr_norm).sum(dim=-1)
                direction_loss = F.relu(self.margin - cosine_sim).mean()
        loss = smoothness_loss + self.alpha * direction_loss
        return {'loss': loss, 'smoothness_loss': smoothness_loss, 'direction_loss': direction_loss}


# Create tiny tensors for testing
N = 2  # batch size
D = 4  # embedding dimension
K = 3  # number of negative samples

anchor_embeds = torch.randn(N, D)
positive_embeds = torch.randn(N, D)
negative_embeds = torch.randn(N, K, D)
prev_anchor_embeds = torch.randn(N, D)

ARGS = {
    'temperature': 0.07,
    'alpha_direction': 0.2,
    'margin': 0.1,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EvolutionContrastive — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a EvolutionContrastive output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
ExtrapolationLoss Ran
ran on a synthesized input
louiezzang/MEMOIR/model/memoir.py
code served (permissive licence) · get_code("4328bd9c6685cd60")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import torch.nn.functional as F

class ExtrapolationLoss(nn.Module):
    """Hold-out-last-window supervision: predicted next ≈ actual next."""

    def __init__(self, temperature: float=0.07):
        super().__init__()
        self.temperature = temperature

    def forward(self, predicted: torch.Tensor, actual: torch.Tensor) -> torch.Tensor:
        """InfoNCE between predicted next-step and actual held-out window.

        Args:
            predicted: [B, D]
            actual: [B, D]
        """
        predicted = F.normalize(predicted, dim=-1)
        actual = F.normalize(actual, dim=-1)
        sim_matrix = torch.matmul(predicted, actual.T) / self.temperature
        labels = torch.arange(sim_matrix.shape[0], device=sim_matrix.device)
        return F.cross_entropy(sim_matrix, labels)


INIT_ARGS = {
    "temperature": 0.07
}

ARGS = {
    "predicted": torch.randn(2, 4),
    "actual": torch.randn(2, 4)
}

if __name__ == "__main__":
    loss_fn = ExtrapolationLoss(**INIT_ARGS)
    output = loss_fn(**ARGS)
    print(f"Loss output: {output}")
    print(f"Output shape: {output.shape}")
    print(f"Output is scalar: {output.dim() == 0}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
ItemEncoder Ran
ran on a synthesized input · constructed an object; no result was computed
louiezzang/MEMOIR/model/memoir.py
code served (permissive licence) · get_code("d3455b74c7ef917f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, ItemEncoder: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from unittest.mock import Mock, MagicMock

torch.manual_seed(0)

# Create a mock SentenceTransformer to avoid network calls
class MockSentenceTransformer(nn.Module):
    def __init__(self, pretrained_name):
        super().__init__()
        self.embedding_dim = 4
        self.linear = nn.Linear(1, self.embedding_dim)
    
    def get_embedding_dimension(self):
        return self.embedding_dim
    
    def encode(self, texts, convert_to_tensor=False, show_progress_bar=False):
        # Return a tensor of shape [len(texts), embedding_dim]
        num_texts = len(texts) if isinstance(texts, list) else 1
        batch = torch.randn(num_texts, self.embedding_dim)
        return batch
    
    def parameters(self):
        return self.linear.parameters()

# Mock the sentence_transformers import
import sys
mock_st_module = Mock()
mock_st_module.SentenceTransformer = MockSentenceTransformer
sys.modules['sentence_transformers'] = mock_st_module

ARGS = {
    'pretrained': 'sentence-transformers/all-MiniLM-L6-v2',
    'output_dim': 3,
    'freeze_base': True,
    'num_experts': 2,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
sentence_transformers, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ItemEncoder — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ItemEncoder output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
MoEAdaptor Ran
ran on a synthesized input · constructed an object; no result was computed
louiezzang/MEMOIR/model/memoir.py
code served (permissive licence) · get_code("909a7d518ce9ecae")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, MoEAdaptor: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# MoEAdaptor parameters
input_dim = 4
output_dim = 3
num_experts = 2

ARGS = {
    "input_dim": input_dim,
    "output_dim": output_dim,
    "num_experts": num_experts,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MoEAdaptor — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MoEAdaptor output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
RandomItemEncoder Ran
ran on a synthesized input · constructed an object; no result was computed
louiezzang/MEMOIR/model/memoir.py
code served (permissive licence) · get_code("29ade0938d6de5af")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, RandomItemEncoder: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    "num_items": 100,
    "output_dim": 256,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type RandomItemEncoder — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a RandomItemEncoder output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
ReasoningLayer Ran
ran on a synthesized input · constructed an object; no result was computed
louiezzang/MEMOIR/model/memoir.py
code served (permissive licence) · get_code("ef8bd6ba120d65b6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, ReasoningLayer: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Define ARGS with all parameters for ReasoningLayer.__init__
ARGS = {
    "embed_dim": 256,
    "num_heads": 4,
    "num_layers": 2,
    "dropout": 0.1,
}

# Create an instance to verify it works
model = nn.Module()
reasoning_layer = nn.Module()

# Build a minimal test to ensure the function signature is correct
embed_dim = ARGS["embed_dim"]
batch_size = 2
num_windows = 3
num_candidates = 5

# Create test inputs matching the forward signature
user_memories = torch.randn(batch_size, num_windows, embed_dim)
candidate_items = torch.randn(batch_size, num_candidates, embed_dim)
memory_mask = torch.ones(batch_size, num_windows, dtype=torch.bool)

# Instantiate the layer
layer = nn.Module()
from torch.nn import TransformerDecoderLayer, TransformerDecoder, Linear, GELU, Sequential

decoder_layer = TransformerDecoderLayer(
    d_model=ARGS["embed_dim"],
    nhead=ARGS["num_heads"],
    dim_feedforward=ARGS["embed_dim"] * 4,
    dropout=ARGS["dropout"],
    batch_first=True
)
decoder = TransformerDecoder(decoder_layer, num_layers=ARGS["num_layers"])
score_head = Sequential(
    Linear(ARGS["embed_dim"], ARGS["embed_dim"] // 2),
    GELU(),
    Linear(ARGS["embed_dim"] // 2, 1)
)

# Test forward pass would work
memory_key_padding_mask = ~memory_mask if memory_mask is not None else None
reasoned = decoder(tgt=candidate_items, memory=user_memories, memory_key_padding_mask=memory_key_padding_mask)
scores = score_head(reasoned).squeeze(-1)

# Verify output shape
assert scores.shape == (batch_size, num_candidates), f"Expected shape {(batch_size, num_candidates)}, got {scores.shape}"

ARGS
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ReasoningLayer — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ReasoningLayer output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
TrajectoryPredictor Ran
ran on a synthesized input · constructed an object; no result was computed
louiezzang/MEMOIR/model/memoir.py
code served (permissive licence) · get_code("a4305da2ede43f87")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, TrajectoryPredictor: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Define ARGS dict with all parameters for TrajectoryPredictor.__init__
ARGS = {
    'embed_dim': 4,
    'hidden_dim': 8,
    'num_layers': 2,
    'dropout': 0.1
}

# Create model instance to verify it works
model = nn.Module.__new__(type('TrajectoryPredictor', (nn.Module,), {
    '__init__': lambda self, embed_dim=256, hidden_dim=256, num_layers=1, dropout=0.1: (
        super(type(self), self).__init__(),
        setattr(self, 'gru', nn.GRU(input_size=embed_dim, hidden_size=hidden_dim, num_layers=num_layers, batch_first=True, dropout=dropout if num_layers > 1 else 0.0)),
        setattr(self, 'predictor', nn.Sequential(nn.Linear(hidden_dim, hidden_dim), nn.GELU(), nn.Linear(hidden_dim, embed_dim)))
    )
}))

# Test forward call setup
B, W, D = 2, 3, 4
H = 8

memory_sequence = torch.randn(B, W, D)
window_masks = torch.tensor([[True, True, True], [True, True, False]])

ARGS
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type TrajectoryPredictor — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a TrajectoryPredictor output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_autocast_ctx Ran
ran; our contract draft was wrong, not the code
louiezzang/MEMOIR/model/memoir.py
code served (permissive licence) · get_code("691326049571e105")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned nullcontext. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import contextlib

torch.manual_seed(0)

# The function takes a torch.device and returns an autocast context manager
# It checks device.type and returns either torch.amp.autocast or contextlib.nullcontext
# We need to provide a valid torch.device object

# Test with CPU device (since we're CPU-only)
device = torch.device('cpu')

ARGS = {
    'device': device
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type nullcontext — a nullcontext output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a nullcontext output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_device Ran
ran on a synthesized input
louiezzang/MEMOIR/model/memoir.py
code served (permissive licence) · get_code("2853687cb37aa378")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned device. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The function get_device() takes no parameters
# It only uses torch.cuda.is_available(), torch.backends.mps.is_available(), 
# and torch.device() which are all built-in torch functions

ARGS = {}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type device — a device output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a device output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
LLMMemoryEncoder Not yet run
unverified (harvested, no recorded run)
louiezzang/MEMOIR/model/memoir.py
code served (permissive licence) · get_code("a0f1e3d80d12f802")
How it ran

no invocation recorded.

MEMOIRModel Not yet run
unverified (harvested, no recorded run)
louiezzang/MEMOIR/model/memoir.py
code served (permissive licence) · get_code("8129bfe11092b069")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 13 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

We propose MEMOIR, a framework that segments user interaction histories into temporal windows, generates semantic behavioral memory for each period using an LLM, and aggregates current state, evolution direction, and predicted future into a single user representation. On the Electronics and Clothing_Shoes_and_Jewelry categories of Amazon Reviews 2023, MEMOIR is statistically tied with UniSRec, the strongest baseline, on aggregate NDCG@10 (0.0643 vs. 0.0641), splitting the four reported metrics 2-2: MEMOIR leads NDCG@10 and MRR, UniSRec leads HR@10 and HR@20. An ablation study finds that no single architectural component-the evolution-preserving contrastive loss, its directional-consistency term, or temporal window segmentation itself-individually explains much of MEMOIR's ≈18% relative gain over ID-based SAS-Rec; all four ablations land within 2% of the full model on aggregate NDCG@10. Stratifying test performance by a composite preferencedrift score instead reveals where the gain concentrates: MEMOIR leads on ranking-quality metrics (NDCG@10, MRR) specifically among users at the high-and low-drift extremes of the distribution, while UniSRec leads the volume-oriented HR@10/HR@20 metrics across all drift strata and edges out MEMOIR on ranking quality in the middle band. We report this drift-stratified pattern, rather than the near-tied aggregate numbers or any single ablated component, as MEMOIR's most substantive and reproducible finding, and surface why it holds as an open question for future work. • Information systems → Recommender systems; • Computing methodologies → Natural language processing.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2607.23986")
get_code_for_paper("2607.23986")
have("2607.23986")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2607.23986.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2607.23986.svg)](https://syntology.ai/paper/2607.23986)

Connect an agent — have() is free.